Thread: [Agate-svn-commit] SF.net SVN: agate:[1484] trunk (Page 7)
Status: Alpha
Brought to you by:
kanato
|
From: <ka...@us...> - 2014-08-28 04:30:47
|
Revision: 1484
http://sourceforge.net/p/agate/code/1484
Author: kanato
Date: 2014-08-28 04:30:28 +0000 (Thu, 28 Aug 2014)
Log Message:
-----------
Reorganize source code and rename project files
Modified Paths:
--------------
trunk/AgateLib-Windows.sln
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
Added Paths:
-----------
trunk/AgateLib.OpenGL/
trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
trunk/AgateLib.Platform.WinForms/
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WindowsMetro/
trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj
trunk/AgateLib.Platform.WindowsPhone/
trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
trunk/AgateLib.Tests/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Properties/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Properties/AssemblyInfo.cs
trunk/AgateLib.Tests/Tests.WinForms/
trunk/AgateLib.Tests/UnitTests/
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
trunk/ObsoleteDrivers/
Removed Paths:
-------------
trunk/AgateLib.GL/
trunk/AgateLib.OpenGL/AgateLib.GL.csproj
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WindowsForms.csproj
trunk/AgateLib.Platform.Windows/
trunk/AgateLib.Platform.WindowsForms/
trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.Windows.csproj
trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone8.csproj
trunk/AgateLib.Platform.WindowsPhone8/
trunk/AgateLib.Tests/UnitTests/UnitTests.csproj
trunk/Drivers/
trunk/IntegrationTests/
trunk/Tests/
trunk/Tests.WindowsPhone/
trunk/Tests.WindowsStore/
trunk/UnitTests/
Modified: trunk/AgateLib-Windows.sln
===================================================================
--- trunk/AgateLib-Windows.sln 2014-08-28 03:31:22 UTC (rev 1483)
+++ trunk/AgateLib-Windows.sln 2014-08-28 04:30:28 UTC (rev 1484)
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30501.0
+VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{6AFA2E43-361A-4AA6-83D9-6DE946C1F0B6}"
ProjectSection(SolutionItems) = preProject
@@ -9,12 +9,8 @@
TODO.txt = TODO.txt
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib", "AgateLib\AgateLib.csproj", "{9490B719-829E-43A7-A5FE-8001F8A81759}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{F22ADCCC-7991-4F52-B2D0-697D60121BB3}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{761301C3-2DC0-4F66-8B66-B16DF998F6C0}"
ProjectSection(SolutionItems) = preProject
Build.proj = Build.proj
@@ -22,151 +18,229 @@
.build\MSBuild.Community.Tasks.targets = .build\MSBuild.Community.Tasks.targets
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "IntegrationTests\IntegrationTests.csproj", "{796D3B53-8828-475C-B5FF-5CA09F423C8A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.AgateSDL", "AgateLib.AgateSDL\AgateLib.AgateSDL.csproj", "{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.GL", "AgateLib.GL\AgateLib.GL.csproj", "{94734E5A-0344-43E8-BB30-E32E3F57F611}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.OpenGL", "AgateLib.OpenGL\AgateLib.OpenGL.csproj", "{94734E5A-0344-43E8-BB30-E32E3F57F611}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsForms", "AgateLib.Platform.WindowsForms\AgateLib.Platform.WindowsForms.csproj", "{4B12561E-D37B-48A1-B6DB-218E94906C22}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.Common", "AgateLib.Platform.Common\AgateLib.Platform.Common.csproj", "{FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.AgateSDL", "AgateLib.AgateSDL\AgateLib.AgateSDL.csproj", "{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsMetro", "AgateLib.Platform.WindowsMetro\AgateLib.Platform.WindowsMetro.csproj", "{C9B8F763-187D-4F2E-BAEE-827B7247C278}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsPhone", "AgateLib.Platform.WindowsPhone\AgateLib.Platform.WindowsPhone.csproj", "{9BEF78DB-B535-47D3-9C14-453D373807EC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsStoreCommon", "AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj", "{C7F9AE34-B781-4490-A9B2-5728F44F3523}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WinForms", "AgateLib.Platform.WinForms\AgateLib.Platform.WinForms.csproj", "{4B12561E-D37B-48A1-B6DB-218E94906C22}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.Portable", "AgateLib.Tests\AgateLib.Tests.Portable\AgateLib.Tests.Portable.csproj", "{3AAA6832-55D7-47A9-AF95-9393792ECB2C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.UnitTests", "AgateLib.Tests\UnitTests\AgateLib.Tests.UnitTests.csproj", "{F22ADCCC-7991-4F52-B2D0-697D60121BB3}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Public|Any CPU = Public|Any CPU
+ Public|ARM = Public|ARM
Public|x64 = Public|x64
Public|x86 = Public|x86
Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x64.ActiveCfg = Debug|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x64.Build.0 = Debug|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x86.ActiveCfg = Debug|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x86.Build.0 = Debug|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Public|Any CPU.ActiveCfg = Release|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Public|x64.ActiveCfg = Release|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Public|x64.Build.0 = Release|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Public|x86.ActiveCfg = Debug|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Public|x86.Build.0 = Debug|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.Build.0 = Release|Any CPU
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x64.ActiveCfg = Release|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x64.Build.0 = Release|x64
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.ActiveCfg = Release|x86
- {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.Build.0 = Release|x86
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.ActiveCfg = Debug|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.Build.0 = Debug|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.ActiveCfg = Debug|x86
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.Build.0 = Debug|x86
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|Any CPU.ActiveCfg = Release|x86
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x64.ActiveCfg = Release|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x64.Build.0 = Release|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x86.ActiveCfg = Debug|x86
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x86.Build.0 = Debug|x86
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|Any CPU.Build.0 = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|ARM.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x64.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Public|x86.ActiveCfg = Release|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.Build.0 = Release|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x64.ActiveCfg = Release|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x64.Build.0 = Release|x64
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.ActiveCfg = Release|x86
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.Build.0 = Release|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x64.ActiveCfg = Debug|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x64.Build.0 = Debug|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x86.ActiveCfg = Debug|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x86.Build.0 = Debug|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|Any CPU.ActiveCfg = Release|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|Any CPU.Build.0 = Release|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x64.ActiveCfg = Release|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x64.Build.0 = Release|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x86.ActiveCfg = Release|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x86.Build.0 = Release|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|Any CPU.Build.0 = Release|Any CPU
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x64.ActiveCfg = Release|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x64.Build.0 = Release|x64
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x86.ActiveCfg = Release|x86
- {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x86.Build.0 = Release|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|x64.ActiveCfg = Debug|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|x64.Build.0 = Debug|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|x86.ActiveCfg = Debug|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Debug|x86.Build.0 = Debug|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|Any CPU.ActiveCfg = Release|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|Any CPU.Build.0 = Release|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|x64.ActiveCfg = Release|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|x64.Build.0 = Release|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|x86.ActiveCfg = Release|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Public|x86.Build.0 = Release|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|Any CPU.Build.0 = Release|Any CPU
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|x64.ActiveCfg = Release|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|x64.Build.0 = Release|x64
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|x86.ActiveCfg = Release|x86
- {796D3B53-8828-475C-B5FF-5CA09F423C8A}.Release|x86.Build.0 = Release|x86
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|ARM.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x64.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.ActiveCfg = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.ActiveCfg = Debug|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.Build.0 = Debug|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.ActiveCfg = Debug|x86
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.Build.0 = Debug|x86
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|Any CPU.Build.0 = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|ARM.ActiveCfg = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x64.ActiveCfg = Release|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x64.Build.0 = Release|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x86.ActiveCfg = Release|x86
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x86.Build.0 = Release|x86
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|ARM.ActiveCfg = Release|Any CPU
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.ActiveCfg = Release|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.Build.0 = Release|x64
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.ActiveCfg = Release|x86
+ {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.Build.0 = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|ARM.ActiveCfg = Debug|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x64.ActiveCfg = Debug|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x64.Build.0 = Debug|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x86.ActiveCfg = Debug|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x86.Build.0 = Debug|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|Any CPU.ActiveCfg = Release|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|Any CPU.Build.0 = Release|Any CPU
+ {94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|ARM.ActiveCfg = Release|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|x64.ActiveCfg = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|x64.Build.0 = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|x86.ActiveCfg = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Public|x86.Build.0 = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Any CPU.Build.0 = Release|Any CPU
+ {94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|ARM.ActiveCfg = Release|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x64.ActiveCfg = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x64.Build.0 = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.ActiveCfg = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.Build.0 = Release|x86
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|Any CPU.Build.0 = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|ARM.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|x64.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|x86.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|ARM.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|x64.ActiveCfg = Release|Any CPU
+ {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|x86.ActiveCfg = Release|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|ARM.ActiveCfg = Debug|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|ARM.Build.0 = Debug|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|x64.ActiveCfg = Debug|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|x64.Build.0 = Debug|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|x86.ActiveCfg = Debug|x86
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|x86.Build.0 = Debug|x86
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|Any CPU.Build.0 = Release|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|ARM.ActiveCfg = Release|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|ARM.Build.0 = Release|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|x64.ActiveCfg = Release|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|x64.Build.0 = Release|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|x86.ActiveCfg = Release|x86
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Public|x86.Build.0 = Release|x86
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|ARM.ActiveCfg = Release|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|ARM.Build.0 = Release|ARM
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|x64.ActiveCfg = Release|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|x64.Build.0 = Release|x64
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|x86.ActiveCfg = Release|x86
+ {C9B8F763-187D-4F2E-BAEE-827B7247C278}.Release|x86.Build.0 = Release|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|ARM.ActiveCfg = Debug|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|ARM.Build.0 = Debug|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|x86.ActiveCfg = Debug|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Debug|x86.Build.0 = Debug|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|Any CPU.Build.0 = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|ARM.ActiveCfg = Release|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|ARM.Build.0 = Release|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|x64.ActiveCfg = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|x86.ActiveCfg = Release|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Public|x86.Build.0 = Release|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|ARM.ActiveCfg = Release|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|ARM.Build.0 = Release|ARM
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|x64.ActiveCfg = Release|Any CPU
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|x86.ActiveCfg = Release|x86
+ {9BEF78DB-B535-47D3-9C14-453D373807EC}.Release|x86.Build.0 = Release|x86
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Public|Any CPU.Build.0 = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Public|ARM.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Public|x64.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Public|x86.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Release|ARM.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Release|x64.ActiveCfg = Release|Any CPU
+ {C7F9AE34-B781-4490-A9B2-5728F44F3523}.Release|x86.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x64.ActiveCfg = Debug|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x64.Build.0 = Debug|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x86.ActiveCfg = Debug|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x86.Build.0 = Debug|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|Any CPU.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|Any CPU.Build.0 = Release|Any CPU
+ {4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|ARM.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|x64.ActiveCfg = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|x64.Build.0 = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|x86.ActiveCfg = Release|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Public|x86.Build.0 = Release|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|ARM.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x64.ActiveCfg = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x64.Build.0 = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x86.ActiveCfg = Release|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x86.Build.0 = Release|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.ActiveCfg = Debug|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.Build.0 = Debug|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.ActiveCfg = Debug|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.Build.0 = Debug|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|Any CPU.ActiveCfg = Release|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|Any CPU.Build.0 = Release|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x64.ActiveCfg = Release|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x64.Build.0 = Release|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x86.ActiveCfg = Release|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Public|x86.Build.0 = Release|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.Build.0 = Release|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.ActiveCfg = Release|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.Build.0 = Release|x64
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.ActiveCfg = Release|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.Build.0 = Release|x86
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Public|Any CPU.Build.0 = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Public|ARM.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Public|x64.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Public|x86.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Release|ARM.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Release|x64.ActiveCfg = Release|Any CPU
+ {3AAA6832-55D7-47A9-AF95-9393792ECB2C}.Release|x86.ActiveCfg = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x64.ActiveCfg = Debug|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x64.Build.0 = Debug|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x86.ActiveCfg = Debug|x86
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Debug|x86.Build.0 = Debug|x86
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|Any CPU.Build.0 = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|ARM.ActiveCfg = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x64.ActiveCfg = Release|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x64.Build.0 = Release|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x86.ActiveCfg = Release|x86
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Public|x86.Build.0 = Release|x86
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|ARM.ActiveCfg = Release|Any CPU
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x64.ActiveCfg = Release|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x64.Build.0 = Release|x64
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x86.ActiveCfg = Release|x86
+ {F22ADCCC-7991-4F52-B2D0-697D60121BB3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Deleted: trunk/AgateLib.OpenGL/AgateLib.GL.csproj
===================================================================
--- trunk/AgateLib.GL/AgateLib.GL.csproj 2014-08-28 02:34:56 UTC (rev 1482)
+++ trunk/AgateLib.OpenGL/AgateLib.GL.csproj 2014-08-28 04:30:28 UTC (rev 1484)
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{94734E5A-0344-43E8-BB30-E32E3F57F611}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>AgateLib.GL</RootNamespace>
- <AssemblyName>AgateLib.GL</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\Binaries\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\Binaries\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x86\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>MinimumRe...
[truncated message content] |
|
From: <ka...@us...> - 2014-08-30 23:56:13
|
Revision: 1486
http://sourceforge.net/p/agate/code/1486
Author: kanato
Date: 2014-08-30 23:55:55 +0000 (Sat, 30 Aug 2014)
Log Message:
-----------
Operation on Windows Phone greatly improved. Surfaces and clip rects work, running multiple tests in a row works.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/ApplicationModels/AgateAppModel.cs
trunk/AgateLib/ApplicationModels/AssetLocations.cs
trunk/AgateLib/ApplicationModels/EntryPointAppModelBase.cs
trunk/AgateLib/ApplicationModels/ModelParameters.cs
trunk/AgateLib/ApplicationModels/Scene.cs
trunk/AgateLib/ApplicationModels/SceneAppModelBase.cs
trunk/AgateLib/ApplicationModels/SceneStack.cs
trunk/AgateLib/Core.cs
trunk/AgateLib/DisplayLib/Display.cs
trunk/AgateLib/DisplayLib/Font.cs
trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs
trunk/AgateLib/DisplayLib/Surface.cs
trunk/AgateLib/Drivers/IDisplayFactory.cs
trunk/AgateLib/Geometry/Color.cs
trunk/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs
trunk/AgateLib/Particles/Emitters/SpriteEmitter.cs
trunk/AgateLib/Settings/PersistantSettings.cs
trunk/AgateLib/Sprites/Sprite.cs
trunk/AgateLib-Windows.sln
trunk/AgateLib.AgateSDL/AgateLib.AgateSDL.csproj
trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
trunk/AgateLib.OpenGL/GL3/DrawBuffer.cs
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WinForms/ApplicationModels/PassiveModel.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/SerialModel.cs
trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/ContextInfo.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/DesktopGLDisplay.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_Surface.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/IPrimaryWindow.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/frmFullScreen.Designer.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/frmFullScreen.cs
trunk/AgateLib.Platform.WinForms/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/PlatformFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/SysIoFile.cs
trunk/AgateLib.Platform.WinForms/Factories/SysIoPath.cs
trunk/AgateLib.Platform.WinForms/PixelBufferExtensions.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/FormsPlatformInfo.cs
trunk/AgateLib.Platform.WinForms/Resources/BuiltinResources.cs
trunk/AgateLib.Platform.WinForms/SurfaceExtensions.cs
trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj
trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WindowsMetro/Factories/WinPlatformFactory.cs
trunk/AgateLib.Platform.WindowsMetro/Factories/WindowsFactory.cs
trunk/AgateLib.Platform.WindowsMetro/WindowsInitializer.cs
trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WindowsPhone/Factories/WPPlatformFactory.cs
trunk/AgateLib.Platform.WindowsPhone/Factories/WindowsPhoneFactory.cs
trunk/AgateLib.Platform.WindowsPhone/WindowsPhoneInitializer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/D3DDevice.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/DrawBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferSurface.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_DisplayWindow.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_FrameBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_IndexBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_VertexBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/Shaders/SDX_Basic2DShader.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/Shaders/SDX_Lighting2DShader.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/Shaders/SDX_Lighting3DShader.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/Shaders/ShaderFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/Shaders/ShaderSourceProvider.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/FakeFile.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/FakePath.cs
trunk/AgateLib.Platform.WindowsStoreCommon/IRenderTargetAdapter.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Interop.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/DiagnosticsStopwatch.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStorePlatformFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/ShaderSource/Basic2Dpixel.hlsl
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeAgateFactory.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeDisplayDriver.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeDisplayWindow.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFontSurface.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFrameBuffer.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakePlatformFactory.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakePlatformInfo.cs
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/AudioPlayer/AudioPlayer.cs
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/AudioPlayer/frmAudioPlayer.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/AudioPlayer/frmAudioPlayer.cs
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/SoundbufferStopTester.cs
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/StreamAudio.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/ErrorReport/ErrorReport.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/ErrorReport/frmErrorReport.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/ErrorReport/frmErrorReport.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/PersistantSettingsTest.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/PlatformDetection/PlatformDetection.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/PlatformDetection/PlatformDetection.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/PlatformDetection/PlatformDetector.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Resources.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Timers/Timers.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Timers/frmTimers.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Timers/frmTimers.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/BasicDrawing/BasicDrawing.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/BasicDrawing/DrawingTester.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/BasicDrawing/DrawingTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Capabilities/Capabilities.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Capabilities/frmCapabilities.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Capabilities/frmCapabilities.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/DisplayWindowEvents.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/FullScreen.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/LargeImage.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleFramebufferTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleWindows/MultipleRenderTargetExample.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleWindows/MultipleWindowTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/PixelBufferMask.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/PixelBufferTest/PixelBufferForm.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/PixelBufferTest/PixelBufferForm.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/PixelBufferTest/PixelBufferTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Prerendered.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RenderStates/RenderStates.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RenderStates/frmRenderStateTest.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RenderStates/frmRenderStateTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RenderTargetContinuous.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/ScreenCapture.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SpriteTester/SpriteTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SpriteTester/frmChooseSprite.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SpriteTester/frmChooseSprite.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SpriteTester/frmSpriteTester.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SpriteTester/frmSpriteTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SurfaceTester/SurfaceTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SurfaceTester/frmSurfaceTester.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/SurfaceTester/frmSurfaceTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TestPacker/TestPacker.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TestPacker/frmTestPacker.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TestPacker/frmTestPacker.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TileTester/TileTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TileTester/frmTileTester.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/TileTester/frmTileTester.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/BitmapFonts.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/FontAlignment.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/FontLineTester.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/Fonts.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/Kerning.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/Input/InputTester.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/Input/frmInputTester.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/Input/frmInputTester.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/Hlsl.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/Lighting3DTest.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/LightingTest/LightingTest.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/LightingTest/LightingTestForm.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/LightingTest/LightingTestForm.cs
trunk/AgateLib.Tests/Tests.WinForms/TestLauncher.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/GuiStuff.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/GuiTest.cs
trunk/AgateLib.Tests/Tests.WinForms/WinFormsTests/Converters.cs
trunk/AgateLib.Tests/Tests.WinForms/frmLauncher.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/frmLauncher.cs
trunk/AgateLib.Tests/Tests.WinForms/frmLauncher.resx
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
trunk/AgateLib.Tests/UnitTests/Algorithms/EMathTest.cs
trunk/AgateLib.Tests/UnitTests/ApplicationModels/ArgumentProcessing.cs
trunk/AgateLib.Tests/UnitTests/ApplicationModels/CoordinateSystemTest.cs
trunk/AgateLib.Tests/UnitTests/Display/DisplayTests.cs
trunk/AgateLib.Tests/UnitTests/Display/DisplayWindowTest.cs
trunk/AgateLib.Tests/UnitTests/Display/FontTests.cs
trunk/AgateLib.Tests/UnitTests/Extensions/ListExtensions.cs
trunk/AgateLib.Tests/UnitTests/Resources/SerializationTest.cs
trunk/AgateLib.Tests/UnitTests/Serialization/Xle/XSTests.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs
trunk/AgateLib.Tests/UnitTests/Utility/RefTest.cs
Added Paths:
-----------
trunk/AgateLib/ApplicationModels/PassiveModelParameters.cs
trunk/AgateLib/ApplicationModels/SceneModelParameters.cs
trunk/AgateLib/ApplicationModels/SerialModelParameters.cs
trunk/AgateLib/Assets/
trunk/AgateLib/Assets/Fonts.cs
trunk/AgateLib/Geometry/CoordinateSystems/FixedCoordinateSystem.cs
trunk/AgateLib.Platform.WinForms/Controls/
trunk/AgateLib.Platform.WinForms/Controls/AgateRenderTarget.Designer.cs
trunk/AgateLib.Platform.WinForms/Controls/AgateRenderTarget.cs
trunk/AgateLib.Platform.WinForms/Controls/DisplayWindowForm.Designer.cs
trunk/AgateLib.Platform.WinForms/Controls/DisplayWindowForm.cs
trunk/AgateLib.Platform.WinForms/Controls/DisplayWindowForm.resx
trunk/AgateLib.Platform.WinForms/Controls/FormUtil.cs
trunk/AgateLib.Platform.WinForms/Controls/Icons.Designer.cs
trunk/AgateLib.Platform.WinForms/Controls/Icons.resx
trunk/AgateLib.Platform.WinForms/Fonts/
trunk/AgateLib.Platform.WinForms/Fonts/BitmapFontUtil.cs
trunk/AgateLib.Platform.WinForms/Fonts/BitmapFontUtilRenderers.cs
trunk/AgateLib.Platform.WinForms/FormsInterop.cs
trunk/AgateLib.Platform.WinForms/Geometry/
trunk/AgateLib.Platform.WinForms/Geometry/TypeConverters.cs
trunk/AgateLib.Platform.WinForms/IO/
trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
trunk/AgateLib.Platform.WinForms/WinFormsInitializer.cs
trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SerialModel.cs
trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/
trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSceneModelParameters.cs
trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSerialModelParameters.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStorePlatformInfo.cs
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/boxsprite.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/tile1.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/tile2.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/wallpaper.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/BasicSprite.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/ClipRect.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/ColorTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/Interpolation.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/ParticleTests.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/RotatingSpriteTester.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/Tiling.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FontTests/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FontTests/Builtin.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FontTests/TextLayout.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/IAgateTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/IDiscreteAgateTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/ISceneModelTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/ISerialModelTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/TestCollection.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/TestInfo.cs
trunk/AgateLib.Tests/Tests.WinForms/Assets/
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/CoordinateSystem.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/
trunk/AgateLib.Tests/Tests.WinForms/InputTests/InputStateTester.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/
trunk/AgateLib.Tests/Tests.WindowsPhone/App.xaml
trunk/AgateLib.Tests/Tests.WindowsPhone/App.xaml.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/Logo.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/SmallLogo.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/SplashScreen.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/Square71x71Logo.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/StoreLogo.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/WideLogo.scale-240.png
trunk/AgateLib.Tests/Tests.WindowsPhone/Assets/boxsprite.png
trunk/AgateLib.Tests/Tests.WindowsPhone/MainPage.xaml
trunk/AgateLib.Tests/Tests.WindowsPhone/MainPage.xaml.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/Package.appxmanifest
trunk/AgateLib.Tests/Tests.WindowsPhone/Properties/
trunk/AgateLib.Tests/Tests.WindowsPhone/Properties/AssemblyInfo.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml
trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/Tests.WindowsPhone.csproj
trunk/AgateLib.Tests/UnitTests/Algorithms/PathFinding/
trunk/AgateLib.Tests/UnitTests/Algorithms/PathFinding/AStarTest.cs
trunk/AgateLib.Tests/UnitTests/Diagnostics/
trunk/AgateLib.Tests/UnitTests/Diagnostics/ConsoleTests.cs
trunk/AgateLib.Tests/UnitTests/Platform/
trunk/AgateLib.Tests/UnitTests/Platform/PlatformTests.cs
trunk/AgateLib.Tests/UnitTests/Serialization/Xle/TestSerializable.cs
trunk/Tests/
trunk/Tests/Tests.WindowsMetro/
trunk/Tests/Tests.WindowsMetro/App.xaml
trunk/Tests/Tests.WindowsMetro/App.xaml.cs
trunk/Tests/Tests.WindowsMetro/Assets/
trunk/Tests/Tests.WindowsMetro/Assets/Logo.scale-100.png
trunk/Tests/Tests.WindowsMetro/Assets/SmallLogo.scale-100.png
trunk/Tests/Tests.WindowsMetro/Assets/SplashScreen.scale-100.png
trunk/Tests/Tests.WindowsMetro/Assets/StoreLogo.scale-100.png
trunk/Tests/Tests.WindowsMetro/MainPage.xaml
trunk/Tests/Tests.WindowsMetro/MainPage.xaml.cs
trunk/Tests/Tests.WindowsMetro/Package.appxmanifest
trunk/Tests/Tests.WindowsMetro/Properties/
trunk/Tests/Tests.WindowsMetro/Properties/AssemblyInfo.cs
trunk/Tests/Tests.WindowsMetro/TestContainer.xaml
trunk/Tests/Tests.WindowsMetro/TestContainer.xaml.cs
trunk/Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj
trunk/Tests/Tests.WindowsMetro/Tests.WindowsMetro_TemporaryKey.pfx
Removed Paths:
-------------
trunk/AgateLib/AgateGame.cs
trunk/AgateLib/AgateSetup.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/FormsModelParameters.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/PassiveModelParameters.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModelParameters.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/SerialModelParameters.cs
trunk/AgateLib.Platform.WinForms/Initializer.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/FileProviderList.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/FileSystemProvider.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/TgzFileProvider.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/ZipFileProvider.cs
trunk/AgateLib.Platform.WinForms/WinForms/
trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModelParameters.cs
trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModelParameters.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WPAssetFileProvider.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WPPlatformInfo.cs
trunk/AgateLib.Tests/Tests.WinForms/AgateTestAttribute.cs
trunk/AgateLib.Tests/Tests.WinForms/Assets/boxsprite.png
trunk/AgateLib.Tests/Tests.WinForms/Assets/wallpaper.png
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/App.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Performance/
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/RefCounters.cs
trunk/AgateLib.Tests/Tests.WinForms/Data/
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/BasicSprite.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/ClipRect.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/ColorTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Interpolation.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/ParticleTests/
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RotatingSpriteTester.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Tiling.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/Builtin.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/TextLayout.cs
trunk/AgateLib.Tests/Tests.WinForms/Fonts/
trunk/AgateLib.Tests/Tests.WinForms/IAgateTest.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/InputState/
trunk/AgateLib.Tests/Tests.WinForms/Service References/
trunk/AgateLib.Tests/Tests.WinForms/Shaders/CoordinateSystem.cs
trunk/AgateLib.Tests/UnitTests/Algorithms/AStarTest.cs
trunk/AgateLib.Tests/UnitTests/Core/
trunk/AgateLib.Tests/UnitTests/Fakes/
trunk/AgateLib.Tests/UnitTests/PlatformTests.cs
trunk/AgateLib.Tests/UnitTests/Serialization/Xle/Serializable.cs
Deleted: trunk/AgateLib/AgateGame.cs
===================================================================
--- trunk/AgateLib/AgateGame.cs 2014-08-28 04:36:57 UTC (rev 1485)
+++ trunk/AgateLib/AgateGame.cs 2014-08-30 23:55:55 UTC (rev 1486)
@@ -1,363 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using AgateLib.Geometry;
-using AgateLib.DisplayLib;
-
-namespace AgateLib
-{
- /// <summary>
- /// Application framework for a game. Using AgateGame can simplify the application
- /// source code and start up.
- /// </summary>
- /// <example>
- /// <code>
- /// using AgateLib;
- ///
- /// namespace MyApplication
- /// {
- /// class MyApp : AgateGame
- /// {
- /// public static void Main(string[] args)
- /// {
- /// new MyApp().Run(args);
- /// }
- ///
- /// protected override void Initialize()
- /// {
- /// // do any needed initialization, loading of surfaces, etc. here.
- /// }
- /// protected override void Update(double time_ms)
- /// {
- /// // update game logic here.
- /// }
- /// protected override void Render()
- /// {
- /// // render game here.
- /// }
- /// }
- /// }
- /// </code>
- /// </example>
- public class AgateGame
- {
- DisplayWindow mWindow;
- AppInitParameters mInitParams;
- FontSurface mFont;
- //Gui.GuiRoot mGui;
-
- double mTotalSplashTime = 0;
- bool mSplashFadeDone = false;
-
- #region --- Run Method ---
-
- /// <summary>
- /// Runs the application.
- /// </summary>
- /// <returns></returns>
- public int Run()
- {
- return Run(null);
- }
- /// <summary>
- /// Runs the application.
- /// </summary>
- /// <param name="args"></param>
- /// <returns></returns>
- public int Run(string[] args)
- {
- CreateDisplayWindow();
-
- mFont = new FontSurface("Arial", 14);
-
- if (InitParams.ShowSplashScreen)
- {
- DoSplash();
- }
-
- Initialize();
-
- while (MainWindow.IsClosed == false)
- {
- Update(Display.DeltaTime);
-
- if (MainWindow.IsClosed)
- break;
-
- // if (GuiRoot != null)
- // GuiRoot.DoUpdate();
-
-
- Display.RenderTarget = MainWindow.FrameBuffer;
- Display.BeginFrame();
-
- Render();
-
- // if (GuiRoot != null)
- // GuiRoot.Draw();
-
- Display.EndFrame();
- Core.KeepAlive();
- }
-
- return 0;
- }
-
- private AppInitParameters InitParams
- {
- get
- {
- if (mInitParams == null)
- {
- mInitParams = new AppInitParameters();
- AdjustAppInitParameters(ref mInitParams);
- }
- return mInitParams;
- }
- }
-
- #endregion
- #region --- Initialization ---
-
- /// <summary>
- /// Override Initialize() to do any needed initialization for your application,
- /// such as creating <see cref="AgateLib.DisplayLib.Surface">Surface</see> objects.
- /// </summary>
- protected virtual void Initialize()
- {
- }
-
- private void CreateDisplayWindow()
- {
- CreateWindowParams windp;
-
- if (FullScreen)
- {
- windp = CreateWindowParams.FullScreen(ApplicationTitle,
- WindowSize.Width, WindowSize.Height, 32, null);
-
- windp.IconFile = InitParams.IconFile;
- }
- else
- {
- windp = CreateWindowParams.Windowed(ApplicationTitle,
- WindowSize.Width, WindowSize.Height,
- InitParams.AllowResize, InitParams.IconFile, null);
- }
-
- mWindow = new DisplayWindow(windp);
- }
-
- #endregion
- #region --- Rendering and Updating ---
-
- /// <summary>
- /// Override this method to update your game logic.
- /// </summary>
- /// <param name="time_ms">The amount of time that has passed since the last
- /// update, in milliseconds.</param>
- protected virtual void Update(double time_ms)
- {
-
- }
-
- /// <summary>
- /// Override this method to render your game.
- /// Do not call Display.BeginFrame or Display.EndFrame.
- /// </summary>
- /// <remarks>Do not call Display.BeginFrame or Display.EndFrame or change
- /// render targets in this method.</remarks>
- protected virtual void Render()
- {
- RenderSplashScreen();
-
- if (mSplashFadeDone)
- {
- Surface powered = null;// InternalResources.Data.PoweredBy;
- Size size = Size.Empty;// powered.SurfaceSize;
-
- int bottom = MainWindow.Height - size.Height;
- int h = mFont.FontHeight;
-
- mFont.DisplayAlignment = OriginAlignment.BottomLeft;
- mFont.Color = Color.Black;
-
- mFont.DrawText(0, bottom - 2 * h, "Welcome to AgateLib.");
- mFont.DrawText(0, bottom - h, "Your application framework is ready.");
- mFont.DrawText(0, bottom, "Override the Render method in order to do your own drawing.");
- }
- }
-
- #endregion
- #region --- Splash Screen ---
-
- private void DoSplash()
- {
- while (UpdateSplashScreen(Display.DeltaTime) == true)
- {
- Display.BeginFrame();
-
- RenderSplashScreen();
-
- Display.EndFrame();
- Core.KeepAlive();
-
- if (MainWindow.IsClosed)
- return;
- }
- }
-
- /// <summary>
- /// Override this method to update the logic for a custom splash screen,
- /// if there are any animations.
- /// Return false to cancel the splash screen and move on.
- /// </summary>
- /// <param name="time_ms"></param>
- protected virtual bool UpdateSplashScreen(double time_ms)
- {
- mTotalSplashTime += time_ms / 1000.0;
-
- if (mTotalSplashTime > 3.0)
- return false;
- else
- return true;
- }
- /// <summary>
- /// Override this method to provide a custom splash screen. This method
- /// is called before the Initialize method is called.
- /// </summary>
- protected virtual void RenderSplashScreen()
- {
- Display.Clear(Color.White);
-
- Surface powered = null;//= InternalResources.Data.PoweredBy;
- Size size = Size.Empty;// powered.SurfaceSize;
-
- int left = (int)(mTotalSplashTime * size.Width - size.Width) + 1;
- Rectangle gradientRect = new Rectangle(left, MainWindow.Height - size.Height,
- size.Width, size.Height);
-
- if (left < 0)
- Display.PushClipRect(gradientRect);
- else if (left > size.Width)
- mSplashFadeDone = true;
-
- if (powered != null)
- {
- powered.DisplayAlignment = OriginAlignment.BottomLeft;
- powered.Draw(0, MainWindow.Height);
- }
-
- Gradient g = new Gradient(
- Color.FromArgb(0, Color.White),
- Color.White,
- Color.FromArgb(0, Color.White),
- Color.White);
-
- Display.FillRect(gradientRect, g);
- if (left < 0)
- {
- Display.PopClipRect();
- }
- }
-
- #endregion
-
- #region --- Virtual Properties ---
-
- /// <summary>
- /// Override this to set the title of the window which is created.
- /// </summary>
- protected virtual string ApplicationTitle
- {
- get { return "Aga...
[truncated message content] |
|
From: <ka...@us...> - 2014-08-31 00:41:39
|
Revision: 1487
http://sourceforge.net/p/agate/code/1487
Author: kanato
Date: 2014-08-31 00:41:35 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Clean up models for windows store apps.
Modified Paths:
--------------
trunk/AgateLib/ApplicationModels/AgateAppModel.cs
trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SerialModel.cs
trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs
Added Paths:
-----------
trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SerialModel.cs
trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSerialModel.cs
Modified: trunk/AgateLib/ApplicationModels/AgateAppModel.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -89,12 +89,13 @@
/// </summary>
public void Exit()
{
- Instance = null;
QuitModel = true;
SceneStack.Clear();
Dispose();
+
+ Instance = null;
}
/// <summary>
Modified: trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModel.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModel.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SceneModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -35,6 +35,8 @@
context.DeviceReset += context_DeviceReset;
Parameters.RenderTarget.BindContextToRenderTarget(context);
+
+ SDX_Display.PauseWhenNotRendering = false;
}
void context_DeviceReset(object sender, DeviceResetEventArgs e)
Modified: trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SerialModel.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SerialModel.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsMetro/ApplicationModels/SerialModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -10,86 +10,19 @@
namespace AgateLib.Platform.WindowsMetro.ApplicationModels
{
- public class SerialModel : EntryPointAppModelBase
+ public class SerialModel : WindowsStoreSerialModel
{
- SharpDXContext context;
-
- IAsyncAction gameThread;
- bool exit;
- bool threadRunning;
- int retval;
-
public SerialModel(WindowsStoreSerialModelParameters parameters)
: base(parameters)
{
}
- public new WindowsStoreSerialModelParameters Parameters { get { return (WindowsStoreSerialModelParameters)base.Parameters; } }
-
protected override void InitializeImpl()
{
WindowsInitializer.Initialize(Parameters.RenderTarget, Parameters.AssetLocations);
- context = SDX_Display.InitializerContext;
- context.Render += context_Render;
- context.DeviceReset += context_DeviceReset;
-
- Parameters.RenderTarget.BindContextToRenderTarget(context);
-
- SDX_Display.PauseWhenNotRendering = true;
+ InitWindowsStoreCommon();
}
- void context_DeviceReset(object sender, DeviceResetEventArgs e)
- {
- }
-
- void context_Render(object sender, EventArgs e)
- {
- SDX_Display.RenderingFrame = true;
-
- while (SDX_Display.RenderingFrame) ;
- }
-
- int ExecuteEntry(Func<int> entryPoint)
- {
- try
- {
- threadRunning = true;
-
- try
- {
- return entryPoint();
- }
- catch (ExitGameException)
- {
- return 0;
- }
- }
- finally
- {
- threadRunning = false;
- }
- }
-
- protected override int BeginModel(Func<int> entryPoint)
- {
- gameThread = Windows.System.Threading.ThreadPool.RunAsync(
- (workItem) => { retval = ExecuteEntry(entryPoint); });
-
- return 0;
- }
-
- public override void KeepAlive()
- {
- if (exit)
- throw new ExitGameException();
-
- base.KeepAlive();
- }
-
- protected override void window_Closing(object sender, ref bool cancel)
- {
- exit = true;
- }
}
}
Modified: trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj 2014-08-31 00:41:35 UTC (rev 1487)
@@ -98,6 +98,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationModels\SceneModel.cs" />
+ <Compile Include="ApplicationModels\SerialModel.cs" />
<Compile Include="Factories\WindowsPhoneFactory.cs" />
<Compile Include="Factories\WPPlatformFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Modified: trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModel.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModel.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SceneModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -35,6 +35,8 @@
context.DeviceReset += context_DeviceReset;
Parameters.RenderTarget.BindContextToRenderTarget(context);
+
+ SDX_Display.PauseWhenNotRendering = false;
}
void context_DeviceReset(object sender, DeviceResetEventArgs e)
Added: trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SerialModel.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SerialModel.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsPhone/ApplicationModels/SerialModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -0,0 +1,24 @@
+using AgateLib.Platform.WindowsStore.ApplicationModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Platform.WindowsPhone.ApplicationModels
+{
+ public class SerialModel : WindowsStoreSerialModel
+ {
+ public SerialModel(WindowsStoreSerialModelParameters parameters)
+ : base(parameters)
+ {
+ }
+
+ protected override void InitializeImpl()
+ {
+ WindowsPhoneInitializer.Initialize(Parameters.RenderTarget, Parameters.AssetLocations);
+
+ InitWindowsStoreCommon();
+ }
+ }
+}
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-08-31 00:41:35 UTC (rev 1487)
@@ -51,6 +51,7 @@
<None Include="Resources\fxc.bat" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="ApplicationModels\WindowsStoreSerialModel.cs" />
<Compile Include="ApplicationModels\WindowsStoreSerialModelParameters.cs" />
<Compile Include="DisplayImplementation\D3DDevice.cs" />
<Compile Include="DisplayImplementation\DrawBuffer.cs" />
Added: trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSerialModel.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSerialModel.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/ApplicationModels/WindowsStoreSerialModel.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -0,0 +1,141 @@
+using AgateLib.ApplicationModels;
+using AgateLib.Platform.WindowsStore.DisplayImplementation;
+using SharpDX.SimpleInitializer;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.Foundation;
+
+namespace AgateLib.Platform.WindowsStore.ApplicationModels
+{
+ public abstract class WindowsStoreSerialModel : EntryPointAppModelBase
+ {
+ SharpDXContext mContext;
+
+ IAsyncAction gameThread;
+ bool exit;
+ bool threadRunning;
+ int retval;
+
+ public WindowsStoreSerialModel(WindowsStoreSerialModelParameters parameters)
+ : base(parameters)
+ {
+ }
+
+ public new WindowsStoreSerialModelParameters Parameters { get { return (WindowsStoreSerialModelParameters)base.Parameters; } }
+
+ protected SharpDXContext Context
+ {
+ get { return mContext; }
+ set
+ {
+ DetachContextEvents();
+ mContext = value;
+ AttachContextEvents();
+ }
+ }
+
+ protected void InitWindowsStoreCommon()
+ {
+ Context = SDX_Display.InitializerContext;
+
+ Parameters.RenderTarget.BindContextToRenderTarget(Context);
+ SDX_Display.FrameCount = 0;
+
+ SDX_Display.PauseWhenNotRendering = true;
+
+ Parameters.RenderTarget.Disposed += RenderTarget_Disposed;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ KillThread();
+
+ base.Dispose(disposing);
+ }
+ void RenderTarget_Disposed(object sender, EventArgs e)
+ {
+ KillThread();
+ }
+
+ private void AttachContextEvents()
+ {
+ Context.Render += context_Render;
+ Context.DeviceReset += context_DeviceReset;
+ }
+
+ private void DetachContextEvents()
+ {
+ if (mContext != null)
+ {
+ Context.Render -= context_Render;
+ Context.DeviceReset -= context_DeviceReset;
+ }
+ }
+
+ void context_DeviceReset(object sender, DeviceResetEventArgs e)
+ {
+ }
+
+ void context_Render(object sender, EventArgs e)
+ {
+ SDX_Display.RenderingFrame = true;
+
+ while (threadRunning && SDX_Display.RenderingFrame && SDX_Display.WaitingForMainThread) ;
+ }
+
+ int ExecuteEntry(Func<int> entryPoint)
+ {
+ try
+ {
+ threadRunning = true;
+
+ try
+ {
+ return entryPoint();
+ }
+ catch (ExitGameException)
+ {
+ return 0;
+ }
+ }
+ finally
+ {
+ threadRunning = false;
+ }
+ }
+
+ protected override int BeginModel(Func<int> entryPoint)
+ {
+ gameThread = Windows.System.Threading.ThreadPool.RunAsync(
+ (workItem) => { retval = ExecuteEntry(entryPoint); });
+
+ return 0;
+ }
+
+ public override void KeepAlive()
+ {
+ if (exit)
+ throw new ExitGameException();
+
+ base.KeepAlive();
+ }
+
+ protected override void window_Closing(object sender, ref bool cancel)
+ {
+ KillThread();
+ }
+
+ private void KillThread()
+ {
+ exit = true;
+
+ while (threadRunning)
+ {
+ SDX_Display.RenderingFrame = true;
+ }
+ }
+ }
+}
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -88,10 +88,8 @@
{
if (SDX_Display.PauseWhenNotRendering)
{
- while (SDX_Display.RenderingFrame == false)
- {
-
- }
+ SDX_Display.WaitingForMainThread = true;
+ while (SDX_Display.RenderingFrame == false && SDX_Display.WaitingForMainThread) ;
}
mContext.D3DContext.OutputMerger.SetTargets(
@@ -102,6 +100,7 @@
public override void EndRender()
{
SDX_Display.RenderingFrame = false;
+ SDX_Display.WaitingForMainThread = false;
}
public override AgateLib.DisplayLib.DisplayWindow AttachedWindow
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -227,17 +227,26 @@
#region --- BeginFrame stuff and DeltaTime ---
+ public bool InFrame { get; private set; }
+
protected override void OnBeginFrame()
{
+ if (mRenderTarget is FrameBufferWindow)
+ FrameCount++;
+
mRenderTarget.BeginRender();
SetClipRect(new AgateLib.Geometry.Rectangle(new AgateLib.Geometry.Point(0, 0), mRenderTarget.Size));
mDevice.DeviceContext.OutputMerger.SetDepthStencilState(mDepthStencilState);
+
+ InFrame = true;
}
protected override void OnEndFrame()
{
mDevice.DrawBuffer.Flush();
mRenderTarget.EndRender();
+
+ InFrame = false;
}
#endregion
@@ -813,5 +822,9 @@
InitializeDeviceWrapper();
}
+
+ public static int FrameCount { get; set; }
+
+ public static bool WaitingForMainThread { get; set; }
}
}
\ No newline at end of file
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
===================================================================
(Binary files differ)
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
===================================================================
(Binary files differ)
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -15,8 +15,20 @@
public SwapChainBackgroundPanelAdapter(SwapChainBackgroundPanel renderTarget)
{
mRenderTarget = renderTarget;
+ renderTarget.Unloaded += renderTarget_Unloaded;
}
+ void renderTarget_Unloaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ {
+ OnDisposed();
+ }
+
+ private void OnDisposed()
+ {
+ if (Disposed != null)
+ Disposed(this, EventArgs.Empty);
+ }
+
public SwapChainBackgroundPanel RenderTarget { get { return mRenderTarget; } }
public DisplayLib.DisplayWindow Owner { get; set; }
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -24,6 +24,7 @@
AttachEvents();
}
+
public SwapChainPanel RenderTarget { get { return mRenderTarget; } }
public DisplayLib.DisplayWindow Owner { get; set; }
@@ -54,8 +55,21 @@
mRenderTarget.KeyDown += mRenderTarget_KeyDown;
mRenderTarget.KeyUp += mRenderTarget_KeyUp;
+
+ mRenderTarget.Unloaded += renderTarget_Unloaded;
}
+ void renderTarget_Unloaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ {
+ OnDisposed();
+ }
+
+ private void OnDisposed()
+ {
+ if (Disposed != null)
+ Disposed(this, EventArgs.Empty);
+ }
+
void mRenderTarget_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
{
}
Modified: trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs 2014-08-30 23:55:55 UTC (rev 1486)
+++ trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs 2014-08-31 00:41:35 UTC (rev 1487)
@@ -33,7 +33,7 @@
}
public TestInfo Info { get; set;}
- SceneModel model;
+ AgateAppModel model;
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
@@ -47,26 +47,45 @@
IAgateTest t = (IAgateTest)Activator.CreateInstance(Info.Class);
if (t is ISceneModelTest)
- {
RunTest((ISceneModelTest)t);
- }
+ else if (t is ISerialModelTest)
+ RunTest((ISerialModelTest)t);
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
AgateAppModel.Instance.Exit();
}
+ private void RunTest(ISerialModelTest t)
+ {
+ var parameters = new WindowsStoreSerialModelParameters(new SwapChainPanelAdapter(RenderTarget));
+
+ SetAssetPath(t, parameters.AssetLocations);
+
+ t.ModifyModelParameters(parameters);
+
+ var smodel = new SerialModel(parameters);
+ model = smodel;
+ smodel.Run(new Action(t.EntryPoint));
+ }
private void RunTest(ISceneModelTest t)
{
- var assemblyName = t.GetType().GetTypeInfo().Assembly.GetName().Name;
-
var parameters = new WindowsStoreSceneModelParameters(new SwapChainPanelAdapter(RenderTarget));
- parameters.AssetLocations.Path = "ms-appx:///" + assemblyName + "/Assets";
+ SetAssetPath(t, parameters.AssetLocations);
+
t.ModifyModelParameters(parameters);
- model = new SceneModel(parameters);
- model.Run(t.StartScene);
+ var smodel = new SceneModel(parameters);
+ model = smodel;
+ smodel.Run(t.StartScene);
}
+
+ private static void SetAssetPath(IAgateTest t, AssetLocations assets)
+ {
+ var assemblyName = t.GetType().GetTypeInfo().Assembly.GetName().Name;
+ assets.Path = "ms-appx:///" + assemblyName + "/Assets";
+ }
+
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-31 01:11:13
|
Revision: 1489
http://sourceforge.net/p/agate/code/1489
Author: kanato
Date: 2014-08-31 01:11:02 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Fix organization of and name of test projects.
Modified Paths:
--------------
trunk/AgateLib-Windows.sln
Added Paths:
-----------
trunk/AgateLib.Tests/Tests.WindowsMetro/
trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj
trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj
trunk/AgateLib.Tests/Tests.WindowsPhone/Tests.WindowsPhone.csproj
trunk/Tests/Tests.WindowsMetro/
Modified: trunk/AgateLib-Windows.sln
===================================================================
--- trunk/AgateLib-Windows.sln 2014-08-31 00:56:59 UTC (rev 1488)
+++ trunk/AgateLib-Windows.sln 2014-08-31 01:11:02 UTC (rev 1489)
@@ -38,9 +38,9 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.WinForms", "AgateLib.Tests\Tests.WinForms\AgateLib.Tests.WinForms.csproj", "{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.WindowsPhone", "AgateLib.Tests\Tests.WindowsPhone\Tests.WindowsPhone.csproj", "{1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.WindowsMetro", "AgateLib.Tests\Tests.WindowsMetro\AgateLib.Tests.WindowsMetro.csproj", "{25D68687-A724-46B3-9603-74478320807F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.WindowsMetro", "Tests\Tests.WindowsMetro\Tests.WindowsMetro.csproj", "{25D68687-A724-46B3-9603-74478320807F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.WindowsPhone", "AgateLib.Tests\Tests.WindowsPhone\AgateLib.Tests.WindowsPhone.csproj", "{1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -277,36 +277,6 @@
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x64.Build.0 = Release|x64
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.ActiveCfg = Release|x86
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.Build.0 = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.ActiveCfg = Debug|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.Build.0 = Debug|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.Deploy.0 = Debug|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.ActiveCfg = Debug|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.Build.0 = Debug|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.Deploy.0 = Debug|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.ActiveCfg = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.Build.0 = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.Deploy.0 = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.ActiveCfg = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.Build.0 = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.Deploy.0 = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x64.ActiveCfg = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.ActiveCfg = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.Build.0 = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.Deploy.0 = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.Build.0 = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.ActiveCfg = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.Build.0 = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.Deploy.0 = Release|ARM
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x64.ActiveCfg = Release|Any CPU
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.ActiveCfg = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.Build.0 = Release|x86
- {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.Deploy.0 = Release|x86
{25D68687-A724-46B3-9603-74478320807F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25D68687-A724-46B3-9603-74478320807F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25D68687-A724-46B3-9603-74478320807F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
@@ -343,6 +313,36 @@
{25D68687-A724-46B3-9603-74478320807F}.Release|x86.ActiveCfg = Release|x86
{25D68687-A724-46B3-9603-74478320807F}.Release|x86.Build.0 = Release|x86
{25D68687-A724-46B3-9603-74478320807F}.Release|x86.Deploy.0 = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.ActiveCfg = Debug|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.Build.0 = Debug|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|ARM.Deploy.0 = Debug|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.ActiveCfg = Debug|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.Build.0 = Debug|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Debug|x86.Deploy.0 = Debug|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.ActiveCfg = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.Build.0 = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|Any CPU.Deploy.0 = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.ActiveCfg = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.Build.0 = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|ARM.Deploy.0 = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x64.ActiveCfg = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.ActiveCfg = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.Build.0 = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Public|x86.Deploy.0 = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.ActiveCfg = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.Build.0 = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|ARM.Deploy.0 = Release|ARM
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x64.ActiveCfg = Release|Any CPU
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.ActiveCfg = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.Build.0 = Release|x86
+ {1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Copied: trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj (from rev 1488, trunk/Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj)
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj (rev 0)
+++ trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj 2014-08-31 01:11:02 UTC (rev 1489)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{25D68687-A724-46B3-9603-74478320807F}</ProjectGuid>
+ <OutputType>AppContainerExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>AgateLib.Testing.WindowsMetro</RootNamespace>
+ <AssemblyName>AgateLib.Tests.WindowsMetro</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <TargetPlatformVersion>8.1</TargetPlatformVersion>
+ <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <PackageCertificateKeyFile>Tests.WindowsMetro_TemporaryKey.pfx</PackageCertificateKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\ARM\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>bin\ARM\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+ <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
+ <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
+ <Name>AgateLib.Platform.Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Platform.WindowsMetro\AgateLib.Platform.WindowsMetro.csproj">
+ <Project>{c9b8f763-187d-4f2e-baee-827b7247c278}</Project>
+ <Name>AgateLib.Platform.WindowsMetro</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj">
+ <Project>{c7f9ae34-b781-4490-a9b2-5728f44f3523}</Project>
+ <Name>AgateLib.Platform.WindowsStoreCommon</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Tests\AgateLib.Tests.Portable\AgateLib.Tests.Portable.csproj">
+ <Project>{3aaa6832-55d7-47a9-af95-9393792ecb2c}</Project>
+ <Name>AgateLib.Tests.Portable</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
+ <Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
+ <Name>AgateLib</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TestContainer.xaml.cs">
+ <DependentUpon>TestContainer.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <AppxManifest Include="Package.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <None Include="Tests.WindowsMetro_TemporaryKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Assets\Logo.scale-100.png" />
+ <Content Include="Assets\SmallLogo.scale-100.png" />
+ <Content Include="Assets\SplashScreen.scale-100.png" />
+ <Content Include="Assets\StoreLogo.scale-100.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="TestContainer.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
+ <VisualStudioVersion>12.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Deleted: trunk/AgateLib.Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj
===================================================================
--- trunk/Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj 2014-08-31 00:56:59 UTC (rev 1488)
+++ trunk/AgateLib.Tests/Tests.WindowsMetro/Tests.WindowsMetro.csproj 2014-08-31 01:11:02 UTC (rev 1489)
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{25D68687-A724-46B3-9603-74478320807F}</ProjectGuid>
- <OutputType>AppContainerExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>AgateLib.Testing.WindowsMetro</RootNamespace>
- <AssemblyName>AgateLib.Tests.WindowsMetro</AssemblyName>
- <DefaultLanguage>en-US</DefaultLanguage>
- <TargetPlatformVersion>8.1</TargetPlatformVersion>
- <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <PackageCertificateKeyFile>Tests.WindowsMetro_TemporaryKey.pfx</PackageCertificateKeyFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\ARM\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <NoWarn>;2008</NoWarn>
- <DebugType>full</DebugType>
- <PlatformTarget>ARM</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
- <OutputPath>bin\ARM\Release\</OutputPath>
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <Optimize>true</Optimize>
- <NoWarn>;2008</NoWarn>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>ARM</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <NoWarn>;2008</NoWarn>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <Optimize>true</Optimize>
- <NoWarn>;2008</NoWarn>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x86\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <NoWarn>;2008</NoWarn>
- <DebugType>full</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
- <OutputPath>bin\x86\Release\</OutputPath>
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
- <Optimize>true</Optimize>
- <NoWarn>;2008</NoWarn>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <ErrorReport>prompt</ErrorReport>
- <Prefer32Bit>true</Prefer32Bit>
- </PropertyGroup>
- <ItemGroup>
- <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\AgateLib.Platform.WindowsMetro\AgateLib.Platform.WindowsMetro.csproj">
- <Project>{c9b8f763-187d-4f2e-baee-827b7247c278}</Project>
- <Name>AgateLib.Platform.WindowsMetro</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj">
- <Project>{c7f9ae34-b781-4490-a9b2-5728f44f3523}</Project>
- <Name>AgateLib.Platform.WindowsStoreCommon</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\AgateLib.Tests\AgateLib.Tests.Portable\AgateLib.Tests.Portable.csproj">
- <Project>{3aaa6832-55d7-47a9-af95-9393792ecb2c}</Project>
- <Name>AgateLib.Tests.Portable</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
- <Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
- <Name>AgateLib</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="App.xaml.cs">
- <DependentUpon>App.xaml</DependentUpon>
- </Compile>
- <Compile Include="MainPage.xaml.cs">
- <DependentUpon>MainPage.xaml</DependentUpon>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="TestContainer.xaml.cs">
- <DependentUpon>TestContainer.xaml</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <AppxManifest Include="Package.appxmanifest">
- <SubType>Designer</SubType>
- </AppxManifest>
- <None Include="Tests.WindowsMetro_TemporaryKey.pfx" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Assets\Logo.scale-100.png" />
- <Content Include="Assets\SmallLogo.scale-100.png" />
- <Content Include="Assets\SplashScreen.scale-100.png" />
- <Content Include="Assets\StoreLogo.scale-100.png" />
- </ItemGroup>
- <ItemGroup>
- <ApplicationDefinition Include="App.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </ApplicationDefinition>
- <Page Include="MainPage.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="TestContainer.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- </ItemGroup>
- <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
- <VisualStudioVersion>12.0</VisualStudioVersion>
- </PropertyGroup>
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
Copied: trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj (from rev 1488, trunk/AgateLib.Tests/Tests.WindowsPhone/Tests.WindowsPhone.csproj)
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj (rev 0)
+++ trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj 2014-08-31 01:11:02 UTC (rev 1489)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}</ProjectGuid>
+ <OutputType>AppContainerExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>AgateLib.Testing.WindowsPhone</RootNamespace>
+ <AssemblyName>AgateLib.Tests.WindowsPhone</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <TargetPlatformVersion>8.1</TargetPlatformVersion>
+ <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\ARM\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>bin\ARM\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+ <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
+ <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
+ <Name>AgateLib.Platform.Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Platform.WindowsPhone\AgateLib.Platform.WindowsPhone.csproj">
+ <Project>{9bef78db-b535-47d3-9c14-453d373807ec}</Project>
+ <Name>AgateLib.Platform.WindowsPhone</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj">
+ <Project>{c7f9ae34-b781-4490-a9b2-5728f44f3523}</Project>
+ <Name>AgateLib.Platform.WindowsStoreCommon</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
+ <Project>{9490b719-829e-43a7-a5fe-8001f8a8...
[truncated message content] |
|
From: <ka...@us...> - 2014-08-31 01:31:38
|
Revision: 1491
http://sourceforge.net/p/agate/code/1491
Author: kanato
Date: 2014-08-31 01:31:34 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Minor cleanup. Added FakeRenderTarget to available fakes.
Modified Paths:
--------------
trunk/AgateLib-Windows.sln
trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
trunk/AgateLib.Platform.WinForms/Controls/FormUtil.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFrameBuffer.cs
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
Added Paths:
-----------
trunk/.nuget/
trunk/.nuget/NuGet.Config
trunk/.nuget/NuGet.exe
trunk/.nuget/NuGet.targets
trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs
Removed Paths:
-------------
trunk/AgateLib.Platform.Common/PlatformImplementation/ActivatorConstructor.cs
Added: trunk/.nuget/NuGet.Config
===================================================================
--- trunk/.nuget/NuGet.Config (rev 0)
+++ trunk/.nuget/NuGet.Config 2014-08-31 01:31:34 UTC (rev 1491)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <solution>
+ <add key="disableSourceControlIntegration" value="true" />
+ </solution>
+</configuration>
\ No newline at end of file
Added: trunk/.nuget/NuGet.exe
===================================================================
(Binary files differ)
Index: trunk/.nuget/NuGet.exe
===================================================================
--- trunk/.nuget/NuGet.exe 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/.nuget/NuGet.exe 2014-08-31 01:31:34 UTC (rev 1491)
Property changes on: trunk/.nuget/NuGet.exe
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/.nuget/NuGet.targets
===================================================================
--- trunk/.nuget/NuGet.targets (rev 0)
+++ trunk/.nuget/NuGet.targets 2014-08-31 01:31:34 UTC (rev 1491)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
+
+ <!-- Enable the restore command to run before builds -->
+ <RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
+
+ <!-- Property that enables building a package from a project -->
+ <BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
+
+ <!-- Determines if package restore consent is required to restore packages -->
+ <RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
+
+ <!-- Download NuGet.exe if it does not already exist -->
+ <DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
+ </PropertyGroup>
+
+ <ItemGroup Condition=" '$(PackageSources)' == '' ">
+ <!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
+ <!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
+ <!--
+ <PackageSource Include="https://www.nuget.org/api/v2/" />
+ <PackageSource Include="https://my-nuget-source/nuget/" />
+ -->
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
+ <!-- Windows specific commands -->
+ <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
+ <!-- We need to launch nuget.exe with the mono command if we're not on windows -->
+ <NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
+ <PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
+ <PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <!-- NuGet command -->
+ <NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
+ <PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
+
+ <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
+ <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
+
+ <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
+
+ <RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
+ <NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
+
+ <PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
+ <PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
+
+ <!-- Commands -->
+ <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
+ <BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
+
+ <!-- We need to ensure packages are restored prior to assembly resolve -->
+ <BuildDependsOn Condition="$(RestorePackages) == 'true'">
+ RestorePackages;
+ $(BuildDependsOn);
+ </BuildDependsOn>
+
+ <!-- Make the build depend on restore packages -->
+ <BuildDependsOn Condition="$(BuildPackage) == 'true'">
+ $(BuildDependsOn);
+ BuildPackage;
+ </BuildDependsOn>
+ </PropertyGroup>
+
+ <Target Name="CheckPrerequisites">
+ <!-- Raise an error if we're unable to locate nuget.exe -->
+ <Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
+ <!--
+ Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
+ This effectively acts as a lock that makes sure that the download operation will only happen once and all
+ parallel builds will have to wait for it to complete.
+ -->
+ <MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
+ </Target>
+
+ <Target Name="_DownloadNuGet">
+ <DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
+ </Target>
+
+ <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(RestoreCommand)"
+ Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
+
+ <Exec Command="$(RestoreCommand)"
+ LogStandardErrorAsError="true"
+ Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
+ </Target>
+
+ <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(BuildCommand)"
+ Condition=" '$(OS)' != 'Windows_NT' " />
+
+ <Exec Command="$(BuildCommand)"
+ LogStandardErrorAsError="true"
+ Condition=" '$(OS)' == 'Windows_NT' " />
+ </Target>
+
+ <UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <OutputFilename ParameterType="System.String" Required="true" />
+ </ParameterGroup>
+ <Task>
+ <Reference Include="System.Core" />
+ <Using Namespace="System" />
+ <Using Namespace="System.IO" />
+ <Using Namespace="System.Net" />
+ <Using Namespace="Microsoft.Build.Framework" />
+ <Using Namespace="Microsoft.Build.Utilities" />
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ try {
+ OutputFilename = Path.GetFullPath(OutputFilename);
+
+ Log.LogMessage("Downloading latest version of NuGet.exe...");
+ WebClient webClient = new WebClient();
+ webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
+
+ return true;
+ }
+ catch (Exception ex) {
+ Log.LogErrorFromException(ex);
+ return false;
+ }
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
+</Project>
Modified: trunk/AgateLib-Windows.sln
===================================================================
--- trunk/AgateLib-Windows.sln 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib-Windows.sln 2014-08-31 01:31:34 UTC (rev 1491)
@@ -42,6 +42,13 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Tests.WindowsPhone", "AgateLib.Tests\Tests.WindowsPhone\AgateLib.Tests.WindowsPhone.csproj", "{1AAD3A4C-90CB-403E-93F9-7EC3919E80BB}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3C35058B-A7F6-42D7-8B2B-7C4B2E7A0F13}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Modified: trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
===================================================================
--- trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj 2014-08-31 01:31:34 UTC (rev 1491)
@@ -140,7 +140,9 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
<None Include="Resources\Basic2D_pixel.txt" />
</ItemGroup>
<ItemGroup>
Modified: trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
===================================================================
--- trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-08-31 01:31:34 UTC (rev 1491)
@@ -42,7 +42,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Compile Include="PlatformImplementation\ActivatorConstructor.cs" />
+ <Compile Include="PlatformImplementation\PlatformSerialization.cs" />
<Compile Include="PlatformImplementation\DiagnosticsStopwatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Deleted: trunk/AgateLib.Platform.Common/PlatformImplementation/ActivatorConstructor.cs
===================================================================
--- trunk/AgateLib.Platform.Common/PlatformImplementation/ActivatorConstructor.cs 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Platform.Common/PlatformImplementation/ActivatorConstructor.cs 2014-08-31 01:31:34 UTC (rev 1491)
@@ -1,16 +0,0 @@
-using AgateLib.Drivers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace AgateLib.Platform.Common.PlatformImplementation
-{
- public class PlatformSerialization : IPlatformSerialization
- {
- public object CreateInstance(Type t)
- {
- return Activator.CreateInstance(t, true);
- }
- }
-}
Copied: trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs (from rev 1490, trunk/AgateLib.Platform.Common/PlatformImplementation/ActivatorConstructor.cs)
===================================================================
--- trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs (rev 0)
+++ trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs 2014-08-31 01:31:34 UTC (rev 1491)
@@ -0,0 +1,16 @@
+using AgateLib.Drivers;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.Platform.Common.PlatformImplementation
+{
+ public class PlatformSerialization : IPlatformSerialization
+ {
+ public object CreateInstance(Type t)
+ {
+ return Activator.CreateInstance(t, true);
+ }
+ }
+}
Modified: trunk/AgateLib.Platform.WinForms/Controls/FormUtil.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Controls/FormUtil.cs 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Platform.WinForms/Controls/FormUtil.cs 2014-08-31 01:31:34 UTC (rev 1491)
@@ -113,7 +113,7 @@
{
AgateLib.Core.ErrorReporting.Report(ErrorLevel.Warning,
"Caught a MissingManifestResourceException when looking for the AgateLib Icon. " +
- "This indicates a problem with the way resources were embedded into AgateLib.Platform.WindowsForms.WinForms.dll when it was built.",
+ "This indicates a problem with the way resources were embedded into AgateLib.Platform.WinForms.dll when it was built.",
e);
return null;
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dpixel.fxo
===================================================================
(Binary files differ)
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/Resources/Basic2Dvert.fxo
===================================================================
(Binary files differ)
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 01:31:34 UTC (rev 1491)
@@ -60,6 +60,7 @@
<Compile Include="Fakes\FakeFrameBuffer.cs" />
<Compile Include="Fakes\FakePlatformFactory.cs" />
<Compile Include="Fakes\FakePlatformInfo.cs" />
+ <Compile Include="Fakes\FakeRenderTarget.cs" />
<Compile Include="FontTests\Builtin.cs" />
<Compile Include="FontTests\TextLayout.cs" />
<Compile Include="IAgateTest.cs" />
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFrameBuffer.cs
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFrameBuffer.cs 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeFrameBuffer.cs 2014-08-31 01:31:34 UTC (rev 1491)
@@ -8,7 +8,7 @@
namespace AgateLib.Testing.Fakes
{
- class FakeFrameBuffer : FrameBufferImpl
+ public class FakeFrameBuffer : FrameBufferImpl
{
public FakeFrameBuffer(FakeDisplayWindow owner)
: base(new NativeCoordinates())
Added: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs 2014-08-31 01:31:34 UTC (rev 1491)
@@ -0,0 +1,25 @@
+using AgateLib.DisplayLib;
+using AgateLib.Geometry;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Testing.Fakes
+{
+ public class FakeRenderTarget : IFrameBuffer
+ {
+ public FakeRenderTarget()
+ {
+ CoordinateSystem = new Rectangle(0, 0, 640, 400);
+ }
+
+ public int Height { get { return 400; } }
+ public int Width { get { return 640; } }
+ public Size Size { get { return new Size(Width, Height); } }
+ public Rectangle CoordinateSystem { get; set; }
+
+ ICoordinateSystemCreator IFrameBuffer.CoordinateSystem { get; set; }
+ }
+}
Modified: trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
===================================================================
--- trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-08-31 01:11:47 UTC (rev 1490)
+++ trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-08-31 01:31:34 UTC (rev 1491)
@@ -123,7 +123,7 @@
</ProjectReference>
<ProjectReference Include="..\..\AgateLib.Platform.WinForms\AgateLib.Platform.WinForms.csproj">
<Project>{4b12561e-d37b-48a1-b6db-218e94906c22}</Project>
- <Name>AgateLib.Platform.WindowsForms</Name>
+ <Name>AgateLib.Platform.WinForms</Name>
</ProjectReference>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
<Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-31 15:43:58
|
Revision: 1494
http://sourceforge.net/p/agate/code/1494
Author: kanato
Date: 2014-08-31 15:43:53 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Fix operation of sprites when surface delay loading is supported by adding LoadComplete event on surfaces.
Modified Paths:
--------------
trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs
trunk/AgateLib/DisplayLib/Surface.cs
trunk/AgateLib/Sprites/Sprite.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_Surface.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
Added Paths:
-----------
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/spike.png
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/Assets/spike.png
Modified: trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs
===================================================================
--- trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib/DisplayLib/ImplementationBase/SurfaceImpl.cs 2014-08-31 15:43:53 UTC (rev 1494)
@@ -237,6 +237,18 @@
#endregion
+ /// <summary>
+ /// Returns true if loading of the surface data is complete.
+ /// </summary>
public abstract bool IsLoaded { get; }
+ /// <summary>
+ /// Event which is raised when loading is completed. If loading is already complete,
+ /// the delegate gets executed immediately.
+ /// </summary>
+ /// <remarks>Delegates added to this event are executed exactly once, after which
+ /// they are removed. Event handlers may be executed on the thread that is loading
+ /// the surface, or they may be executed on the thread that adds them to the delegate.
+ /// </remarks>
+ public abstract event EventHandler LoadComplete;
};
}
Modified: trunk/AgateLib/DisplayLib/Surface.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Surface.cs 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib/DisplayLib/Surface.cs 2014-08-31 15:43:53 UTC (rev 1494)
@@ -842,6 +842,20 @@
{
get { return Impl.IsLoaded; }
}
+
+ /// <summary>
+ /// Event which is raised when loading is completed. If loading is already complete,
+ /// the delegate gets executed immediately.
+ /// </summary>
+ /// <remarks>Delegates added to this event are executed exactly once, after which
+ /// they are removed. Event handlers may be executed on the thread that is loading
+ /// the surface, or they may be executed on the thread that adds them to the delegate.
+ /// </remarks>
+ public event EventHandler LoadComplete
+ {
+ add { mImpl.LoadComplete += value; }
+ remove { mImpl.LoadComplete -= value; }
+ }
}
/// <summary>
Modified: trunk/AgateLib/Sprites/Sprite.cs
===================================================================
--- trunk/AgateLib/Sprites/Sprite.cs 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib/Sprites/Sprite.cs 2014-08-31 15:43:53 UTC (rev 1494)
@@ -365,39 +365,36 @@
if (ownSurface)
mOwnedSurfaces.Add(surface);
- while (surface.IsLoaded == false)
+ surface.LoadComplete += (sender, e) =>
{
- throw new NotImplementedException();
- }
+ do
+ {
+ SpriteFrame currentFrame = new SpriteFrame(surface);
+ Rectangle currentRect = new Rectangle(location, size);
+ bool skip = false;
- do
- {
- SpriteFrame currentFrame = new SpriteFrame(surface);
- Rectangle currentRect = new Rectangle(location, size);
- bool skip = false;
+ currentFrame.SourceRect = currentRect;
+ currentFrame.SpriteSize = SpriteSize;
- currentFrame.SourceRect = currentRect;
- currentFrame.SpriteSize = SpriteSize;
+ if (currentFrame.SourceRect.Right > surface.SurfaceWidth) skip = true;
+ if (currentFrame.SourceRect.Bottom > surface.SurfaceHeight) skip = true;
- if (currentFrame.SourceRect.Right > surface.SurfaceWidth) skip = true;
- if (currentFrame.SourceRect.Bottom > surface.SurfaceHeight) skip = true;
+ if (skipBlank && pixels.IsRegionBlank(currentFrame.SourceRect))
+ skip = true;
- if (skipBlank && pixels.IsRegionBlank(currentFrame.SourceRect))
- skip = true;
+ if (skip == false)
+ mFrames.Add(currentFrame);
- if (skip == false)
- mFrames.Add(currentFrame);
+ location.X += size.Width + extraSpace.X;
- location.X += size.Width + extraSpace.X;
+ if (location.X + size.Width > surface.SurfaceWidth)
+ {
+ location.X = 0;
+ location.Y += size.Height + extraSpace.Y;
+ }
- if (location.X + size.Width > surface.SurfaceWidth)
- {
- location.X = 0;
- location.Y += size.Height + extraSpace.Y;
- }
-
- } while (location.Y + size.Height <= surface.SurfaceHeight);
-
+ } while (location.Y + size.Height <= surface.SurfaceHeight);
+ };
}
#endregion
Modified: trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_Surface.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_Surface.cs 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_Surface.cs 2014-08-31 15:43:53 UTC (rev 1494)
@@ -221,7 +221,7 @@
float displayWidth, float displayHeight, TextureCoordinates texCoord, Gradient color,
OriginAlignment DisplayAlignment, float mRotationCos, float mRotationSin)
{
-
+
// order is
// 1 -- 2
// | |
@@ -345,7 +345,7 @@
Marshal.Copy(memPtr, data, dataIndex, pixelStride * rect.Width);
}
}
-
+
Marshal.FreeHGlobal(memory);
if (format == PixelFormat.RGBA8888)
@@ -390,6 +390,17 @@
// So return true because if the surface is constructed, it's been loaded.
get { return true; }
}
+ public override event EventHandler LoadComplete
+ {
+ add
+ {
+ // since loading is synchronously performed in the constructor, just
+ // execute any delegate that comes in immediately.
+ value(this, EventArgs.Empty);
+ }
+ remove { }
+ }
+
public int GLTextureID { get { return mTextureID; } }
private void Load()
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs 2014-08-31 15:43:53 UTC (rev 1494)
@@ -41,7 +41,6 @@
{
public class SDX_Surface : SurfaceImpl
{
- #region --- Private Variables ---
SDX_Display mDisplay;
D3DDevice mDevice { get { return mDisplay.D3D_Device; } }
@@ -62,7 +61,8 @@
PositionTextureColor[] mExtraVerts = new PositionTextureColor[4];
short[] mExtraIndices = new short[] { 0, 1, 2, 2, 1, 3 };
- #endregion
+ EventHandler mLoadCompleteStorage;
+ object mLoadCompletLockObject = new object();
public Texture2D D3dTexture
{
@@ -100,7 +100,8 @@
mDisplay = Display.Impl as SDX_Display;
}
- public SDX_Surface(string fileName) : this()
+ public SDX_Surface(string fileName)
+ : this()
{
mFileName = fileName;
@@ -225,8 +226,8 @@
ExifOrientationMode.IgnoreExifOrientation,
ColorManagementMode.DoNotColorManage);
byte[] pixelData = dataProvider.DetachPixelData();
-
- PixelBuffer pb = new PixelBuffer(PixelFormat.BGRA8888,
+
+ PixelBuffer pb = new PixelBuffer(PixelFormat.BGRA8888,
new Size((int)bitmap.PixelWidth, (int)bitmap.PixelHeight));
pb.SetData(pixelData, PixelFormat.BGRA8888);
@@ -271,9 +272,51 @@
}
InitializeValues();
- mIsLoaded = true;
+
+ OnLoadComplete();
}
+ private void OnLoadComplete()
+ {
+ Delegate[] handlers = null;
+
+ lock (mLoadCompletLockObject)
+ {
+ mIsLoaded = true;
+ if (mLoadCompleteStorage != null)
+ {
+ handlers =mLoadCompleteStorage.GetInvocationList();
+
+ foreach (EventHandler handler in handlers)
+ mLoadCompleteStorage -= handler;
+ }
+ }
+
+ if (handlers != null)
+ {
+ foreach (EventHandler handler in handlers)
+ handler(this, EventArgs.Empty);
+ }
+ }
+
+ public override event EventHandler LoadComplete
+ {
+ add
+ {
+ lock (mLoadCompletLockObject)
+ {
+ if (mIsLoaded)
+ {
+ value(this, EventArgs.Empty);
+ return;
+ }
+
+ mLoadCompleteStorage += value;
+ }
+ }
+ remove { }
+ }
+
#endregion
#region --- Events and event handlers ---
@@ -295,7 +338,7 @@
}
private void Draw(SurfaceState state, SurfaceDrawInstance inst)
{
- if (mTexture == null)
+ if (mTexture == null)
return;
if (SurfaceSize.IsEmpty)
{
@@ -337,7 +380,7 @@
rotationCenter.X, rotationCenter.Y,
state.DisplayAlignment, mRotationCos, mRotationSin);
- mDevice.DrawBuffer.CacheDrawIndexedTriangles(mVerts, mIndices,
+ mDevice.DrawBuffer.CacheDrawIndexedTriangles(mVerts, mIndices,
mTexture.Value, mTextureView, alphaBlend);
}
@@ -346,7 +389,7 @@
if (mTexture == null)
return;
- mTextureSize = new Size( mTexture.Value.Description.Width, mTexture.Value.Description.Height);
+ mTextureSize = new Size(mTexture.Value.Description.Width, mTexture.Value.Description.Height);
mSrcRect = new Rectangle(Point.Empty, mTextureSize);
}
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 15:43:53 UTC (rev 1494)
@@ -74,8 +74,11 @@
<ItemGroup />
<ItemGroup>
<Content Include="Assets\boxsprite.png">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Assets\spike.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Assets\tile1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -83,7 +86,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\wallpaper.png">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
Copied: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/spike.png (from rev 1489, trunk/AgateLib.Tests/Tests.WinForms/Assets/spike.png)
===================================================================
(Binary files differ)
Modified: trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj 2014-08-31 06:08:27 UTC (rev 1493)
+++ trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj 2014-08-31 15:43:53 UTC (rev 1494)
@@ -452,9 +452,6 @@
<None Include="Assets\smoke2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Assets\spike.png">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
<None Include="Assets\TestResourceFile.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
Deleted: trunk/AgateLib.Tests/Tests.WinForms/Assets/spike.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-31 16:00:23
|
Revision: 1495
http://sourceforge.net/p/agate/code/1495
Author: kanato
Date: 2014-08-31 16:00:15 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Added build tasks to several projects.
Modified Paths:
--------------
trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
trunk/AgateLib.Platform.WindowsMetro/packages.config
trunk/AgateLib.Platform.WindowsPhone/packages.config
trunk/AgateLib.Platform.WindowsStoreCommon/packages.config
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj
trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj
Added Paths:
-----------
trunk/AgateLib.Platform.Common/packages.config
trunk/AgateLib.Tests/AgateLib.Tests.Portable/packages.config
trunk/AgateLib.Tests/Tests.WindowsMetro/packages.config
trunk/AgateLib.Tests/Tests.WindowsPhone/packages.config
Modified: trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
===================================================================
--- trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-08-31 16:00:15 UTC (rev 1495)
@@ -15,6 +15,8 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -46,7 +48,17 @@
<Compile Include="PlatformImplementation\DiagnosticsStopwatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+ </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Added: trunk/AgateLib.Platform.Common/packages.config
===================================================================
--- trunk/AgateLib.Platform.Common/packages.config (rev 0)
+++ trunk/AgateLib.Platform.Common/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="portable-net45+win+wpa81+wp80" />
+</packages>
\ No newline at end of file
Modified: trunk/AgateLib.Platform.WindowsMetro/packages.config
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/packages.config 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Platform.WindowsMetro/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="win81" />
<package id="SharpDX" version="2.6.2" targetFramework="win81" />
<package id="SharpDX.Direct3D11" version="2.6.2" targetFramework="win81" />
<package id="SharpDX.DXGI" version="2.6.2" targetFramework="win81" />
Modified: trunk/AgateLib.Platform.WindowsPhone/packages.config
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/packages.config 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Platform.WindowsPhone/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="wpa81" />
<package id="SharpDX" version="2.6.2" targetFramework="wpa81" />
<package id="SharpDX.Direct3D11" version="2.6.2" targetFramework="wpa81" />
<package id="SharpDX.DXGI" version="2.6.2" targetFramework="wpa81" />
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/packages.config
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/packages.config 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="portable-win81+wpa81" />
<package id="SharpDX" version="2.6.2" targetFramework="portable-win81+wpa81" />
<package id="SharpDX.Direct3D11" version="2.6.2" targetFramework="portable-win81+wpa81" />
<package id="SharpDX.DXGI" version="2.6.2" targetFramework="portable-win81+wpa81" />
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 16:00:15 UTC (rev 1495)
@@ -15,6 +15,8 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -71,8 +73,10 @@
<Compile Include="TestInfo.cs" />
<Compile Include="TestCollection.cs" />
</ItemGroup>
- <ItemGroup />
<ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
<Content Include="Assets\boxsprite.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -90,6 +94,13 @@
</Content>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+ </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Added: trunk/AgateLib.Tests/AgateLib.Tests.Portable/packages.config
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/packages.config (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="portable-net45+win+wpa81+wp80" />
+</packages>
\ No newline at end of file
Modified: trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj 2014-08-31 16:00:15 UTC (rev 1495)
@@ -15,6 +15,8 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>Tests.WindowsMetro_TemporaryKey.pfx</PackageCertificateKeyFile>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -140,6 +142,7 @@
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
+ <None Include="packages.config" />
<None Include="Tests.WindowsMetro_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
@@ -166,6 +169,13 @@
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+ </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Added: trunk/AgateLib.Tests/Tests.WindowsMetro/packages.config
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsMetro/packages.config (rev 0)
+++ trunk/AgateLib.Tests/Tests.WindowsMetro/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="win81" />
+</packages>
\ No newline at end of file
Modified: trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj 2014-08-31 15:43:53 UTC (rev 1494)
+++ trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj 2014-08-31 16:00:15 UTC (rev 1495)
@@ -14,6 +14,8 @@
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -143,6 +145,9 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
@@ -150,6 +155,13 @@
<TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+ </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Added: trunk/AgateLib.Tests/Tests.WindowsPhone/packages.config
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsPhone/packages.config (rev 0)
+++ trunk/AgateLib.Tests/Tests.WindowsPhone/packages.config 2014-08-31 16:00:15 UTC (rev 1495)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MSBuildTasks" version="1.4.0.65" targetFramework="wpa81" />
+</packages>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-31 18:26:47
|
Revision: 1496
http://sourceforge.net/p/agate/code/1496
Author: kanato
Date: 2014-08-31 18:26:40 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Remove Silverlight 5 as a target.
Fix loading of font resources using old resource system.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/Algorithms/PathFinding/AStar.cs
trunk/AgateLib/Algorithms/PathFinding/AStarState.cs
trunk/AgateLib/Diagnostics/ConsoleSupport/AgateConsoleCommandProcessor.cs
trunk/AgateLib/Extensions/Collections/Generic/ListSorting.cs
trunk/AgateLib/Geometry/Color.cs
trunk/AgateLib/IO/IPath.cs
trunk/AgateLib/IO/IReadFileProvider.cs
trunk/AgateLib/IO/SubDirectoryProvider.cs
trunk/AgateLib/Resources/DC/AgateResourceCollection.cs
trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs
trunk/AgateLib/Serialization/Xle/XleSerializer.cs
trunk/AgateLib/Serialization/Xle/XleTypeSerializerCollection.cs
trunk/AgateLib/UserInterface/Css/Binders/Binding.cs
trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs
trunk/AgateLib/UserInterface/Css/Binders/ReflectionPropertyBinder.cs
trunk/AgateLib/UserInterface/Css/Parser/Lexer/Tokenizer.cs
trunk/AgateLib/UserInterface/Css/ReflectionExtensions.cs
trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs
trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WindowsMetro/MainPage.xaml
Added Paths:
-----------
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/TestResourceFile.xml
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/fonts/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/CoordinateSystem.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FontTests/FontAlignment.cs
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/CoordinateSystem.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/FontAlignment.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/AgateLib.csproj 2014-08-31 18:26:40 UTC (rev 1496)
@@ -2,7 +2,7 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
- <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9490B719-829E-43A7-A5FE-8001F8A81759}</ProjectGuid>
@@ -13,8 +13,8 @@
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <TargetFrameworkProfile>Profile344</TargetFrameworkProfile>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
Modified: trunk/AgateLib/Algorithms/PathFinding/AStar.cs
===================================================================
--- trunk/AgateLib/Algorithms/PathFinding/AStar.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Algorithms/PathFinding/AStar.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -63,14 +63,14 @@
}
- public void QueueFindPath(AStarState<T> task)
+ public async void QueueFindPath(AStarState<T> task)
{
System.Diagnostics.Debug.Assert(task.Tag != null);
task.SearchingPath = true;
mActiveTasks++;
- ThreadPool.QueueUserWorkItem(FindPathThreadPoolCallback, task);
+ await FindPathThreadPoolCallback(task);
}
/// <summary>
/// Finds a path on the current thread and returns.
@@ -83,7 +83,7 @@
{
task.SearchingPath = true;
- FindPath(task);
+ FindPath(task).RunSynchronously();
}
finally
{
@@ -91,15 +91,11 @@
}
}
- void FindPathThreadPoolCallback(object _task)
+ async Task FindPathThreadPoolCallback(AStarState<T> task)
{
- AStarState<T> task = null;
-
try
{
- task = (AStarState<T>)_task;
-
- FindPath(task);
+ await FindPath(task);
task.Complete = true;
task.OnCompleted();
@@ -111,25 +107,25 @@
}
}
- public void FindPath(AStarState<T> task)
+ public async Task FindPath(AStarState<T> state)
{
- var openNodes = task.openNodes;
- var closedNodes = task.closedNodes;
+ var openNodes = state.openNodes;
+ var closedNodes = state.closedNodes;
openNodes.Clear();
closedNodes.Clear();
- task.Path.Clear();
- task.AbortOperation = false;
+ state.Path.Clear();
+ state.AbortOperation = false;
var node = new AStarNode<T>
{
- Location = task.Start,
+ Location = state.Start,
Parent = null,
- Heuristic = mMap.CalculateHeuristic(task.Start, task.EndPoints),
+ Heuristic = mMap.CalculateHeuristic(state.Start, state.EndPoints),
PaidCost = 0
};
- task.openNodes.Add(node);
+ state.openNodes.Add(node);
bool found = false;
int steps = 0;
@@ -144,7 +140,7 @@
openNodes.RemoveAt(0);
closedNodes.Add(node);
- if (task.EndPoints.Contains(node.Location))
+ if (state.EndPoints.Contains(node.Location))
{
found = true;
break;
@@ -154,11 +150,11 @@
if (steps > maxSteps)
break;
- foreach (T test in mMap.GetAvailableSteps(task, node.Location))
+ foreach (T test in mMap.GetAvailableSteps(state, node.Location))
{
if (mAbort)
return;
- if (task.AbortOperation)
+ if (state.AbortOperation)
return;
if (LocationIn(closedNodes, test))
@@ -187,7 +183,7 @@
Location = test,
Parent = node,
PaidCost = node.PaidCost + deltaCost,
- Heuristic = mMap.CalculateHeuristic(test, task.EndPoints)
+ Heuristic = mMap.CalculateHeuristic(test, state.EndPoints)
};
if (newtarget.Heuristic < 0)
@@ -212,11 +208,11 @@
if (!found)
{
- task.FoundPath = false;
+ state.FoundPath = false;
return;
}
- task.Path.Add(node.Location);
+ state.Path.Add(node.Location);
while (node.Parent != null && node.Parent != node)
{
@@ -224,10 +220,10 @@
return;
node = node.Parent;
- task.Path.Add(node.Location);
+ state.Path.Add(node.Location);
}
- task.FoundPath = true;
+ state.FoundPath = true;
}
int FindPointInOpenNodes(List<AStarNode<T>> openNodes, T location)
Modified: trunk/AgateLib/Algorithms/PathFinding/AStarState.cs
===================================================================
--- trunk/AgateLib/Algorithms/PathFinding/AStarState.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Algorithms/PathFinding/AStarState.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -21,6 +21,7 @@
using System.Linq;
using System.Text;
using AgateLib.Geometry;
+using System.Threading.Tasks;
namespace AgateLib.Algorithms.PathFinding
{
Modified: trunk/AgateLib/Diagnostics/ConsoleSupport/AgateConsoleCommandProcessor.cs
===================================================================
--- trunk/AgateLib/Diagnostics/ConsoleSupport/AgateConsoleCommandProcessor.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Diagnostics/ConsoleSupport/AgateConsoleCommandProcessor.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@@ -50,7 +51,8 @@
private void ExecuteDelegate(Delegate p, string[] tokens)
{
- var parameters = p.Method.GetParameters();
+ var method = p.GetMethodInfo();
+ var parameters = method.GetParameters();
object[] args = new object[parameters.Length];
bool notEnoughArgs = false;
bool badArgs = false;
@@ -96,9 +98,9 @@
if (badArgs || notEnoughArgs)
return;
- object retval = p.Method.Invoke(p.Target, args);
+ object retval = method.Invoke(p.Target, args);
- if (p.Method.ReturnType != typeof(void) && retval != null)
+ if (method.ReturnType != typeof(void) && retval != null)
{
WriteLine(retval.ToString());
}
@@ -126,11 +128,11 @@
else
{
Delegate d = mCommands[command];
-
+ var method = d.GetMethodInfo();
Write("Usage: ");
Write(command + " ");
- var parameters = d.Method.GetParameters();
+ var parameters = method.GetParameters();
for (int i = 0; i < parameters.Length; i++)
{
if (parameters[i].IsOptional)
@@ -152,7 +154,7 @@
}
if (string.IsNullOrEmpty(description))
{
- var descripAttrib = (DescriptionAttribute)d.Method.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault();
+ var descripAttrib = (DescriptionAttribute)method.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault();
if (descripAttrib != null)
description = descripAttrib.Description;
Modified: trunk/AgateLib/Extensions/Collections/Generic/ListSorting.cs
===================================================================
--- trunk/AgateLib/Extensions/Collections/Generic/ListSorting.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Extensions/Collections/Generic/ListSorting.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
namespace AgateLib.Extensions.Collections.Generic
@@ -42,11 +43,11 @@
Comparison<T> comp = null;
- if (typeof(IComparable<T>).IsAssignableFrom(typeof(T)))
+ if (typeof(T).GetTypeInfo().ImplementedInterfaces.Contains(typeof(IComparable<T>)))
{
comp = (x, y) => ((IComparable<T>)x).CompareTo(y);
}
- else if (typeof(IComparable).IsAssignableFrom(typeof(T)))
+ else if (typeof(T).GetTypeInfo().ImplementedInterfaces.Contains(typeof(IComparable)))
{
comp = (x, y) => ((IComparable)x).CompareTo(y);
}
Modified: trunk/AgateLib/Geometry/Color.cs
===================================================================
--- trunk/AgateLib/Geometry/Color.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Geometry/Color.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -18,6 +18,8 @@
//
using System;
using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
using System.Runtime.InteropServices;
namespace AgateLib.Geometry
@@ -600,11 +602,11 @@
static System.Reflection.PropertyInfo NamedColorStaticProperty(string name)
{
- var retval = typeof(Color).GetProperty(name,
- System.Reflection.BindingFlags.Static |
- System.Reflection.BindingFlags.Public |
- System.Reflection.BindingFlags.IgnoreCase);
-
+ var retval = typeof(Color).GetTypeInfo().DeclaredProperties.First(
+ x => x.PropertyType == typeof(Color) &&
+ x.GetMethod.IsStatic && x.GetMethod.IsPublic &&
+ x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
+
if (retval == null)
return null;
Modified: trunk/AgateLib/IO/IPath.cs
===================================================================
--- trunk/AgateLib/IO/IPath.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/IO/IPath.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -29,8 +29,6 @@
string GetFileNameWithoutExtension(string filename);
- string GetDirectoryName(string filename);
-
string GetFileName(string p);
string GetExtension(string filename);
Modified: trunk/AgateLib/IO/IReadFileProvider.cs
===================================================================
--- trunk/AgateLib/IO/IReadFileProvider.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/IO/IReadFileProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
+using System.Threading.Tasks;
namespace AgateLib
{
@@ -34,7 +35,7 @@
/// </summary>
/// <param name="filename">The path and filename of the file to read from.</param>
/// <returns></returns>
- Stream OpenRead(string filename);
+ Task<Stream> OpenRead(string filename);
/// <summary>
/// Checks to if the specified file exists in the file provider.
/// </summary>
Modified: trunk/AgateLib/IO/SubDirectoryProvider.cs
===================================================================
--- trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Threading.Tasks;
namespace AgateLib.IO
{
@@ -42,9 +43,9 @@
{
return parent.ToString() + subdir;
}
- public System.IO.Stream OpenRead(string filename)
+ public async Task<System.IO.Stream> OpenRead(string filename)
{
- return parent.OpenRead(subdir + filename);
+ return await parent.OpenRead(subdir + filename);
}
public bool FileExists(string filename)
Modified: trunk/AgateLib/Resources/DC/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/DC/AgateResourceCollection.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Resources/DC/AgateResourceCollection.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -26,6 +26,7 @@
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
+using System.Threading.Tasks;
namespace AgateLib.Resources.DC
{
@@ -39,16 +40,21 @@
FileProvider = AgateLib.IO.FileProvider.ResourceAssets;
}
- public AgateResourceCollection(string filename, IReadFileProvider fileProvider = null)
- : this()
+ public async Task<AgateResourceCollection> FromFile(string filename, IReadFileProvider fileProvider = null)
{
+ var retval = new AgateResourceCollection();
+
if (fileProvider == null)
fileProvider = AgateLib.IO.FileProvider.ResourceAssets;
- using (var stream = fileProvider.OpenRead(filename))
+ retval.FileProvider = FileProvider;
+
+ using (var stream = await retval.FileProvider.OpenRead(filename))
{
- LoadFrom(stream);
+ retval.LoadFrom(stream);
}
+
+ return retval;
}
public AgateResourceCollection(Stream stream)
{
Modified: trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -27,6 +27,7 @@
using AgateLib.DisplayLib.ImplementationBase;
using AgateLib.Utility;
using AgateLib.IO;
+using System.Threading.Tasks;
namespace AgateLib.Resources.Legacy
{
@@ -129,14 +130,14 @@
mSurfaceAccessor = new SurfaceResourceList(this);
//mGuiThemeAccessor = new GuiThemeResourceList(this);
- RootDirectory = FileSystem.Path.GetDirectoryName(filename);
+ RootDirectory = System.IO.Path.GetDirectoryName(filename);
- Load(filename);
+ Task.WaitAll(Load(filename));
}
- private void Load(string filename)
+ private async Task Load(string filename)
{
- using (Stream s = FileProvider.OpenRead(filename))
+ using (Stream s = await FileProvider.OpenRead(filename))
{
AgateResourceLoader.LoadResources(this, s);
}
Modified: trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs
===================================================================
--- trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -135,7 +135,7 @@
/// <param name="asAttribute">Pass true to write the field as an attribute in the parent element.</param>
public void WriteEnum<T>(string name, T value, bool asAttribute = false) where T : struct
{
- if (typeof(T).IsEnum == false)
+ if (typeof(T).GetTypeInfo().IsEnum == false)
throw new XleSerializationException("Type passed is not an enum.");
WriteImpl(name, value.ToString(), asAttribute);
@@ -219,7 +219,7 @@
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="asAttribute"></param>
- public void Write<T>(string name, T? value, bool asAttribute = false) where T : struct, IConvertible
+ public void Write<T>(string name, T? value, bool asAttribute = false) where T : struct
{
if (asAttribute)
{
@@ -475,7 +475,6 @@
/// <param name="value">The dictionary to write.</param>
[CLSCompliant(false)]
public void Write<Tkey, Tvalue>(string name, Dictionary<Tkey, Tvalue> value)
- where Tkey : IConvertible
where Tvalue : IXleSerializable
{
Type keyType = typeof(Tkey);
@@ -527,7 +526,6 @@
/// <param name="value">The dictionary to write.</param>
[CLSCompliant(false)]
public void Write<Tkey>(string name, Dictionary<Tkey, int> value)
- where Tkey : IConvertible
{
Type keyType = typeof(Tkey);
@@ -562,9 +560,8 @@
/// <param name="value">The dictionary to write.</param>
[CLSCompliant(false)]
public void Write<Tkey>(string name, Dictionary<Tkey, string> value)
- where Tkey : IConvertible
{
- Type[] args = value.GetType().GetGenericArguments();
+ Type[] args = value.GetType().GetTypeInfo().GenericTypeArguments;
Type keyType = args[0];
XElement element = CreateElement(name);
@@ -994,7 +991,7 @@
/// <param name="name">The name of the XML element used.</param>
public T ReadEnum<T>(string name) where T : struct
{
- if (typeof(T).IsEnum == false)
+ if (typeof(T).GetTypeInfo().IsEnum == false)
throw new XleSerializationException("Type passed is not an enum.");
return (T)Enum.Parse(typeof(T), ReadStringImpl(name, false, string.Empty), true);
@@ -1007,7 +1004,7 @@
/// <param name="defaultValue">Value returned if the key is not present in the XML data.</param>
public T ReadEnum<T>(string name, T defaultValue) where T : struct
{
- if (typeof(T).IsEnum == false)
+ if (typeof(T).GetTypeInfo().IsEnum == false)
throw new XleSerializationException("Type passed is not an enum.");
return (T)Enum.Parse(typeof(T), ReadStringImpl(name, true, defaultValue.ToString()), true);
@@ -1207,7 +1204,7 @@
/// <returns></returns>
public T[] ReadArray<T>(string name)
{
- if (typeof(T).IsPrimitive)
+ if (typeof(T).GetTypeInfo().IsPrimitive)
{
switch (GetEncoding(name))
{
@@ -1330,7 +1327,6 @@
/// <returns></returns>
[CLSCompliant(false)]
public Dictionary<TKey, TValue> ReadDictionary<TKey, TValue>(string name)
- where TKey : IConvertible
where TValue : IXleSerializable
{
XElement element = CurrentNode.Element(name);
@@ -1380,7 +1376,6 @@
[CLSCompliant(false)]
[Obsolete("Use ReadDictionaryString instead.")]
public Dictionary<Tkey, string> ReadDictionary<Tkey>(string name)
- where Tkey : IConvertible
{
return ReadDictionaryString<Tkey>(name);
}
@@ -1394,7 +1389,6 @@
/// <returns></returns>
[CLSCompliant(false)]
public Dictionary<Tkey, string> ReadDictionaryString<Tkey>(string name)
- where Tkey : IConvertible
{
XElement element = CurrentNode.Element(name);
@@ -1606,7 +1600,7 @@
}
}
- if (typeof(IXleSerializable).IsAssignableFrom(type))
+ if (typeof(IXleSerializable).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
{
IXleSerializable obj;
@@ -1638,7 +1632,7 @@
{
Type type = item.GetType();
- foreach (var prop in type.GetProperties())
+ foreach (var prop in type.GetTypeInfo().DeclaredProperties)
{
prop_WriteValue(prop.Name, prop.GetValue(item, null));
}
@@ -1648,7 +1642,7 @@
{
Type type = item.GetType();
- foreach (var prop in type.GetProperties())
+ foreach (var prop in type.GetTypeInfo().DeclaredProperties)
{
if (ContainsKey(prop.Name) == false && allowDefaults == true)
continue;
Modified: trunk/AgateLib/Serialization/Xle/XleSerializer.cs
===================================================================
--- trunk/AgateLib/Serialization/Xle/XleSerializer.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Serialization/Xle/XleSerializer.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -66,8 +66,8 @@
var typeBinder = new TypeBinder();
- typeBinder.AddAssembly(objectType.Assembly);
- typeBinder.AddAssembly(Assembly.GetExecutingAssembly());
+ typeBinder.AddAssembly(objectType.GetTypeInfo().Assembly);
+ typeBinder.AddAssembly(typeof(XleSerializer).GetTypeInfo().Assembly);
if (Core.Factory != null)
{
@@ -87,7 +87,7 @@
/// <param name="objectGraph">The object to serialize.</param>
public void Serialize(Stream outStream, IXleSerializable objectGraph)
{
- if (objectType.IsAssignableFrom(objectGraph.GetType()) == false)
+ if (objectType.GetTypeInfo().IsAssignableFrom(objectGraph.GetType().GetTypeInfo()) == false)
throw new ArgumentException("Object is not of type " + objectType.Name);
XleSerializationInfo info = new XleSerializationInfo(Binder, TypeSerializers);
@@ -104,7 +104,7 @@
/// <param name="objectGraph">The object to serialize.</param>
public void Serialize(Stream outStream, object objectGraph)
{
- if (objectType.IsAssignableFrom(objectGraph.GetType()) == false)
+ if (objectType.GetTypeInfo().IsAssignableFrom(objectGraph.GetType().GetTypeInfo()) == false)
throw new ArgumentException("Object is not of type " + objectType.Name);
XleSerializationInfo info = new XleSerializationInfo(Binder, TypeSerializers);
Modified: trunk/AgateLib/Serialization/Xle/XleTypeSerializerCollection.cs
===================================================================
--- trunk/AgateLib/Serialization/Xle/XleTypeSerializerCollection.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/Serialization/Xle/XleTypeSerializerCollection.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@@ -85,7 +86,7 @@
foreach (var supertype in mInherited.Keys)
{
- if (supertype.IsAssignableFrom(type))
+ if (supertype.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
return mInherited[supertype];
}
Modified: trunk/AgateLib/UserInterface/Css/Binders/Binding.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Binders/Binding.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/UserInterface/Css/Binders/Binding.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -43,7 +43,7 @@
var property = FinalProperty;
- if (typeof(ICssPropertyFromText).IsAssignableFrom(property.PropertyType))
+ if (property.PropertyType.GetTypeInfo().ImplementedInterfaces.Contains(typeof(ICssPropertyFromText)))
{
convertedValue = value;
}
@@ -66,7 +66,7 @@
var property = chain[chain.Count - 1];
- if (typeof(ICssPropertyFromText).IsAssignableFrom(property.PropertyType))
+ if (property.PropertyType.GetTypeInfo().ImplementedInterfaces.Contains(typeof(ICssPropertyFromText)))
{
var rfs = (ICssPropertyFromText)property.GetValue(obj, null);
rfs.SetValueFromText(value);
Modified: trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -21,6 +21,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@@ -36,7 +37,7 @@
return ParseColor(value);
if (targetType == typeof(CssDistance))
return CssDistance.FromString(value);
- if (targetType.IsEnum)
+ if (targetType.GetTypeInfo().IsEnum)
return Enum.Parse(targetType, value.Replace("-", "_"), true);
throw new NotImplementedException();
Modified: trunk/AgateLib/UserInterface/Css/Binders/ReflectionPropertyBinder.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Binders/ReflectionPropertyBinder.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/UserInterface/Css/Binders/ReflectionPropertyBinder.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -30,14 +30,14 @@
public class ReflectionPropertyBinder
{
Type theType;
- PropertyInfo[] properties;
+ IEnumerable<PropertyInfo> properties;
private CssBindingMapper mMap;
public ReflectionPropertyBinder(Type type, CssBindingMapper map)
{
mMap = map;
theType = type;
- properties = theType.GetProperties();
+ properties = theType.GetTypeInfo().DeclaredProperties;
}
public PropertyChain GetCssPropertyChain(Type type, string name)
Modified: trunk/AgateLib/UserInterface/Css/Parser/Lexer/Tokenizer.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Parser/Lexer/Tokenizer.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/UserInterface/Css/Parser/Lexer/Tokenizer.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -34,7 +35,7 @@
public Tokenizer()
{
- if (typeof(T).IsEnum)
+ if (typeof(T).GetTypeInfo().IsEnum)
tokenTypeConverter = new EnumParser<T>();
}
public Tokenizer(ITokenTypeConverter<T> converter)
Modified: trunk/AgateLib/UserInterface/Css/ReflectionExtensions.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/ReflectionExtensions.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib/UserInterface/Css/ReflectionExtensions.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -37,9 +37,9 @@
/// <param name="member"></param>
/// <param name="inherit"></param>
/// <returns></returns>
- public static T GetCustomAttribute<T>(this MemberInfo member, bool inherit)
+ public static T GetCustomAttribute<T>(this MemberInfo member, bool inherit) where T:class
{
- return (T)member.GetCustomAttributes(typeof(T), inherit).FirstOrDefault();
+ return member.GetCustomAttributes(typeof(T), inherit).FirstOrDefault() as T;
}
}
}
Modified: trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -22,6 +22,7 @@
using System.Linq;
using System.Text;
using AgateLib.Serialization.Xle;
+using System.Threading.Tasks;
namespace AgateLib.Data
{
@@ -56,7 +57,7 @@
/// <returns></returns>
public static AgateDatabase FromFile(string filename)
{
- AgateDatabase db = ReadDatabase(new AgateLib.Platform.WinForms.IO.ZipFileProvider(filename));
+ AgateDatabase db = ReadDatabase(new AgateLib.Platform.WinForms.IO.ZipFileProvider(filename)).Result;
db.mTables.OwnFileProvider = true;
return db;
@@ -68,7 +69,7 @@
/// <returns></returns>
public static AgateDatabase FromProvider(IReadFileProvider provider)
{
- return ReadDatabase(provider);
+ return ReadDatabase(provider).Result;
}
/// <summary>
@@ -79,11 +80,11 @@
((IDisposable)mTables).Dispose();
}
- private static AgateDatabase ReadDatabase(IReadFileProvider provider)
+ private static async Task<AgateDatabase> ReadDatabase(IReadFileProvider provider)
{
XleSerializer ser = new XleSerializer(typeof(AgateDatabase));
- using (Stream x = provider.OpenRead("catalog.txt"))
+ using (Stream x = await provider.OpenRead("catalog.txt"))
{
AgateDatabase retval = (AgateDatabase)ser.Deserialize(x);
Modified: trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -109,7 +109,7 @@
{
string filename = string.Format("data/{0}.txt", name);
- using (Stream r = FileProvider.OpenRead(filename))
+ using (Stream r = FileProvider.OpenRead(filename).Result)
{
AgateTable tbl = AgateTable.FromStream(r);
Modified: trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-08-31 16:00:15 UTC (rev 1495)
+++ trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-08-31 18:26:40 UTC (rev 1496)
@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.Text;
using System.IO;
+using System.Threading.Tasks;
namespace AgateLib.Platform.WinForms.IO
{
@@ -55,7 +56,7 @@
/// </summary>
/// <param name="filename">The filename to search for.</param>
/// <...
[truncated message content] |
|
From: <ka...@us...> - 2014-08-31 18:55:22
|
Revision: 1497
http://sourceforge.net/p/agate/code/1497
Author: kanato
Date: 2014-08-31 18:55:13 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Rename OpenRead to OpenReadAsync.
Fix asset locations in winforms initialization.
Modified Paths:
--------------
trunk/AgateLib/IO/IReadFileProvider.cs
trunk/AgateLib/IO/SubDirectoryProvider.cs
trunk/AgateLib/Resources/DC/AgateResourceCollection.cs
trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs
trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/PlatformFactory.cs
trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
trunk/AgateLib.Platform.WinForms/WinFormsInitializer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/CoordinateSystem.cs
Modified: trunk/AgateLib/IO/IReadFileProvider.cs
===================================================================
--- trunk/AgateLib/IO/IReadFileProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib/IO/IReadFileProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -35,7 +35,7 @@
/// </summary>
/// <param name="filename">The path and filename of the file to read from.</param>
/// <returns></returns>
- Task<Stream> OpenRead(string filename);
+ Task<Stream> OpenReadAsync(string filename);
/// <summary>
/// Checks to if the specified file exists in the file provider.
/// </summary>
Modified: trunk/AgateLib/IO/SubDirectoryProvider.cs
===================================================================
--- trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -43,9 +43,9 @@
{
return parent.ToString() + subdir;
}
- public async Task<System.IO.Stream> OpenRead(string filename)
+ public async Task<System.IO.Stream> OpenReadAsync(string filename)
{
- return await parent.OpenRead(subdir + filename);
+ return await parent.OpenReadAsync(subdir + filename);
}
public bool FileExists(string filename)
Modified: trunk/AgateLib/Resources/DC/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/DC/AgateResourceCollection.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib/Resources/DC/AgateResourceCollection.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -49,7 +49,7 @@
retval.FileProvider = FileProvider;
- using (var stream = await retval.FileProvider.OpenRead(filename))
+ using (var stream = await retval.FileProvider.OpenReadAsync(filename))
{
retval.LoadFrom(stream);
}
Modified: trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -117,7 +117,6 @@
public AgateResourceCollection()
{
mSurfaceAccessor = new SurfaceResourceList(this);
- //mGuiThemeAccessor = new GuiThemeResourceList(this);
this.mStore.Add(mStringTableKey, new StringTable());
}
@@ -128,7 +127,6 @@
public AgateResourceCollection(string filename)
{
mSurfaceAccessor = new SurfaceResourceList(this);
- //mGuiThemeAccessor = new GuiThemeResourceList(this);
RootDirectory = System.IO.Path.GetDirectoryName(filename);
@@ -137,7 +135,7 @@
private async Task Load(string filename)
{
- using (Stream s = await FileProvider.OpenRead(filename))
+ using (Stream s = await FileProvider.OpenReadAsync(filename))
{
AgateResourceLoader.LoadResources(this, s);
}
Modified: trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -84,7 +84,7 @@
{
XleSerializer ser = new XleSerializer(typeof(AgateDatabase));
- using (Stream x = await provider.OpenRead("catalog.txt"))
+ using (Stream x = await provider.OpenReadAsync("catalog.txt"))
{
AgateDatabase retval = (AgateDatabase)ser.Deserialize(x);
Modified: trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/Data/AgateTableDictionary.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -109,7 +109,7 @@
{
string filename = string.Format("data/{0}.txt", name);
- using (Stream r = FileProvider.OpenRead(filename).Result)
+ using (Stream r = FileProvider.OpenReadAsync(filename).Result)
{
AgateTable tbl = AgateTable.FromStream(r);
Modified: trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -1,4 +1,5 @@
-using AgateLib.DisplayLib;
+using AgateLib.ApplicationModels;
+using AgateLib.DisplayLib;
using AgateLib.Drivers;
using AgateLib.Platform.WinForms.Resources;
using System;
@@ -12,11 +13,12 @@
class FormsFactory : IAgateFactory
{
FontSurface mDefaultFont;
+ PlatformFactory mPlatformFactory;
public FormsFactory()
{
DisplayFactory = new DisplayFactory();
- PlatformFactory = new PlatformFactory();
+ mPlatformFactory = new PlatformFactory();
var sdl = new SdlFactory();
@@ -24,10 +26,15 @@
InputFactory = sdl;
}
+ public void SetAssetLocations(AssetLocations assetLocations)
+ {
+ mPlatformFactory.SetAssetLocations(assetLocations);
+ }
+
public IDisplayFactory DisplayFactory { get; private set; }
public IAudioFactory AudioFactory { get; private set; }
public IInputFactory InputFactory { get; private set; }
- public IPlatformFactory PlatformFactory { get; private set; }
+ public IPlatformFactory PlatformFactory { get { return mPlatformFactory; } }
public DisplayLib.FontSurface DefaultFont
Modified: trunk/AgateLib.Platform.WinForms/Factories/PlatformFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/PlatformFactory.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/Factories/PlatformFactory.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -26,6 +26,12 @@
public PlatformInfo Info { get; private set; }
public IReadFileProvider AssetFileProvider { get; private set; }
+
+ public void SetAssetLocations(AgateLib.ApplicationModels.AssetLocations assetLocations)
+ {
+ AssetFileProvider = new FileSystemProvider(System.IO.Path.GetFullPath(assetLocations.Path));
+ }
+
public IStopwatch CreateStopwatch()
{
return new DiagnosticsStopwatch();
Modified: trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -56,7 +56,7 @@
/// </summary>
/// <param name="filename">The filename to search for.</param>
/// <returns></returns>
- public async Task<Stream> OpenRead(string filename)
+ public async Task<Stream> OpenReadAsync(string filename)
{
if (string.IsNullOrEmpty(filename))
throw new ArgumentNullException("You must supply a file name.");
@@ -65,7 +65,7 @@
{
if (mProviders[i].FileExists(filename))
{
- return await mProviders[i].OpenRead(filename);
+ return await mProviders[i].OpenReadAsync(filename);
}
}
@@ -305,7 +305,7 @@
/// <returns></returns>
public string ReadAllText(string filename)
{
- Stream s = OpenRead(filename).Result;
+ Stream s = OpenReadAsync(filename).Result;
return new StreamReader(s).ReadToEnd();
}
Modified: trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -47,7 +47,7 @@
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
- public async Task<Stream> OpenRead(string filename)
+ public async Task<Stream> OpenReadAsync(string filename)
{
string resolvedName = FindFileName(filename);
if (resolvedName == null)
@@ -254,7 +254,7 @@
/// <returns></returns>
public string ReadAllText(string filename)
{
- Stream s = OpenRead(filename).Result;
+ Stream s = OpenReadAsync(filename).Result;
return new StreamReader(s).ReadToEnd();
}
Modified: trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -202,7 +202,7 @@
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
- public async Task<Stream> OpenRead(string filename)
+ public async Task<Stream> OpenReadAsync(string filename)
{
for (int i = 0; i < mFiles.Count; i++)
{
@@ -278,7 +278,7 @@
/// <returns></returns>
public string ReadAllText(string filename)
{
- Stream s = OpenRead(filename).Result;
+ Stream s = OpenReadAsync(filename).Result;
return new StreamReader(s).ReadToEnd();
}
Modified: trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -271,7 +271,7 @@
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
- public async Task<Stream> OpenRead(string filename)
+ public async Task<Stream> OpenReadAsync(string filename)
{
FileHeader header = GetFile(filename);
@@ -345,7 +345,7 @@
/// <returns></returns>
public string ReadAllText(string filename)
{
- Stream s = OpenRead(filename).Result;
+ Stream s = OpenReadAsync(filename).Result;
return new StreamReader(s).ReadToEnd();
}
Modified: trunk/AgateLib.Platform.WinForms/WinFormsInitializer.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/WinFormsInitializer.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WinForms/WinFormsInitializer.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -18,6 +18,7 @@
Core.Initialize(factory);
}
+ factory.SetAssetLocations(parameters.AssetLocations);
Core.InitAssetLocations(parameters.AssetLocations);
////var assetProvider = new FileSystemProvider(System.IO.Path.GetFullPath(parameters.AssetLocations.Path));
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -21,7 +21,7 @@
this.path = path;
}
- public async Task<System.IO.Stream> OpenRead(string filename)
+ public async Task<System.IO.Stream> OpenReadAsync(string filename)
{
Uri uri = new Uri(path + filename);
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/CoordinateSystem.cs
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/CoordinateSystem.cs 2014-08-31 18:26:40 UTC (rev 1496)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/CoordinateSystem.cs 2014-08-31 18:55:13 UTC (rev 1497)
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
-
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.DisplayLib.Shaders;
@@ -14,7 +13,6 @@
class CoordinateSystem : ISerialModelTest
{
int ortho = 0;
- DisplayWindow wind;
public string Name { get { return "Coordinate System"; } }
public string Category { get { return "Shaders"; } }
@@ -26,7 +24,7 @@
Surface surf = new Surface("jellybean.png");
surf.Color = Color.Cyan;
- while (wind.IsClosed == false)
+ while (Display.CurrentWindow.IsClosed == false)
{
Display.BeginFrame();
Display.Clear();
@@ -70,7 +68,7 @@
Keyboard.ReleaseKey(KeyCode.Space);
}
else if (e.KeyCode == KeyCode.Escape)
- wind.Dispose();
+ Display.CurrentWindow.Dispose();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-01 07:07:40
|
Revision: 1498
http://sourceforge.net/p/agate/code/1498
Author: kanato
Date: 2014-09-01 07:07:34 +0000 (Mon, 01 Sep 2014)
Log Message:
-----------
Remove unnecessary Platform.Common library.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib-Windows.sln
trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj
trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj
trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
Added Paths:
-----------
trunk/AgateLib/Platform/DiagnosticsStopwatch.cs
trunk/AgateLib/Platform/PlatformSerialization.cs
Removed Paths:
-------------
trunk/AgateLib.Platform.Common/PlatformImplementation/DiagnosticsStopwatch.cs
trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -73,6 +73,8 @@
<Compile Include="Geometry\CoordinateSystems\FixedAspectRatioCoordinates.cs" />
<Compile Include="Geometry\ICoordinateSystemCreator.cs" />
<Compile Include="ApplicationModels\ModelParameters.cs" />
+ <Compile Include="Platform\DiagnosticsStopwatch.cs" />
+ <Compile Include="Platform\PlatformSerialization.cs" />
<Compile Include="Resources\DC\AgateResource.cs" />
<Compile Include="Resources\DC\FontResource.cs" />
<Compile Include="Resources\DC\FontSurfaceResource.cs" />
Copied: trunk/AgateLib/Platform/DiagnosticsStopwatch.cs (from rev 1493, trunk/AgateLib.Platform.Common/PlatformImplementation/DiagnosticsStopwatch.cs)
===================================================================
--- trunk/AgateLib/Platform/DiagnosticsStopwatch.cs (rev 0)
+++ trunk/AgateLib/Platform/DiagnosticsStopwatch.cs 2014-09-01 07:07:34 UTC (rev 1498)
@@ -0,0 +1,144 @@
+using AgateLib.Platform;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Watch = System.Diagnostics.Stopwatch;
+
+namespace AgateLib.Platform.Common.PlatformImplementation
+{
+ /// <summary>
+ /// Class which represents a StopWatch.
+ /// A StopWatch can be paused and reset independently of other
+ /// StopWatches.
+ /// </summary>
+ public class DiagnosticsStopwatch : IDisposable, AgateLib.Platform.IStopwatch
+ {
+ Watch watch = new Watch();
+ int mPause = 1;
+
+ /// <summary>
+ /// Constructs a timer object, and immediately begins
+ /// keeping track of time.
+ /// </summary>
+ public DiagnosticsStopwatch()
+ : this(true)
+ {
+ watch.Start();
+ }
+ /// <summary>
+ /// Constructs a timer object.
+ /// If the timer starts paused, a call to Resume() must be made
+ /// for it to begin keeping track of time.
+ /// </summary>
+ /// <param name="autostart">Pass true to immediately begin keeping track of time.
+ /// False to pause the timer initially.</param>
+ public DiagnosticsStopwatch(bool autostart)
+ {
+ Timing.PauseAllTimersEvent += Pause;
+ Timing.ResumeAllTimersEvent += Resume;
+ Timing.ForceResumeAllTimersEvent += ForceResume;
+
+ if (autostart)
+ {
+ watch.Start();
+ mPause = 0;
+ }
+ }
+
+ /// <summary>
+ /// Destroys this timer.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ /// <summary>
+ /// Removes this timer from events.
+ /// </summary>
+ /// <param name="manual"></param>
+ protected virtual void Dispose(bool manual)
+ {
+ if (manual)
+ {
+ Timing.PauseAllTimersEvent -= Pause;
+ Timing.ResumeAllTimersEvent -= Resume;
+ Timing.ForceResumeAllTimersEvent -= ForceResume;
+ }
+ }
+
+ /// <summary>
+ /// Returns the number of seconds since the timer started.
+ /// </summary>
+ public double TotalSeconds
+ {
+ get { return (double)watch.ElapsedTicks / (double)Watch.Frequency; }
+ }
+
+ /// <summary>
+ /// Returns the number of ticks (milliseconds) since the timer started.
+ /// </summary>
+ public double TotalMilliseconds
+ {
+ get { return 1000.0 * TotalSeconds; }
+ }
+
+ /// <summary>
+ /// Resets the timer to zero.
+ /// </summary>
+ public void Reset()
+ {
+ watch = new System.Diagnostics.Stopwatch();
+ if (mPause <= 0)
+ watch.Start();
+ }
+
+ /// <summary>
+ /// Increments the pause counter.
+ /// If the counter is greater than zero, the timer won't advance.
+ /// </summary>
+ public void Pause()
+ {
+ watch.Stop();
+ mPause += 1;
+ }
+ /// <summary>
+ /// Decrements the pause counter.
+ /// If the pause counter is zero the timer will begin advancing.
+ /// </summary>
+ public void Resume()
+ {
+ mPause -= 1;
+
+ if (mPause < 0)
+ mPause = 0;
+
+ if (mPause == 0)
+ watch.Start();
+ }
+
+
+ /// <summary>
+ /// Sets the pause counter to zero, causing the timer to begin advancing
+ /// regardless of how many calls to Pause() are made.
+ /// </summary>
+ public void ForceResume()
+ {
+ if (mPause <= 0)
+ return;
+
+ mPause = 0;
+ Resume();
+ }
+
+ /// <summary>
+ /// Gets whether or not this StopWatch is paused.
+ /// </summary>
+ public bool IsPaused
+ {
+ get { return mPause > 0; }
+ }
+ }
+}
Copied: trunk/AgateLib/Platform/PlatformSerialization.cs (from rev 1493, trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs)
===================================================================
--- trunk/AgateLib/Platform/PlatformSerialization.cs (rev 0)
+++ trunk/AgateLib/Platform/PlatformSerialization.cs 2014-09-01 07:07:34 UTC (rev 1498)
@@ -0,0 +1,16 @@
+using AgateLib.Drivers;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.Platform.Common.PlatformImplementation
+{
+ public class PlatformSerialization : IPlatformSerialization
+ {
+ public object CreateInstance(Type t)
+ {
+ return Activator.CreateInstance(t, true);
+ }
+ }
+}
Modified: trunk/AgateLib-Windows.sln
===================================================================
--- trunk/AgateLib-Windows.sln 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib-Windows.sln 2014-09-01 07:07:34 UTC (rev 1498)
@@ -22,8 +22,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.OpenGL", "AgateLib.OpenGL\AgateLib.OpenGL.csproj", "{94734E5A-0344-43E8-BB30-E32E3F57F611}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.Common", "AgateLib.Platform.Common\AgateLib.Platform.Common.csproj", "{FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsMetro", "AgateLib.Platform.WindowsMetro\AgateLib.Platform.WindowsMetro.csproj", "{C9B8F763-187D-4F2E-BAEE-827B7247C278}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.Platform.WindowsPhone", "AgateLib.Platform.WindowsPhone\AgateLib.Platform.WindowsPhone.csproj", "{9BEF78DB-B535-47D3-9C14-453D373807EC}"
@@ -124,23 +122,6 @@
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x64.Build.0 = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.ActiveCfg = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.Build.0 = Release|x86
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|ARM.Build.0 = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|x64.ActiveCfg = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|x86.ActiveCfg = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Debug|x86.Build.0 = Debug|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|Any CPU.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|Any CPU.Build.0 = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|ARM.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|x64.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Public|x86.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|Any CPU.Build.0 = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|ARM.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|x64.ActiveCfg = Release|Any CPU
- {FC9E7036-AA75-4A6B-82DB-0F5E98B5FBCB}.Release|x86.ActiveCfg = Release|Any CPU
{C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9B8F763-187D-4F2E-BAEE-827B7247C278}.Debug|ARM.ActiveCfg = Debug|ARM
Modified: trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj
===================================================================
--- trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.Common/AgateLib.Platform.Common.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -44,13 +44,14 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Compile Include="PlatformImplementation\PlatformSerialization.cs" />
- <Compile Include="PlatformImplementation\DiagnosticsStopwatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <Folder Include="PlatformImplementation\" />
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Deleted: trunk/AgateLib.Platform.Common/PlatformImplementation/DiagnosticsStopwatch.cs
===================================================================
--- trunk/AgateLib.Platform.Common/PlatformImplementation/DiagnosticsStopwatch.cs 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.Common/PlatformImplementation/DiagnosticsStopwatch.cs 2014-09-01 07:07:34 UTC (rev 1498)
@@ -1,144 +0,0 @@
-using AgateLib.Platform;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Watch = System.Diagnostics.Stopwatch;
-
-namespace AgateLib.Platform.Common.PlatformImplementation
-{
- /// <summary>
- /// Class which represents a StopWatch.
- /// A StopWatch can be paused and reset independently of other
- /// StopWatches.
- /// </summary>
- public class DiagnosticsStopwatch : IDisposable, AgateLib.Platform.IStopwatch
- {
- Watch watch = new Watch();
- int mPause = 1;
-
- /// <summary>
- /// Constructs a timer object, and immediately begins
- /// keeping track of time.
- /// </summary>
- public DiagnosticsStopwatch()
- : this(true)
- {
- watch.Start();
- }
- /// <summary>
- /// Constructs a timer object.
- /// If the timer starts paused, a call to Resume() must be made
- /// for it to begin keeping track of time.
- /// </summary>
- /// <param name="autostart">Pass true to immediately begin keeping track of time.
- /// False to pause the timer initially.</param>
- public DiagnosticsStopwatch(bool autostart)
- {
- Timing.PauseAllTimersEvent += Pause;
- Timing.ResumeAllTimersEvent += Resume;
- Timing.ForceResumeAllTimersEvent += ForceResume;
-
- if (autostart)
- {
- watch.Start();
- mPause = 0;
- }
- }
-
- /// <summary>
- /// Destroys this timer.
- /// </summary>
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- /// <summary>
- /// Removes this timer from events.
- /// </summary>
- /// <param name="manual"></param>
- protected virtual void Dispose(bool manual)
- {
- if (manual)
- {
- Timing.PauseAllTimersEvent -= Pause;
- Timing.ResumeAllTimersEvent -= Resume;
- Timing.ForceResumeAllTimersEvent -= ForceResume;
- }
- }
-
- /// <summary>
- /// Returns the number of seconds since the timer started.
- /// </summary>
- public double TotalSeconds
- {
- get { return (double)watch.ElapsedTicks / (double)Watch.Frequency; }
- }
-
- /// <summary>
- /// Returns the number of ticks (milliseconds) since the timer started.
- /// </summary>
- public double TotalMilliseconds
- {
- get { return 1000.0 * TotalSeconds; }
- }
-
- /// <summary>
- /// Resets the timer to zero.
- /// </summary>
- public void Reset()
- {
- watch = new System.Diagnostics.Stopwatch();
- if (mPause <= 0)
- watch.Start();
- }
-
- /// <summary>
- /// Increments the pause counter.
- /// If the counter is greater than zero, the timer won't advance.
- /// </summary>
- public void Pause()
- {
- watch.Stop();
- mPause += 1;
- }
- /// <summary>
- /// Decrements the pause counter.
- /// If the pause counter is zero the timer will begin advancing.
- /// </summary>
- public void Resume()
- {
- mPause -= 1;
-
- if (mPause < 0)
- mPause = 0;
-
- if (mPause == 0)
- watch.Start();
- }
-
-
- /// <summary>
- /// Sets the pause counter to zero, causing the timer to begin advancing
- /// regardless of how many calls to Pause() are made.
- /// </summary>
- public void ForceResume()
- {
- if (mPause <= 0)
- return;
-
- mPause = 0;
- Resume();
- }
-
- /// <summary>
- /// Gets whether or not this StopWatch is paused.
- /// </summary>
- public bool IsPaused
- {
- get { return mPause > 0; }
- }
- }
-}
Deleted: trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs
===================================================================
--- trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.Common/PlatformImplementation/PlatformSerialization.cs 2014-09-01 07:07:34 UTC (rev 1498)
@@ -1,16 +0,0 @@
-using AgateLib.Drivers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace AgateLib.Platform.Common.PlatformImplementation
-{
- public class PlatformSerialization : IPlatformSerialization
- {
- public object CreateInstance(Type t)
- {
- return Activator.CreateInstance(t, true);
- }
- }
-}
Modified: trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
===================================================================
--- trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -166,10 +166,6 @@
<Project>{94734e5a-0344-43e8-bb30-e32e3f57f611}</Project>
<Name>AgateLib.OpenGL</Name>
</ProjectReference>
- <ProjectReference Include="..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\AgateLib\AgateLib.csproj">
<Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
<Name>AgateLib</Name>
Modified: trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.WindowsMetro/AgateLib.Platform.WindowsMetro.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -105,10 +105,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- <ProjectReference Include="..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj">
<Project>{c7f9ae34-b781-4490-a9b2-5728f44f3523}</Project>
<Name>AgateLib.Platform.WindowsStoreCommon</Name>
Modified: trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.WindowsPhone/AgateLib.Platform.WindowsPhone.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -83,10 +83,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- <ProjectReference Include="..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\AgateLib.Platform.WindowsStoreCommon\AgateLib.Platform.WindowsStoreCommon.csproj">
<Project>{c7f9ae34-b781-4490-a9b2-5728f44f3523}</Project>
<Name>AgateLib.Platform.WindowsStoreCommon</Name>
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -101,10 +101,6 @@
<Content Include="Resources\ShaderSource\Basic2Dvert.hlsl" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\AgateLib\AgateLib.csproj">
<Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
<Name>AgateLib</Name>
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -38,10 +38,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
- <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
<Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
<Name>AgateLib</Name>
Modified: trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Tests/Tests.WindowsMetro/AgateLib.Tests.WindowsMetro.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -105,10 +105,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\..\AgateLib.Platform.WindowsMetro\AgateLib.Platform.WindowsMetro.csproj">
<Project>{c9b8f763-187d-4f2e-baee-827b7247c278}</Project>
<Name>AgateLib.Platform.WindowsMetro</Name>
Modified: trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Tests/Tests.WindowsPhone/AgateLib.Tests.WindowsPhone.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -82,10 +82,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\..\AgateLib.Platform.WindowsPhone\AgateLib.Platform.WindowsPhone.csproj">
<Project>{9bef78db-b535-47d3-9c14-453d373807ec}</Project>
<Name>AgateLib.Platform.WindowsPhone</Name>
Modified: trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
===================================================================
--- trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-08-31 18:55:13 UTC (rev 1497)
+++ trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-09-01 07:07:34 UTC (rev 1498)
@@ -117,10 +117,6 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\AgateLib.Platform.Common\AgateLib.Platform.Common.csproj">
- <Project>{fc9e7036-aa75-4a6b-82db-0f5e98b5fbcb}</Project>
- <Name>AgateLib.Platform.Common</Name>
- </ProjectReference>
<ProjectReference Include="..\..\AgateLib.Platform.WinForms\AgateLib.Platform.WinForms.csproj">
<Project>{4b12561e-d37b-48a1-b6db-218e94906c22}</Project>
<Name>AgateLib.Platform.WinForms</Name>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-01 19:13:54
|
Revision: 1501
http://sourceforge.net/p/agate/code/1501
Author: kanato
Date: 2014-09-01 19:13:43 +0000 (Mon, 01 Sep 2014)
Log Message:
-----------
Create default fonts in AgateLib.Assets.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/Assets/Fonts.cs
trunk/AgateLib/Core.cs
trunk/AgateLib/Diagnostics/AgateConsole.cs
trunk/AgateLib/DisplayLib/Font.cs
trunk/AgateLib/DisplayLib/FontSurface.cs
trunk/AgateLib/Drivers/IAgateFactory.cs
trunk/AgateLib/Drivers/IDisplayFactory.cs
trunk/AgateLib/IO/IReadFileProvider.cs
trunk/AgateLib/IO/SubDirectoryProvider.cs
trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
trunk/AgateLib/Resources/Legacy/ImageResource.cs
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WinForms/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
trunk/AgateLib.Platform.WinForms/Resources/BuiltinResources.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/TestResourceFile.xml
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeDisplayDriver.cs
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/DisplayWindowEvents.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/FullScreen.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleFramebufferTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/MultipleWindows/MultipleWindowTest.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/PixelBufferTest/PixelBufferTest.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/Kerning.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/Lighting3DTest.cs
trunk/AgateLib.Tests/Tests.WinForms/frmLauncher.cs
Added Paths:
-----------
trunk/AgateLib/Assets/DefaultResources.cs
trunk/AgateLib.Platform.WinForms/Resources/Builtin.Designer.cs
trunk/AgateLib.Platform.WinForms/Resources/Builtin.resx
trunk/AgateLib.Platform.WinForms/Resources/Fonts.zip
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/attacke.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/jellybean.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Audio/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Audio/SoundbufferStopTester.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Audio/StreamAudio.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FoundationTests/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FoundationTests/Resources.cs
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/Assets/attacke.png
trunk/AgateLib.Tests/Tests.WinForms/Assets/jellybean.png
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/SoundbufferStopTester.cs
trunk/AgateLib.Tests/Tests.WinForms/AudioTests/StreamAudio.cs
trunk/AgateLib.Tests/Tests.WinForms/CoreTests/Resources.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-01 19:13:43 UTC (rev 1501)
@@ -51,6 +51,7 @@
<Compile Include="ApplicationModels\PassiveModelParameters.cs" />
<Compile Include="ApplicationModels\SceneModelParameters.cs" />
<Compile Include="ApplicationModels\SerialModelParameters.cs" />
+ <Compile Include="Assets\DefaultResources.cs" />
<Compile Include="Assets\Fonts.cs" />
<Compile Include="Geometry\CoordinateSystems\FixedCoordinateSystem.cs" />
<Compile Include="Geometry\CoordinateSystems\NativeCoordinates.cs" />
Added: trunk/AgateLib/Assets/DefaultResources.cs
===================================================================
--- trunk/AgateLib/Assets/DefaultResources.cs (rev 0)
+++ trunk/AgateLib/Assets/DefaultResources.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -0,0 +1,30 @@
+using AgateLib.DisplayLib;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Assets
+{
+ public class DefaultResources : IDisposable
+ {
+ internal DefaultResources()
+ { }
+
+ public Font AgateSans { get; set; }
+ public Font AgateSerif { get; set; }
+ public Font AgateMono { get; set; }
+
+ public void Dispose()
+ {
+ if (AgateSans != null) AgateSans.Dispose();
+ if (AgateSerif != null) AgateSerif.Dispose();
+ if (AgateMono != null) AgateMono.Dispose();
+
+ AgateSans = null;
+ AgateSerif = null;
+ AgateMono = null;
+ }
+ }
+}
Modified: trunk/AgateLib/Assets/Fonts.cs
===================================================================
--- trunk/AgateLib/Assets/Fonts.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Assets/Fonts.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -11,39 +11,34 @@
/// </summary>
public static class Fonts
{
- public static void Initialize()
+ static DefaultResources mResources;
+
+ internal static void Initialize(DefaultResources res)
{
- AgateSans = Font.Create("AgateSans", 8, 64, FontStyles.Bold);
- AgateSerif = Font.Create("AgateSerif", 8, 64, FontStyles.Bold);
- AgateMono = Font.Create("AgateMono", 8, 64, FontStyles.Bold);
+ mResources = res;
Display.DisposeDisplay += Display_DisposeDisplay;
}
static void Display_DisposeDisplay()
{
- AgateSans.Dispose();
- AgateSerif.Dispose();
- AgateMono.Dispose();
+ mResources.Dispose();
+ mResources = null;
- AgateSans = null;
- AgateSerif = null;
- AgateMono = null;
-
Display.DisposeDisplay -= Display_DisposeDisplay;
}
/// <summary>
/// Default sans serif font.
/// </summary>
- public static Font AgateSans { get; private set; }
+ public static Font AgateSans { get { return mResources.AgateSans; } }
/// <summary>
/// Default serif font.
/// </summary>
- public static Font AgateSerif { get; private set; }
+ public static Font AgateSerif { get { return mResources.AgateSerif; } }
/// <summary>
/// Default monospace font.
/// </summary>
- public static Font AgateMono { get; private set; }
+ public static Font AgateMono { get { return mResources.AgateMono; } }
}
}
Modified: trunk/AgateLib/Core.cs
===================================================================
--- trunk/AgateLib/Core.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Core.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -31,6 +31,8 @@
using AgateLib.IO;
using AgateLib.InputLib;
using AgateLib.ApplicationModels;
+using AgateLib.Assets;
+using System.Threading.Tasks;
namespace AgateLib
{
@@ -329,14 +331,26 @@
FileSystem.File = factory.PlatformFactory.CreateFile();
FileSystem.Path = factory.PlatformFactory.CreatePath();
-
+
Display.Initialize(factory.DisplayFactory.DisplayImpl);
Audio.Initialize(factory.AudioFactory.CreateAudioImpl());
JoystickInput.Initialize(factory.InputFactory.CreateJoystickInputImpl());
+ InitializeDefaultResources();
+
sInititalized = true;
}
+ public static void InitializeDefaultResources()
+ {
+ DefaultResources res = new DefaultResources();
+
+ var task = mFactory.DisplayFactory.InitializeDefaultResourcesAsync(res);
+ Assets.Fonts.Initialize(res);
+
+ Task.WaitAll(task);
+ }
+
public static void InitAssetLocations(AssetLocations assets)
{
FileProvider.Initialize(mFactory.PlatformFactory.AssetFileProvider, assets);
Modified: trunk/AgateLib/Diagnostics/AgateConsole.cs
===================================================================
--- trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -39,7 +39,7 @@
public static bool IsInitialized { get { return sInstance != null; } }
- public static FontSurface Font { get; set; }
+ public static Font Font { get; set; }
public static KeyCode VisibleToggleKey { get; set; }
public static bool IsVisible
{
@@ -96,7 +96,7 @@
if (sInstance == null) return;
if (Font == null)
- Font = Core.Factory.DefaultFont;
+ Font = Assets.Fonts.AgateMono;
sInstance.DrawImpl();
}
Modified: trunk/AgateLib/DisplayLib/Font.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Font.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/DisplayLib/Font.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -25,6 +25,10 @@
fs.Dispose();
}
+ public string Name { get; set; }
+ public int Size { get { return mSettings.Size; } set { mSettings.Size = value; } }
+ public FontStyles Style { get { return mSettings.Style; } set { mSettings.Style = value; } }
+
public void AddFont(FontSurface fontSurface, int size, FontStyles style)
{
AddFont(new FontSettings(size, style), fontSurface);
@@ -37,10 +41,16 @@
mFontSurfaces[settings] = fontSurface;
}
- public string Name { get; set; }
- public int Size { get { return mSettings.Size; } set { mSettings.Size = value; } }
- public FontStyles Style { get { return mSettings.Style; } set { mSettings.Style = value; } }
+ public FontSurface GetFontSurface(int size, FontStyles fontStyles)
+ {
+ return GetFontSurface(new FontSettings(size, fontStyles));
+ }
+ public FontSurface GetFontSurface(FontSettings settings)
+ {
+ return mFontSurfaces[settings];
+ }
+
public int FontHeight { get { return FontSurface.FontHeight; } }
int MaxSize(FontStyles style)
@@ -154,6 +164,10 @@
set { mState.DisplayAlignment = value; }
}
+ public void DrawText(string text)
+ {
+ FontSurface.DrawText(text);
+ }
public void DrawText(Point dest, string text)
{
FontSurface.DrawText(dest, text);
Modified: trunk/AgateLib/DisplayLib/FontSurface.cs
===================================================================
--- trunk/AgateLib/DisplayLib/FontSurface.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/DisplayLib/FontSurface.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -92,7 +92,7 @@
if (res is BitmapFontResource)
{
- Surface surf = new Surface(resources.FullFileName(bmpFont.Image), AgateLib.IO.FileProvider.ResourceAssets);
+ Surface surf = new Surface(resources.FullFileName(bmpFont.Image), resources.FileProvider);
mImpl = new BitmapFontImpl(surf, bmpFont.FontMetrics, resourceName);
}
Modified: trunk/AgateLib/Drivers/IAgateFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/IAgateFactory.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Drivers/IAgateFactory.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -31,7 +31,5 @@
IAudioFactory AudioFactory { get; }
IInputFactory InputFactory { get; }
IPlatformFactory PlatformFactory { get; }
-
- FontSurface DefaultFont { get; set; }
}
}
Modified: trunk/AgateLib/Drivers/IDisplayFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/IDisplayFactory.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Drivers/IDisplayFactory.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -94,5 +94,7 @@
FrameBufferImpl CreateFrameBuffer(Size size);
+
+ Task InitializeDefaultResourcesAsync(Assets.DefaultResources res);
}
}
Modified: trunk/AgateLib/IO/IReadFileProvider.cs
===================================================================
--- trunk/AgateLib/IO/IReadFileProvider.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/IO/IReadFileProvider.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -79,5 +79,10 @@
/// <param name="filename"></param>
/// <returns></returns>
string ResolveFile(string filename);
+
+ /// <summary>
+ /// Returns true if the file system is not a physical file system.
+ /// </summary>
+ bool IsLogicalFilesystem { get; }
}
}
Modified: trunk/AgateLib/IO/SubDirectoryProvider.cs
===================================================================
--- trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -93,5 +93,11 @@
return false;
}
+
+
+ public bool IsLogicalFilesystem
+ {
+ get { return parent.IsLogicalFilesystem; }
+ }
}
}
Modified: trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -63,15 +63,14 @@
{
get
{
- foreach (var img in mResources.mImages)
+ try
{
- var retval = img.Surfaces.FirstOrDefault(x => x.Name == key);
-
- if (retval != null)
- return retval;
+ return (SurfaceResource) mResources.mStore.First(x => x.Key == key).Value;
}
-
- throw new AgateResourceException("Could not find the surface resource {0}.", key);
+ catch (Exception e)
+ {
+ throw new AgateResourceException(e, "Could not find the surface resource {0}.", key);
+ }
}
}
@@ -117,6 +116,7 @@
public AgateResourceCollection()
{
mSurfaceAccessor = new SurfaceResourceList(this);
+ FileProvider = AgateLib.IO.FileProvider.ResourceAssets;
this.mStore.Add(mStringTableKey, new StringTable());
}
Modified: trunk/AgateLib/Resources/Legacy/ImageResource.cs
===================================================================
--- trunk/AgateLib/Resources/Legacy/ImageResource.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib/Resources/Legacy/ImageResource.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -42,6 +42,7 @@
switch (version)
{
+ case "1.0.0":
case "0.3.2":
Filename = node.Attribute("filename").Value;
ReadSubNodes032(node);
Modified: trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
===================================================================
--- trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-09-01 19:13:43 UTC (rev 1501)
@@ -131,6 +131,11 @@
<Compile Include="IO\TgzFileProvider.cs" />
<Compile Include="IO\ZipFileProvider.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Resources\Builtin.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Builtin.resx</DependentUpon>
+ </Compile>
<Compile Include="WinFormsInitializer.cs" />
<Compile Include="Resources\BuiltinResources.cs" />
<Compile Include="SurfaceExtensions.cs" />
@@ -185,9 +190,14 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Icons.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <EmbeddedResource Include="Resources\Builtin.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Builtin.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
+ <None Include="Resources\Fonts.zip" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AgateLib-mono.ico" />
Modified: trunk/AgateLib.Platform.WinForms/Factories/DisplayFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/DisplayFactory.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/Factories/DisplayFactory.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -6,6 +6,7 @@
using AgateLib.Geometry;
using AgateLib.OpenGL;
using AgateLib.Platform.WinForms.DisplayImplementation;
+using AgateLib.Platform.WinForms.Resources;
using System;
using System.Collections.Generic;
using System.IO;
@@ -35,7 +36,10 @@
public SurfaceImpl CreateSurface(IReadFileProvider provider, string filename)
{
- return new GL_Surface(provider.ResolveFile(filename));
+ if (provider.IsLogicalFilesystem)
+ return new GL_Surface(provider.OpenReadAsync(filename).Result);
+ else
+ return new GL_Surface(provider.ResolveFile(filename));
}
public SurfaceImpl CreateSurface(Stream fileStream)
@@ -112,5 +116,24 @@
get { return FullDisplayImpl.SupportsFramebufferExt; }
set { FullDisplayImpl.SupportsFramebufferExt = value; }
}
+
+
+ public async Task InitializeDefaultResourcesAsync(Assets.DefaultResources res)
+ {
+ res.Dispose();
+
+ res.AgateSans = new Font("AgateSans");
+ res.AgateSerif = new Font("AgateSerif");
+ res.AgateMono = new Font("AgateMono");
+
+ res.AgateSans.AddFont(await BuiltinResources.GetFontAsync("AgateSans-10"), 10, FontStyles.None);
+ res.AgateSans.AddFont(await BuiltinResources.GetFontAsync("AgateSans-14"), 14, FontStyles.None);
+ res.AgateSans.AddFont(await BuiltinResources.GetFontAsync("AgateSans-24"), 24, FontStyles.None);
+
+ res.AgateSerif.AddFont(await BuiltinResources.GetFontAsync("AgateSerif-10"), 10, FontStyles.None);
+ res.AgateSerif.AddFont(await BuiltinResources.GetFontAsync("AgateSerif-14"), 14, FontStyles.None);
+
+ res.AgateMono.AddFont(await BuiltinResources.GetFontAsync("AgateMono-10"), 10, FontStyles.None);
+ }
}
}
Modified: trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -36,20 +36,5 @@
public IInputFactory InputFactory { get; private set; }
public IPlatformFactory PlatformFactory { get { return mPlatformFactory; } }
-
- public DisplayLib.FontSurface DefaultFont
- {
- get
- {
- if (mDefaultFont == null)
- mDefaultFont = BuiltinResources.AgateSans10;
-
- return mDefaultFont;
- }
- set
- {
- throw new NotImplementedException();
- }
- }
}
}
Modified: trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/IO/FileProviderList.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -310,5 +310,9 @@
return new StreamReader(s).ReadToEnd();
}
+ public bool IsLogicalFilesystem
+ {
+ get { return true; }
+ }
}
}
Modified: trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -54,7 +54,7 @@
throw new FileNotFoundException(string.Format("The file {0} was not found in the path {1}.",
filename, mPath));
- return await Task.Run(() => File.OpenRead(FindFileName(filename)));
+ return File.OpenRead(FindFileName(filename));
}
/// <summary>
/// Returns true if the specified file exists.
@@ -258,5 +258,11 @@
return new StreamReader(s).ReadToEnd();
}
+
+
+ public bool IsLogicalFilesystem
+ {
+ get { return true; }
+ }
}
}
Modified: trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/IO/TgzFileProvider.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -292,5 +292,9 @@
{
throw new InvalidOperationException("This file provider does not provide access to a physical file system.");
}
+ public bool IsLogicalFilesystem
+ {
+ get { return true; }
+ }
}
}
\ No newline at end of file
Modified: trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs 2014-09-01 07:36:00 UTC (rev 1500)
+++ trunk/AgateLib.Platform.WinForms/IO/ZipFileProvider.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -359,6 +359,10 @@
{
throw new InvalidOperationException("This file provider does not provide access to a physical file system.");
}
+ public bool IsLogicalFilesystem
+ {
+ get { return true; }
+ }
}
enum ZipStorageType
Added: trunk/AgateLib.Platform.WinForms/Resources/Builtin.Designer.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Resources/Builtin.Designer.cs (rev 0)
+++ trunk/AgateLib.Platform.WinForms/Resources/Builtin.Designer.cs 2014-09-01 19:13:43 UTC (rev 1501)
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.34014
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace AgateLib.Platform.WinForms.Resources {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Builtin {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Builtin() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AgateLib.Platform.WinForms.Resources.Builtin", typeof(Builtin).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized resource of type System.Byte[].
+ /// </summary>
+ internal static byte[] Fonts {
+ get {
+ object obj = ResourceManager.GetObject("Fonts", resourceCulture);
+ return ((byte[])(obj));
+ }
+ }
+ }
+}
Added: trunk/AgateLib.Platform.WinForms/Resources/Builtin.resx
===================================================================
--- trunk/AgateLib.Platform.WinForms/Resources/Builtin.resx (rev 0)
+++ trunk/AgateLib.Platform.WinForms/Resources/Builtin.resx 2014-09-01 19:13:43 UTC (rev 1501)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXRes...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-02 06:43:21
|
Revision: 1502
http://sourceforge.net/p/agate/code/1502
Author: kanato
Date: 2014-09-02 06:43:15 +0000 (Tue, 02 Sep 2014)
Log Message:
-----------
Integration of default fonts into windows store applications.
Modified Paths:
--------------
trunk/AgateLib/DisplayLib/Font.cs
trunk/AgateLib/DisplayLib/FontSurface.cs
trunk/AgateLib/Drivers/IDisplayFactory.cs
trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Display.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/Interpolation.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/DisplayTests/ParticleTests.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/FontTests/TextLayout.cs
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/LargeImage.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/Prerendered.cs
trunk/AgateLib.Tests/Tests.WinForms/DisplayTests/RenderTargetContinuous.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/BitmapFonts.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/FontLineTester.cs
trunk/AgateLib.Tests/Tests.WinForms/FontTests/Fonts.cs
trunk/AgateLib.Tests/Tests.WinForms/Shaders/Hlsl.cs
Added Paths:
-----------
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png
trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Resources.xml
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/9ball.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/smoke.png
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/smoke2.png
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/Assets/smoke.png
trunk/AgateLib.Tests/Tests.WinForms/Assets/smoke2.png
Modified: trunk/AgateLib/DisplayLib/Font.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Font.cs 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib/DisplayLib/Font.cs 2014-09-02 06:43:15 UTC (rev 1502)
@@ -163,6 +163,15 @@
get { return mState.DisplayAlignment; }
set { mState.DisplayAlignment = value; }
}
+ public TextImageLayout TextImageLayout
+ {
+ get { return mFontSurfaces.Values.First().TextImageLayout; }
+ set
+ {
+ foreach (var fs in mFontSurfaces.Values)
+ fs.TextImageLayout = value;
+ }
+ }
public void DrawText(string text)
{
@@ -180,6 +189,10 @@
{
FontSurface.DrawText(x, y, text, Parameters);
}
+ public void DrawTest(double x, double y, string text)
+ {
+ FontSurface.DrawText(x, y, text);
+ }
public Size MeasureString(string text)
{
Modified: trunk/AgateLib/DisplayLib/FontSurface.cs
===================================================================
--- trunk/AgateLib/DisplayLib/FontSurface.cs 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib/DisplayLib/FontSurface.cs 2014-09-02 06:43:15 UTC (rev 1502)
@@ -52,6 +52,7 @@
/// support, either create a bitmap font, or use one of the built-in
/// ones, like FontSurface.AgateSans14.
/// </remarks>
+ [Obsolete("Do not use this.", true)]
public FontSurface(string fontFamily, float sizeInPoints)
: this(fontFamily, sizeInPoints, FontStyles.None)
{ }
@@ -68,19 +69,23 @@
/// support, either create a bitmap font, or use one of the built-in
/// ones, like FontSurface.AgateSans14.
/// </remarks>
+ [Obsolete("Do not use this.", true)]
public FontSurface(string fontFamily, float sizeInPoints, FontStyles style)
{
- if (sizeInPoints < 1)
- throw new ArgumentOutOfRangeException("Font size must be positive and non-zero, but was " +
- sizeInPoints.ToString() + ".");
-
- mImpl = Core.Factory.DisplayFactory.CreateFont(fontFamily, sizeInPoints, style);
-
- Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose);
-
- System.Diagnostics.Debug.Assert(mImpl != null);
+ throw new InvalidOperationException("Obsolete method.");
}
/// <summary>
+ /// Creates a bitmap font using the options passed in. The Display driver
+ /// must be capable of this, which is indicated in Display.Caps.CanCreateBitmapFont.
+ /// </summary>
+ /// <param name="bitmapOptions"></param>
+ [Obsolete("Do not use this.", true)]
+ public FontSurface(BitmapFontOptions bitmapOptions)
+ {
+ throw new InvalidOperationException("Obsolete method.");
+ }
+
+ /// <summary>
/// Constructs a FontSurface object from a resource.
/// </summary>
/// <param name="resources"></param>
@@ -104,36 +109,24 @@
System.Diagnostics.Debug.Assert(mImpl != null);
}
/// <summary>
- /// Creates a bitmap font using the options passed in. The Display driver
- /// must be capable of this, which is indicated in Display.Caps.CanCreateBitmapFont.
- /// </summary>
- /// <param name="bitmapOptions"></param>
- public FontSurface(BitmapFontOptions bitmapOptions)
- {
- mImpl = Core.Factory.DisplayFactory.CreateFont(bitmapOptions);
-
- Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose);
-
- System.Diagnostics.Debug.Assert(mImpl != null);
- }
-
- /// <summary>
/// Gets the name of the font.
/// </summary>
public string FontName
{
get { return mImpl.FontName; }
}
+
/// <summary>
- /// Private initializer to tell it what impl to use.
+ /// Initializer passing in a FontSurfaceImpl object.
/// </summary>
/// <param name="implToUse"></param>
- private FontSurface(FontSurfaceImpl implToUse)
+ public FontSurface(FontSurfaceImpl implToUse)
{
if (implToUse == null)
throw new ArgumentNullException("implToUse");
mImpl = implToUse;
+ Display.DisposeDisplay += Dispose;
}
/// <summary>
Modified: trunk/AgateLib/Drivers/IDisplayFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/IDisplayFactory.cs 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib/Drivers/IDisplayFactory.cs 2014-09-02 06:43:15 UTC (rev 1502)
@@ -69,32 +69,18 @@
/// <param name="pixels"></param>
/// <returns></returns>
SurfaceImpl CreateSurface(PixelBuffer pixels);
-
+
/// <summary>
- /// Creates a FontSurfaceImpl derived object based on an operating system font.
+ /// Creates a FrameBufferImpl object of the specified size.
/// </summary>
- /// <param name="fontFamily"></param>
- /// <param name="sizeInPoints"></param>
- /// <param name="style"></param>
- /// <returns></returns>
- FontSurfaceImpl CreateFont(string fontFamily, float sizeInPoints, FontStyles style);
+ /// <param name="size"></param>
+ FrameBufferImpl CreateFrameBuffer(Size size);
/// <summary>
- /// Creates a BitmapFontImpl object from the specified options.
+ /// Initializes the default resources.
/// </summary>
- /// <param name="bitmapOptions"></param>
+ /// <param name="res"></param>
/// <returns></returns>
- FontSurfaceImpl CreateFont(BitmapFontOptions bitmapOptions);
-
-
- /// <summary>
- /// Creates a FrameBufferImpl object of the specified size.
- /// </summary>
- /// <param name="size"></param>
- FrameBufferImpl CreateFrameBuffer(Size size);
-
-
-
Task InitializeDefaultResourcesAsync(Assets.DefaultResources res);
}
}
Modified: trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs
===================================================================
--- trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib/Resources/Legacy/AgateResourceCollection.cs 2014-09-02 06:43:15 UTC (rev 1502)
@@ -124,9 +124,10 @@
/// Constructs a new AgateResourceCollection object.
/// </summary>
/// <param name="filename"></param>
- public AgateResourceCollection(string filename)
+ public AgateResourceCollection(string filename, IReadFileProvider fileProvider = null)
{
mSurfaceAccessor = new SurfaceResourceList(this);
+ FileProvider = fileProvider;
RootDirectory = System.IO.Path.GetDirectoryName(filename);
@@ -135,7 +136,7 @@
private async Task Load(string filename)
{
- using (Stream s = await FileProvider.OpenReadAsync(filename))
+ using (Stream s = await FileProvider.OpenReadAsync(filename).ConfigureAwait(false))
{
AgateResourceLoader.LoadResources(this, s);
}
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-09-02 06:43:15 UTC (rev 1502)
@@ -41,6 +41,27 @@
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<None Include="packages.config" />
+ <Content Include="Assets\Fonts\AgateMono-10.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Fonts\AgateSans-10.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Fonts\AgateSans-14.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Fonts\AgateSans-24.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Fonts\AgateSerif-10.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Fonts\AgateSerif-14.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Resources\Basic2Dpixel.fxo">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateMono-10.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-10.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-14.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSans-24.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-10.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png
===================================================================
(Binary files differ)
Index: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png 2014-09-01 19:13:43 UTC (rev 1501)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png 2014-09-02 06:43:15 UTC (rev 1502)
Property changes on: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Fonts/AgateSerif-14.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Resources.xml
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Resources.xml (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Assets/Resources.xml 2014-09-02 06:43:15 UTC (rev 1502)
@@ -0,0 +1,1952 @@
+<AgateResources Version="0.3.2">
+ <StringTable />
+ <BitmapFont name="AgateSans-14" image="Fonts/AgateSans-14.png">
+ <Metrics>
+ <Glyph char="32" source="{X=0,Y=2,Width=7,Height=25}" rightOverhang="1" />
+ <Glyph char="33" source="{X=9,Y=2,Width=9,Height=25}" leftOverhang="-3" rightOverhang="4" />
+ <Glyph char="34" source="{X=20,Y=2,Width=9,Height=25}" rightOverhang="1" />
+ <Glyph char="35" source="{X=31,Y=2,Width=17,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="36" source="{X=50,Y=2,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="37" source="{X=65,Y=2,Width=19,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="38" source="{X=86,Y=2,Width=17,Height=25}" leftOverhang="-1" rightOverhang="4" />
+ <Glyph char="39" source="{X=105,Y=2,Width=5,Height=25}" rightOverhang="1" />
+ <Glyph char="40" source="{X=112,Y=2,Width=8,Height=25}" rightOverhang="1" />
+ <Glyph char="41" source="{X=122,Y=2,Width=8,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="42" source="{X=132,Y=2,Width=11,Height=25}" rightOverhang="1" />
+ <Glyph char="43" source="{X=145,Y=2,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="44" source="{X=164,Y=2,Width=7,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="45" source="{X=173,Y=2,Width=8,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="46" source="{X=183,Y=2,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="47" source="{X=192,Y=2,Width=9,Height=25}" rightOverhang="3" />
+ <Glyph char="48" source="{X=203,Y=2,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="49" source="{X=218,Y=2,Width=13,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="50" source="{X=233,Y=2,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="51" source="{X=0,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="52" source="{X=15,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="53" source="{X=30,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="54" source="{X=45,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="55" source="{X=60,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="56" source="{X=75,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="57" source="{X=90,Y=30,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="58" source="{X=105,Y=30,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="59" source="{X=114,Y=30,Width=7,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="60" source="{X=123,Y=30,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="61" source="{X=142,Y=30,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="62" source="{X=161,Y=30,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="63" source="{X=180,Y=30,Width=11,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="64" source="{X=193,Y=30,Width=20,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="65" source="{X=215,Y=30,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="66" source="{X=231,Y=30,Width=14,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="67" source="{X=0,Y=58,Width=14,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="68" source="{X=16,Y=58,Width=16,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="69" source="{X=34,Y=58,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="70" source="{X=49,Y=58,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="71" source="{X=63,Y=58,Width=16,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="72" source="{X=81,Y=58,Width=15,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="73" source="{X=98,Y=58,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="74" source="{X=107,Y=58,Width=9,Height=25}" leftOverhang="1" rightOverhang="2" />
+ <Glyph char="75" source="{X=118,Y=58,Width=15,Height=25}" leftOverhang="-1" rightOverhang="4" />
+ <Glyph char="76" source="{X=135,Y=58,Width=12,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="77" source="{X=149,Y=58,Width=17,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="78" source="{X=168,Y=58,Width=15,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="79" source="{X=185,Y=58,Width=16,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="80" source="{X=203,Y=58,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="81" source="{X=218,Y=58,Width=16,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="82" source="{X=236,Y=58,Width=14,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="83" source="{X=0,Y=86,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="84" source="{X=15,Y=86,Width=13,Height=25}" rightOverhang="1" />
+ <Glyph char="85" source="{X=30,Y=86,Width=15,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="86" source="{X=47,Y=86,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="87" source="{X=63,Y=86,Width=21,Height=25}" rightOverhang="1" />
+ <Glyph char="88" source="{X=86,Y=86,Width=15,Height=25}" rightOverhang="1" />
+ <Glyph char="89" source="{X=103,Y=86,Width=13,Height=25}" rightOverhang="1" />
+ <Glyph char="90" source="{X=118,Y=86,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="91" source="{X=134,Y=86,Width=8,Height=25}" rightOverhang="1" />
+ <Glyph char="92" source="{X=144,Y=86,Width=9,Height=25}" rightOverhang="3" />
+ <Glyph char="93" source="{X=155,Y=86,Width=8,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="94" source="{X=165,Y=86,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="95" source="{X=184,Y=86,Width=13,Height=25}" leftOverhang="1" rightOverhang="2" />
+ <Glyph char="96" source="{X=199,Y=86,Width=11,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="97" source="{X=212,Y=86,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="98" source="{X=226,Y=86,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="99" source="{X=240,Y=86,Width=12,Height=25}" leftOverhang="-1" rightOverhang="4" />
+ <Glyph char="100" source="{X=0,Y=114,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="101" source="{X=14,Y=114,Width=14,Height=25}" leftOverhang="-1" rightOverhang="4" />
+ <Glyph char="102" source="{X=30,Y=114,Width=12,Height=25}" leftOverhang="1" rightOverhang="6" />
+ <Glyph char="103" source="{X=44,Y=114,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="104" source="{X=58,Y=114,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="105" source="{X=73,Y=114,Width=6,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="106" source="{X=81,Y=114,Width=8,Height=25}" leftOverhang="1" rightOverhang="2" />
+ <Glyph char="107" source="{X=91,Y=114,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="108" source="{X=105,Y=114,Width=6,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="109" source="{X=113,Y=114,Width=18,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="110" source="{X=133,Y=114,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="111" source="{X=148,Y=114,Width=14,Height=25}" leftOverhang="-1" rightOverhang="4" />
+ <Glyph char="112" source="{X=164,Y=114,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="113" source="{X=178,Y=114,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="114" source="{X=192,Y=114,Width=9,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="115" source="{X=203,Y=114,Width=10,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="116" source="{X=215,Y=114,Width=9,Height=25}" rightOverhang="1" />
+ <Glyph char="117" source="{X=226,Y=114,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="118" source="{X=241,Y=114,Width=12,Height=25}" rightOverhang="1" />
+ <Glyph char="119" source="{X=0,Y=142,Width=18,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="120" source="{X=20,Y=142,Width=12,Height=25}" rightOverhang="1" />
+ <Glyph char="121" source="{X=34,Y=142,Width=12,Height=25}" rightOverhang="1" />
+ <Glyph char="122" source="{X=48,Y=142,Width=12,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="123" source="{X=62,Y=142,Width=13,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="124" source="{X=77,Y=142,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="125" source="{X=86,Y=142,Width=13,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="126" source="{X=101,Y=142,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="161" source="{X=120,Y=142,Width=9,Height=25}" leftOverhang="-4" rightOverhang="5" />
+ <Glyph char="162" source="{X=131,Y=142,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="163" source="{X=146,Y=142,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="164" source="{X=161,Y=142,Width=13,Height=25}" rightOverhang="1" />
+ <Glyph char="165" source="{X=176,Y=142,Width=13,Height=25}" rightOverhang="1" />
+ <Glyph char="166" source="{X=191,Y=142,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="167" source="{X=200,Y=142,Width=11,Height=25}" rightOverhang="1" />
+ <Glyph char="168" source="{X=213,Y=142,Width=11,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="169" source="{X=226,Y=142,Width=20,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="170" source="{X=0,Y=170,Width=10,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="171" source="{X=12,Y=170,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="172" source="{X=27,Y=170,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="173" source="{X=46,Y=170,Width=8,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="174" source="{X=56,Y=170,Width=20,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="175" source="{X=78,Y=170,Width=11,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="176" source="{X=91,Y=170,Width=11,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="177" source="{X=104,Y=170,Width=17,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="178" source="{X=123,Y=170,Width=9,Height=25}" rightOverhang="1" />
+ <Glyph char="179" source="{X=134,Y=170,Width=9,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="180" source="{X=145,Y=170,Width=11,Height=25}" leftOverhang="-3" rightOverhang="4" />
+ <Glyph char="181" source="{X=158,Y=170,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="182" source="{X=173,Y=170,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="183" source="{X=188,Y=170,Width=7,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="184" source="{X=197,Y=170,Width=11,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="185" source="{X=210,Y=170,Width=9,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="186" source="{X=221,Y=170,Width=10,Height=25}" rightOverhang="1" />
+ <Glyph char="187" source="{X=233,Y=170,Width=13,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="188" source="{X=0,Y=198,Width=19,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="189" source="{X=21,Y=198,Width=19,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="190" source="{X=42,Y=198,Width=19,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="191" source="{X=63,Y=198,Width=11,Height=25}" leftOverhang="-2" rightOverhang="3" />
+ <Glyph char="192" source="{X=76,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="193" source="{X=92,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="194" source="{X=108,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="195" source="{X=124,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="196" source="{X=140,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="197" source="{X=156,Y=198,Width=14,Height=25}" rightOverhang="1" />
+ <Glyph char="198" source="{X=172,Y=198,Width=19,Height=25}" rightOverhang="1" />
+ <Glyph char="199" source="{X=193,Y=198,Width=14,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="200" source="{X=209,Y=198,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="201" source="{X=224,Y=198,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="202" source="{X=239,Y=198,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="203" source="{X=0,Y=226,Width=13,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="204" source="{X=15,Y=226,Width=7,Height=25}" rightOverhang="1" />
+ <Glyph char="205" source="{X=24,Y=226,Width=7,Height=25}" leftOverhang="-1" rightOverhang="2" />
+ <Glyph char="206" source="{X=33,Y=226,Width=7,Height=25}" rightOverhang="1" />
+ <Glyph char="207" source="{X=42,Y=226,Width=9,Height=25}" rightOverhang="3" />
+ <Glyph char="208" source="{X=53,Y=226,Width=16,Heigh...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-03 00:59:13
|
Revision: 1504
http://sourceforge.net/p/agate/code/1504
Author: kanato
Date: 2014-09-03 00:59:05 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
Fix construction of objects during XLE serialization.
Fixed exception in NamedColorStaticProperty method.
Modified Paths:
--------------
trunk/AgateLib/Algorithms/PathFinding/AStar.cs
trunk/AgateLib/DisplayLib/Font.cs
trunk/AgateLib/Geometry/Color.cs
trunk/AgateLib/Platform/PlatformSerialization.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs
Added Paths:
-----------
trunk/AgateLib.Tests/UnitTests/Geometry/
trunk/AgateLib.Tests/UnitTests/Geometry/ColorTests.cs
Modified: trunk/AgateLib/Algorithms/PathFinding/AStar.cs
===================================================================
--- trunk/AgateLib/Algorithms/PathFinding/AStar.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib/Algorithms/PathFinding/AStar.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -77,17 +77,19 @@
/// task.CompletedCallBack is ignored.
/// </summary>
/// <param name="task"></param>
- public void FindPathSync(AStarState<T> task)
+ public void FindPathSync(AStarState<T> state)
{
try
{
- task.SearchingPath = true;
+ state.SearchingPath = true;
- FindPath(task).RunSynchronously();
+ var task = FindPath(state);
+
+ task.Wait();
}
finally
{
- task.SearchingPath = false;
+ state.SearchingPath = false;
}
}
Modified: trunk/AgateLib/DisplayLib/Font.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Font.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib/DisplayLib/Font.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -189,10 +189,14 @@
{
FontSurface.DrawText(x, y, text, Parameters);
}
- public void DrawTest(double x, double y, string text)
+ public void DrawText(double x, double y, string text)
{
FontSurface.DrawText(x, y, text);
}
+ public void DrawText(PointF dest, string text)
+ {
+ FontSurface.DrawText(dest, text);
+ }
public Size MeasureString(string text)
{
Modified: trunk/AgateLib/Geometry/Color.cs
===================================================================
--- trunk/AgateLib/Geometry/Color.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib/Geometry/Color.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -602,7 +602,9 @@
static System.Reflection.PropertyInfo NamedColorStaticProperty(string name)
{
- var retval = typeof(Color).GetTypeInfo().DeclaredProperties.First(
+ var colorType = typeof(Color).GetTypeInfo();
+
+ var retval = colorType.DeclaredProperties.FirstOrDefault(
x => x.PropertyType == typeof(Color) &&
x.GetMethod.IsStatic && x.GetMethod.IsPublic &&
x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
Modified: trunk/AgateLib/Platform/PlatformSerialization.cs
===================================================================
--- trunk/AgateLib/Platform/PlatformSerialization.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib/Platform/PlatformSerialization.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
namespace AgateLib.Platform.Common.PlatformImplementation
@@ -10,7 +11,19 @@
{
public object CreateInstance(Type t)
{
- return Activator.CreateInstance(t, true);
+ var typeinfo = t.GetTypeInfo();
+
+ foreach(var constructor in typeinfo.DeclaredConstructors)
+ {
+ if (constructor.IsStatic) continue;
+ if (constructor.IsAbstract) continue;
+ if (constructor.GetParameters().Length == 0)
+ {
+ return constructor.Invoke(null);
+ }
+ }
+
+ throw new InvalidOperationException("Could not find constructor for " + typeinfo.Name);
}
}
}
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -1,5 +1,6 @@
using AgateLib.DisplayLib;
using AgateLib.Geometry;
+using AgateLib.Geometry.CoordinateSystems;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,14 +13,13 @@
{
public FakeRenderTarget()
{
- CoordinateSystem = new Rectangle(0, 0, 640, 400);
+ CoordinateSystem = new NativeCoordinates();
}
public int Height { get { return 400; } }
public int Width { get { return 640; } }
public Size Size { get { return new Size(Width, Height); } }
- public Rectangle CoordinateSystem { get; set; }
- ICoordinateSystemCreator IFrameBuffer.CoordinateSystem { get; set; }
+ public ICoordinateSystemCreator CoordinateSystem { get;set;}
}
}
Modified: trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
===================================================================
--- trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-09-03 00:59:05 UTC (rev 1504)
@@ -100,6 +100,7 @@
<Compile Include="Display\DisplayWindowTest.cs" />
<Compile Include="Display\FontTests.cs" />
<Compile Include="Extensions\ListExtensions.cs" />
+ <Compile Include="Geometry\ColorTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Platform\PlatformTests.cs" />
<Compile Include="Resources\SerializationTest.cs" />
Added: trunk/AgateLib.Tests/UnitTests/Geometry/ColorTests.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/Geometry/ColorTests.cs (rev 0)
+++ trunk/AgateLib.Tests/UnitTests/Geometry/ColorTests.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -0,0 +1,38 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Geometry
+{
+ [TestClass]
+ public class ColorTests
+ {
+ [TestMethod]
+ public void NamedColors()
+ {
+ Assert.IsTrue(Color.IsNamedColor("Red"));
+ Assert.IsTrue(Color.IsNamedColor("Green"));
+ Assert.IsTrue(Color.IsNamedColor("Blue"));
+ Assert.IsFalse(Color.IsNamedColor("Atari"));
+
+ Assert.AreEqual(Color.FromArgb(255, 255, 0, 0), Color.Red);
+ }
+
+ [TestMethod]
+ public void ColorValues()
+ {
+ Color test = Color.FromArgb(0x22, 0x33, 0x44, 0x55);
+
+ Assert.AreEqual(0x22, test.A);
+ Assert.AreEqual(0x33, test.R);
+ Assert.AreEqual(0x44, test.G);
+ Assert.AreEqual(0x55, test.B);
+
+ Assert.AreEqual(0x22334455, test.ToArgb());
+ Assert.AreEqual(0x22554433, test.ToAbgr());
+ }
+ }
+}
Modified: trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs 2014-09-02 15:36:05 UTC (rev 1503)
+++ trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs 2014-09-03 00:59:05 UTC (rev 1504)
@@ -38,10 +38,10 @@
FontSurface.FromImpl(new FakeFontSurface { Height = 8 }));
ff.AddFont(new FontSettings(10, FontStyles.None),
- FontSurface.FromImpl(new FakeFontSurface { Height = 8 }));
+ FontSurface.FromImpl(new FakeFontSurface { Height = 10 }));
ff.AddFont(new FontSettings(10, FontStyles.Bold),
- FontSurface.FromImpl(new FakeFontSurface { Height = 8 }));
+ FontSurface.FromImpl(new FakeFontSurface { Height = 10 }));
CssDocument doc = CssDocument.FromText(
"window { layout: column; margin: 6px; padding: 8px;} label { margin-left: 4px; } " +
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-03 02:44:36
|
Revision: 1507
http://sourceforge.net/p/agate/code/1507
Author: kanato
Date: 2014-09-03 02:44:28 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
Minor fixes.
Modified Paths:
--------------
trunk/AgateLib/IO/SubDirectoryProvider.cs
trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
trunk/AgateLib.OpenGL/GL3/Shaders/ShaderSources.Designer.cs
trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
Modified: trunk/AgateLib/IO/SubDirectoryProvider.cs
===================================================================
--- trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-09-03 01:28:46 UTC (rev 1506)
+++ trunk/AgateLib/IO/SubDirectoryProvider.cs 2014-09-03 02:44:28 UTC (rev 1507)
@@ -41,11 +41,16 @@
public override string ToString()
{
- return parent.ToString() + subdir;
+ return System.IO.Path.Combine(parent.ToString(), subdir);
}
public async Task<System.IO.Stream> OpenReadAsync(string filename)
{
- return await parent.OpenReadAsync(subdir + filename);
+ if (System.IO.Path.IsPathRooted(filename) == false)
+ {
+ return await parent.OpenReadAsync(subdir + filename);
+ }
+ else
+ return await parent.OpenReadAsync(filename);
}
public bool FileExists(string filename)
Modified: trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj
===================================================================
--- trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj 2014-09-03 01:28:46 UTC (rev 1506)
+++ trunk/AgateLib.OpenGL/AgateLib.OpenGL.csproj 2014-09-03 02:44:28 UTC (rev 1507)
@@ -7,8 +7,8 @@
<ProjectGuid>{94734E5A-0344-43E8-BB30-E32E3F57F611}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>AgateLib.GL</RootNamespace>
- <AssemblyName>AgateLib.GL</AssemblyName>
+ <RootNamespace>AgateLib.OpenGL</RootNamespace>
+ <AssemblyName>AgateLib.OpenGL</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
Modified: trunk/AgateLib.OpenGL/GL3/Shaders/ShaderSources.Designer.cs
===================================================================
--- trunk/AgateLib.OpenGL/GL3/Shaders/ShaderSources.Designer.cs 2014-09-03 01:28:46 UTC (rev 1506)
+++ trunk/AgateLib.OpenGL/GL3/Shaders/ShaderSources.Designer.cs 2014-09-03 02:44:28 UTC (rev 1507)
@@ -39,7 +39,7 @@
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AgateLib.GL.GL3.Shaders.ShaderSources", typeof(ShaderSources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AgateLib.OpenGL.GL3.Shaders.ShaderSources", typeof(ShaderSources).Assembly);
resourceMan = temp;
}
return resourceMan;
Modified: trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-09-03 01:28:46 UTC (rev 1506)
+++ trunk/AgateLib.Platform.WinForms/Data/AgateDatabase.cs 2014-09-03 02:44:28 UTC (rev 1507)
@@ -39,7 +39,7 @@
/// There is no SQL query engine, however LINQ should be adequate
/// for any query needs.
/// </remarks>
- public class AgateDatabase : IDisposable , IXleSerializable
+ public class AgateDatabase : IDisposable, IXleSerializable
{
private AgateTableDictionary mTables;
@@ -57,7 +57,7 @@
/// <returns></returns>
public static AgateDatabase FromFile(string filename)
{
- AgateDatabase db = ReadDatabase(new AgateLib.Platform.WinForms.IO.ZipFileProvider(filename)).Result;
+ AgateDatabase db = ReadDatabase(new AgateLib.Platform.WinForms.IO.ZipFileProvider(AgateLib.IO.FileProvider.Assets.ResolveFile(filename))).Result;
db.mTables.OwnFileProvider = true;
return db;
@@ -186,7 +186,7 @@
foreach (var table in mTables)
{
-
+
try
{
table.Validate();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-03 06:08:51
|
Revision: 1508
http://sourceforge.net/p/agate/code/1508
Author: kanato
Date: 2014-09-03 06:08:28 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
Refactor coordinate systems a little.
Fix examples so they compile now.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/ApplicationModels/ModelParameters.cs
trunk/AgateLib/ApplicationModels/SceneAppModelBase.cs
trunk/AgateLib/ApplicationModels/SceneModelParameters.cs
trunk/AgateLib/Diagnostics/AgateConsole.cs
trunk/AgateLib/DisplayLib/CreateWindowParams.cs
trunk/AgateLib/DisplayLib/Display.cs
trunk/AgateLib/DisplayLib/DisplayWindow.cs
trunk/AgateLib/DisplayLib/Font.cs
trunk/AgateLib/DisplayLib/FrameBuffer.cs
trunk/AgateLib/DisplayLib/IFrameBuffer.cs
trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs
trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs
trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs
trunk/AgateLib/Geometry/CoordinateSystems/FixedCoordinateSystem.cs
trunk/AgateLib/Geometry/CoordinateSystems/NativeCoordinates.cs
trunk/AgateLib/Geometry/ICoordinateSystemCreator.cs
trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
trunk/AgateLib.OpenGL/ContextFB.cs
trunk/AgateLib.OpenGL/GL_FrameBuffer.cs
trunk/AgateLib.OpenGL/Legacy/LegacyDrawBuffer.cs
trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModel.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs
trunk/Examples/BallBuster.Net/BallBuster.Net.csproj
trunk/Examples/BallBuster.Net/CImage.cs
trunk/Examples/BallBuster.Net/Program.cs
trunk/Examples/BallBuster.Net/main.cs
trunk/Examples/ExampleUnitTests/ExampleUnitTests.csproj
trunk/Examples/Pong/Pong.cs
trunk/Examples/Pong/Pong.csproj
trunk/Examples/ShootTheTraps/App.cs
trunk/Examples/ShootTheTraps/ShootTheTraps.csproj
trunk/Examples.sln
Added Paths:
-----------
trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-03 06:08:28 UTC (rev 1508)
@@ -63,6 +63,7 @@
<Compile Include="DisplayLib\FontStyles.cs" />
<Compile Include="Drivers\NullDrivers\NullInputFactory.cs" />
<Compile Include="Drivers\NullDrivers\NullSoundFactory.cs" />
+ <Compile Include="Geometry\CoordinateSystems\SingleFixedDimension.cs" />
<Compile Include="Mathematics\MathHelper.cs" />
<Compile Include="Algorithms\PathFinding\IAStarMap.cs" />
<Compile Include="Algorithms\Pair.cs" />
Modified: trunk/AgateLib/ApplicationModels/ModelParameters.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/ModelParameters.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/ApplicationModels/ModelParameters.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -100,7 +100,7 @@
/// system for the automatically created display window. If
/// AutoCreateDisplayWindow is false, this property is not used.
/// </summary>
- public ICoordinateSystemCreator CoordinateSystem { get; set; }
+ public ICoordinateSystem CoordinateSystem { get; set; }
/// <summary>
/// Indicates the device type to emulate. This primarily affects the built-in user interface
Modified: trunk/AgateLib/ApplicationModels/SceneAppModelBase.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/SceneAppModelBase.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/ApplicationModels/SceneAppModelBase.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -26,12 +26,8 @@
BeginModel();
}
- finally
- {
- //DisposeAutoCreatedWindow();
-
- //Dispose();
- }
+ catch (ExitGameException)
+ { }
}
protected abstract void BeginModel();
Modified: trunk/AgateLib/ApplicationModels/SceneModelParameters.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/SceneModelParameters.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/ApplicationModels/SceneModelParameters.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -7,5 +7,18 @@
{
public class SceneModelParameters : ModelParameters
{
+ /// <summary>
+ /// Constructs a SceneModelParameters object with default parameters.
+ /// </summary>
+ public SceneModelParameters()
+ { }
+ /// <summary>
+ /// Constructs a SceneModelParameters object with default parameters.
+ /// Also stores the command line arguments.
+ /// </summary>
+ /// <param name="args"></param>
+ public SceneModelParameters(string[] args)
+ : base(args)
+ { }
}
}
Modified: trunk/AgateLib/Diagnostics/AgateConsole.cs
===================================================================
--- trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -261,7 +261,7 @@
IsVisible = !IsVisible;
args.Handled = true;
- sInstance.mHeight = Display.CoordinateSystem.Height * 5 / 12;
+ sInstance.mHeight = Display.Coordinates.Height * 5 / 12;
}
else if (IsVisible)
{
Modified: trunk/AgateLib/DisplayLib/CreateWindowParams.cs
===================================================================
--- trunk/AgateLib/DisplayLib/CreateWindowParams.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/CreateWindowParams.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -219,7 +219,7 @@
/// The object which will be used to set the coordinate system for the window
/// at the beginning of each frame.
/// </summary>
- public ICoordinateSystemCreator Coordinates { get; set; }
+ public ICoordinateSystem Coordinates { get; set; }
#endregion
@@ -231,7 +231,7 @@
/// <param name="control"></param>
/// <param name="coordinates">Coordinate system creator object. May be null</param>
/// <returns></returns>
- public static CreateWindowParams FromControl(object control, ICoordinateSystemCreator coordinates)
+ public static CreateWindowParams FromControl(object control, ICoordinateSystem coordinates)
{
CreateWindowParams retval = new CreateWindowParams();
@@ -251,7 +251,7 @@
/// <param name="bpp"></param>
/// <param name="coordinates">Coordinate system creator object. May be null</param>
/// <returns></returns>
- public static CreateWindowParams FullScreen(string title, int width, int height, int bpp, ICoordinateSystemCreator coordinates)
+ public static CreateWindowParams FullScreen(string title, int width, int height, int bpp, ICoordinateSystem coordinates)
{
CreateWindowParams retval = new CreateWindowParams();
@@ -274,7 +274,7 @@
/// <param name="allowResize"></param>
/// <param name="coordinates">Coordinate system creator object. May be null</param>
/// <returns></returns>
- public static CreateWindowParams Windowed(string title, int width, int height, bool allowResize, string iconFile, ICoordinateSystemCreator coordinates)
+ public static CreateWindowParams Windowed(string title, int width, int height, bool allowResize, string iconFile, ICoordinateSystem coordinates)
{
CreateWindowParams retval = new CreateWindowParams();
@@ -298,7 +298,7 @@
/// <param name="height"></param>
/// <param name="coordinates">Coordinate system creator object. May be null</param>
/// <returns></returns>
- public static CreateWindowParams NoFrame(string title, int width, int height, ICoordinateSystemCreator coordinates)
+ public static CreateWindowParams NoFrame(string title, int width, int height, ICoordinateSystem coordinates)
{
CreateWindowParams retval = new CreateWindowParams();
Modified: trunk/AgateLib/DisplayLib/Display.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Display.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/Display.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -192,9 +192,9 @@
/// <summary>
/// Gets the coordinate system for the current render target.
/// </summary>
- public static Rectangle CoordinateSystem
+ public static Rectangle Coordinates
{
- get { return RenderTarget.CoordinateSystem.DetermineCoordinateSystem(RenderTarget.Size); }
+ get { return RenderTarget.CoordinateSystem.Coordinates; }
}
/// <summary>
@@ -288,8 +288,8 @@
sImpl.BeginFrame();
- AgateBuiltInShaders.Basic2DShader.CoordinateSystem =
- RenderTarget.CoordinateSystem.DetermineCoordinateSystem(RenderTarget.Size);
+ RenderTarget.CoordinateSystem.RenderTargetSize = RenderTarget.Size;
+ AgateBuiltInShaders.Basic2DShader.CoordinateSystem = RenderTarget.CoordinateSystem.Coordinates;
AgateBuiltInShaders.Basic2DShader.Activate();
sCurrentClipRect = new Rectangle(Point.Empty, RenderTarget.Size);
Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs
===================================================================
--- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -39,7 +39,7 @@
{
DisplayWindowImpl mImpl;
FrameBuffer mFrameBuffer;
- ICoordinateSystemCreator mCoordinates;
+ ICoordinateSystem mCoordinates;
/// <summary>
/// Constructs a DisplayWindow from a resource.
@@ -54,7 +54,6 @@
if (disp == null)
throw new Resources.AgateResourceException("Resource " + name + " was found, but was of type " + name.GetType().ToString() + ", not DisplayWindowResource.");
-
if (disp.FullScreen)
{
CreateWindowParams par = CreateWindowParams.FullScreen(
@@ -92,6 +91,9 @@
// TODO: Fix this hack
Display.CurrentWindow = this;
+
+ mCoordinates = windowParams.Coordinates;
+ mCoordinates.RenderTargetSize = Size;
}
#region --- Static Creation Methods ---
@@ -105,7 +107,7 @@
/// new DisplayWindow(CreateWindowParams.FromControl(control)).</remarks>
/// <param name="control">Windows.Forms control which should be used as the
/// render target.</param>
- public static DisplayWindow CreateFromControl(object control, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateFromControl(object control, ICoordinateSystem coordinates = null)
{
return new DisplayWindow(CreateWindowParams.FromControl(control, coordinates));
}
@@ -117,7 +119,7 @@
/// <param name="width"></param>
/// <param name="height"></param>
/// <returns></returns>
- public static DisplayWindow CreateFullScreen(string title, Size size, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateFullScreen(string title, Size size, ICoordinateSystem coordinates = null)
{
return new DisplayWindow(CreateWindowParams.FullScreen(title, size.Width, size.Height, 32, coordinates));
}
@@ -129,7 +131,7 @@
/// <param name="width"></param>
/// <param name="height"></param>
/// <returns></returns>
- public static DisplayWindow CreateFullScreen(string title, int width, int height, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateFullScreen(string title, int width, int height, ICoordinateSystem coordinates = null)
{
return new DisplayWindow(CreateWindowParams.FullScreen(title, width, height, 32, null));
}
@@ -140,7 +142,7 @@
/// <param name="title"></param>
/// <param name="size"></param>
/// <returns></returns>
- public static DisplayWindow CreateWindowed(string title, Size size, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateWindowed(string title, Size size, ICoordinateSystem coordinates = null)
{
return DisplayWindow.CreateWindowed(title, size.Width, size.Height, false, null, coordinates);
}
@@ -153,7 +155,7 @@
/// <param name="iconFile"></param>
/// <param name="allowResize"></param>
/// <returns></returns>
- public static DisplayWindow CreateWindowed(string title, int width, int height, bool allowResize = false, string iconFile = null, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateWindowed(string title, int width, int height, bool allowResize = false, string iconFile = null, ICoordinateSystem coordinates = null)
{
return new DisplayWindow(CreateWindowParams.Windowed(title, width, height, allowResize, iconFile, null));
}
@@ -165,7 +167,7 @@
/// <param name="width"></param>
/// <param name="height"></param>
/// <returns></returns>
- public static DisplayWindow CreateNoFrame(string title, int width, int height, ICoordinateSystemCreator coordinates = null)
+ public static DisplayWindow CreateNoFrame(string title, int width, int height, ICoordinateSystem coordinates = null)
{
return new DisplayWindow(CreateWindowParams.NoFrame(title, width, height, null));
}
Modified: trunk/AgateLib/DisplayLib/Font.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Font.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/Font.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -153,6 +153,12 @@
}
+
+ public double Alpha
+ {
+ get { return mState.Alpha; }
+ set { mState.Alpha = value; }
+ }
public Color Color
{
get { return mState.Color; }
Modified: trunk/AgateLib/DisplayLib/FrameBuffer.cs
===================================================================
--- trunk/AgateLib/DisplayLib/FrameBuffer.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/FrameBuffer.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -159,7 +159,7 @@
/// framebuffer as a render target, this coordinate system is automatically
/// loaded.
/// </summary>
- public ICoordinateSystemCreator CoordinateSystem
+ public ICoordinateSystem CoordinateSystem
{
get { return Impl.CoordinateSystem; }
set { Impl.CoordinateSystem = value; }
Modified: trunk/AgateLib/DisplayLib/IFrameBuffer.cs
===================================================================
--- trunk/AgateLib/DisplayLib/IFrameBuffer.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/IFrameBuffer.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -26,6 +26,6 @@
/// <summary>
/// Gets or sets the coordinate system for the render target.
/// </summary>
- ICoordinateSystemCreator CoordinateSystem { get; set; }
+ ICoordinateSystem CoordinateSystem { get; set; }
}
}
Modified: trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs
===================================================================
--- trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -149,7 +149,7 @@
/// <returns></returns>
public Point PixelToLogicalCoords(Point point)
{
- var coords = FrameBuffer.CoordinateSystem.DetermineCoordinateSystem(FrameBuffer.Size);
+ var coords = FrameBuffer.CoordinateSystem.Coordinates;
double x = point.X / (double)Width;
double y = point.Y / (double)Height;
@@ -170,7 +170,7 @@
/// <returns></returns>
public Point LogicalToPixelCoords(Point point)
{
- var coords = FrameBuffer.CoordinateSystem.DetermineCoordinateSystem(FrameBuffer.Size);
+ var coords = FrameBuffer.CoordinateSystem.Coordinates;
point.X -= coords.X;
point.Y -= coords.Y;
Modified: trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs
===================================================================
--- trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -30,7 +30,7 @@
/// </summary>
public abstract class FrameBufferImpl : IDisposable
{
- public FrameBufferImpl(ICoordinateSystemCreator coords)
+ public FrameBufferImpl(ICoordinateSystem coords)
{
this.CoordinateSystem = coords;
}
@@ -97,6 +97,6 @@
/// <summary>
/// Gets or sets the coordinate system that is used to map 2d coordinates to pixels in the render target.
/// </summary>
- public virtual ICoordinateSystemCreator CoordinateSystem { get; set; }
+ public virtual ICoordinateSystem CoordinateSystem { get; set; }
}
}
Modified: trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -30,7 +30,7 @@
/// ratio of the display, providing extra space outside the requested render area
/// which the application must fill in somehow.
/// </summary>
- public class FixedAspectRatioCoordinates : ICoordinateSystemCreator
+ public class FixedAspectRatioCoordinates : ICoordinateSystem
{
public FixedAspectRatioCoordinates()
{
@@ -38,14 +38,27 @@
AspectRatio = 16 / (double)9;
}
- public Rectangle DetermineCoordinateSystem(Size displayWindowSize)
+ Size mRenderTargetSize;
+
+ public Size RenderTargetSize
{
- var retval = GetUnshiftedRectangle(displayWindowSize);
+ get { return mRenderTargetSize; }
+ set
+ {
+ mRenderTargetSize = value;
+ DetermineCoordinateSystem();
+ }
+ }
+ public Rectangle Coordinates { get; private set; }
+ public void DetermineCoordinateSystem()
+ {
+ var retval = GetUnshiftedRectangle(RenderTargetSize);
+
retval.X += Origin.X;
retval.Y += Origin.Y;
- return retval;
+ Coordinates = retval;
}
private Rectangle GetUnshiftedRectangle(Size displayWindowSize)
@@ -125,5 +138,6 @@
/// the display area.
/// </summary>
public Point Origin { get; set; }
+
}
}
Modified: trunk/AgateLib/Geometry/CoordinateSystems/FixedCoordinateSystem.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/FixedCoordinateSystem.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/Geometry/CoordinateSystems/FixedCoordinateSystem.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -5,18 +5,23 @@
namespace AgateLib.Geometry.CoordinateSystems
{
- public class FixedCoordinateSystem : ICoordinateSystemCreator
+ public class FixedCoordinateSystem : ICoordinateSystem
{
public FixedCoordinateSystem(Rectangle coords)
{
Coordinates = coords;
}
- public Rectangle Coordinates { get; set; }
+ Size mRenderTargetSize;
- public Rectangle DetermineCoordinateSystem(Size displayWindowSize)
+ public Size RenderTargetSize
{
- return Coordinates;
+ get { return mRenderTargetSize; }
+ set
+ {
+ mRenderTargetSize = value;
+ }
}
+ public Rectangle Coordinates { get; set; }
}
}
Modified: trunk/AgateLib/Geometry/CoordinateSystems/NativeCoordinates.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/NativeCoordinates.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/Geometry/CoordinateSystems/NativeCoordinates.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -28,11 +28,13 @@
/// Constructs a coordinate system which matches the pixels coordinates of the display window,
/// up to an optional maximum height and width.
/// </summary>
- public class NativeCoordinates : ICoordinateSystemCreator
+ public class NativeCoordinates : ICoordinateSystem
{
- public Rectangle DetermineCoordinateSystem(Size displayWindowSize)
+ Size mRenderTargetSize;
+
+ void DetermineCoordinateSystem()
{
- Rectangle retval = new Rectangle(Point.Empty, displayWindowSize);
+ Rectangle retval = new Rectangle(Point.Empty, mRenderTargetSize);
if (MaxSize != null)
{
@@ -40,9 +42,24 @@
retval.Height = Math.Min(retval.Height, MaxSize.Value.Height);
}
- return retval;
+ Coordinates = retval;
}
public Size? MaxSize { get; set; }
+
+ public Size RenderTargetSize
+ {
+ get
+ {
+ return mRenderTargetSize;
+ }
+ set
+ {
+ mRenderTargetSize = value;
+ DetermineCoordinateSystem();
+ }
+ }
+
+ public Rectangle Coordinates { get; private set;}
}
}
Added: trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs (rev 0)
+++ trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Geometry.CoordinateSystems
+{
+ public class SingleFixedDimension : ICoordinateSystem
+ {
+ Size mRenderTargetSize;
+
+ public SingleFixedDimension()
+ {
+ FixedDimensionValue = 600;
+ }
+
+ public Rectangle Coordinates { get; private set; }
+
+ public Size RenderTargetSize
+ {
+ get { return mRenderTargetSize; }
+ set
+ {
+ mRenderTargetSize = value;
+ DetermineCoordinateSystem();
+ }
+ }
+
+ private void DetermineCoordinateSystem()
+ {
+ if (FixedDimensionValue < 1)
+ throw new InvalidOperationException();
+ }
+
+ /// <summary>
+ /// The value of the fixed dimension.
+ /// </summary>
+ public int FixedDimensionValue { get; set; }
+
+ /// <summary>
+ /// Whether to keep the vertical or horizontal dimension fixed. Defaults to vertical
+ /// </summary>
+ public Dimension FixedDimension { get; set; }
+ }
+
+ public enum Dimension
+ {
+ Vertical,
+ Horizontal,
+ }
+}
Modified: trunk/AgateLib/Geometry/ICoordinateSystemCreator.cs
===================================================================
--- trunk/AgateLib/Geometry/ICoordinateSystemCreator.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/Geometry/ICoordinateSystemCreator.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -27,13 +27,18 @@
/// <summary>
/// Interface for classes which create a coordinate system for a given DisplayWindow size.
/// </summary>
- public interface ICoordinateSystemCreator
+ public interface ICoordinateSystem
{
/// <summary>
- /// Returns the coordinate system given the size of the display window.
+ /// Gets or sets size in pixels of the render target.
/// </summary>
+ Size RenderTargetSize { get; set; }
+ /// <summary>
+ /// Gets the coordinate system given the size of the display window. This is calculated when
+ /// RenderTargetSize is set.
+ /// </summary>
/// <param name="displayWindowSize"></param>
/// <returns></returns>
- Rectangle DetermineCoordinateSystem(Size displayWindowSize);
+ Rectangle Coordinates { get; }
}
}
Modified: trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -38,7 +38,7 @@
}
public void UpdateLayout(Gui gui)
{
- UpdateLayout(gui, Display.CoordinateSystem.Size);
+ UpdateLayout(gui, Display.Coordinates.Size);
}
public void UpdateLayout(Gui gui, Size renderTargetSize)
{
Modified: trunk/AgateLib.OpenGL/ContextFB.cs
===================================================================
--- trunk/AgateLib.OpenGL/ContextFB.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.OpenGL/ContextFB.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -41,7 +41,7 @@
public ContextFB(AgateLib.DisplayLib.DisplayWindow attachedWindow,
GraphicsMode graphicsMode, IWindowInfo window, Size size,
bool depthBuffer, bool stencilBuffer,
- ICoordinateSystemCreator coords)
+ ICoordinateSystem coords)
: base(coords)
{
mGraphicsMode = graphicsMode;
Modified: trunk/AgateLib.OpenGL/GL_FrameBuffer.cs
===================================================================
--- trunk/AgateLib.OpenGL/GL_FrameBuffer.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.OpenGL/GL_FrameBuffer.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -32,7 +32,7 @@
protected bool mHasDepth;
protected bool mHasStencil;
- protected GL_FrameBuffer(ICoordinateSystemCreator coords) : base(coords)
+ protected GL_FrameBuffer(ICoordinateSystem coords) : base(coords)
{
}
Modified: trunk/AgateLib.OpenGL/Legacy/LegacyDrawBuffer.cs
===================================================================
--- trunk/AgateLib.OpenGL/Legacy/LegacyDrawBuffer.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.OpenGL/Legacy/LegacyDrawBuffer.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -230,10 +230,8 @@
mVerts[mIndex + 3].Color = ToAbgr(color.BottomLeft);
mIndex += 4;
-
}
-
private int ToAbgr(Color c)
{
int val = c.A;
Modified: trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModel.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModel.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.Platform.WinForms/ApplicationModels/SceneModel.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -10,7 +10,8 @@
{
public class SceneModel : SceneAppModelBase
{
- public SceneModel(SceneModelParameters parameters) : base(parameters)
+ public SceneModel(SceneModelParameters parameters)
+ : base(parameters)
{ }
public SceneModelParameters Parameters { get { return (SceneModelParameters)base.Parameters; } }
@@ -25,13 +26,22 @@
if (sceneToStartWith != null)
SceneStack.Add(sceneToStartWith);
- while(SceneStack.Count > 0 && QuitModel == false)
+ try
{
- RunSingleFrame();
+ while (SceneStack.Count > 0 && QuitModel == false)
+ {
+ RunSingleFrame();
- if (Display.CurrentWindow.IsClosed)
- throw new ExitGameException();
+ if (Display.CurrentWindow.IsClosed)
+ throw new ExitGameException();
+ }
}
+ finally
+ {
+ DisposeAutoCreatedWindow();
+
+ Dispose();
+ }
}
public override void KeepAlive()
Modified: trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -68,7 +68,7 @@
bool mHasFrame = true;
ContextFB mFrameBuffer;
- ICoordinateSystemCreator mCoords;
+ ICoordinateSystem mCoords;
public override FrameBufferImpl FrameBuffer
{
@@ -232,7 +232,7 @@
return newMode;
}
- private void CreateFrameBuffer(ICoordinateSystemCreator coords)
+ private void CreateFrameBuffer(ICoordinateSystem coords)
{
var old = mFrameBuffer;
Modified: trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -212,7 +212,7 @@
mDrawBuffer = mDisplay.CreateDrawBuffer();
}
- private void CreateFrameBuffer(ICoordinateSystemCreator coords)
+ private void CreateFrameBuffer(ICoordinateSystem coords)
{
mFrameBuffer = new ContextFB(mOwner,
mWindow.Context.GraphicsMode, mWindow.WindowInfo,
Modified: trunk/Examples/BallBuster.Net/BallBuster.Net.csproj
===================================================================
--- trunk/Examples/BallBuster.Net/BallBuster.Net.csproj 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/Examples/BallBuster.Net/BallBuster.Net.csproj 2014-09-03 06:08:28 UTC (rev 1508)
@@ -82,6 +82,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
+ <UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>out\</OutputPath>
@@ -157,9 +158,17 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\AgateLib.Platform.WindowsForms\AgateLib.Platform.WindowsForms.csproj">
+ <ProjectReference Include="..\..\AgateLib.AgateSDL\AgateLib.AgateSDL.csproj">
+ <Project>{935d67a0-931e-46de-9f6a-2d6dbc99aff3}</Project>
+ <Name>AgateLib.AgateSDL</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.OpenGL\AgateLib.OpenGL.csproj">
+ <Project>{94734e5a-0344-43e8-bb30-e32e3f57f611}</Project>
+ <Name>AgateLib.OpenGL</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\AgateLib.Platform.WinForms\AgateLib.Platform.WinForms.csproj">
<Project>{4b12561e-d37b-48a1-b6db-218e94906c22}</Project>
- <Name>AgateLib.Platform.WindowsForms</Name>
+ <Name>AgateLib.Platform.WinForms</Name>
</ProjectReference>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
<Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project>
Modified: trunk/Examples/BallBuster.Net/CImage.cs
===================================================================
--- trunk/Examples/BallBuster.Net/CImage.cs 2014-09-03 02:44:28 UTC (rev 1507)
+++ trunk/Examples/BallBuster.Net/CImage.cs 2014-09-03 06:08:28 UTC (rev 1508)
@@ -22,7 +22,6 @@
using AgateLib.Resources.Legacy;
using AgateLib.Sprites;
using AgateLib.DisplayLib;
-using AgateLib.Platform.WindowsForms.Resources;
namespace BallBuster.Net
{
@@ -51,16 +50,13 @@
public Sprite arrow, bblogo, palogo, xlogo;
- public FontSurface font;
- public FontSurface largeFont;
+ public Font font;
//public TextStyler fontStyler;
public void preload()
{
- this.font = BuiltinResources.AgateSans10;
- this.largeFont = ...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-03 06:36:29
|
Revision: 1510
http://sourceforge.net/p/agate/code/1510
Author: kanato
Date: 2014-09-03 06:36:22 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
Fixes to coordinate systems.
Fix shoot the traps.
Modified Paths:
--------------
trunk/AgateLib/DisplayLib/Display.cs
trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs
trunk/Examples/ShootTheTraps/App.cs
trunk/Examples/ShootTheTraps/ShootTheTraps.csproj
trunk/Examples.sln
Modified: trunk/AgateLib/DisplayLib/Display.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Display.cs 2014-09-03 06:16:47 UTC (rev 1509)
+++ trunk/AgateLib/DisplayLib/Display.cs 2014-09-03 06:36:22 UTC (rev 1510)
@@ -185,7 +185,8 @@
sImpl.RenderTarget = value;
if (value.AttachedWindow != null)
- sCurrentWindow = value.AttachedWindow;
+ CurrentWindow = value.AttachedWindow;
+
}
}
@@ -203,7 +204,11 @@
public static DisplayWindow CurrentWindow
{
get { return sCurrentWindow; }
- internal set { sCurrentWindow = value; }
+ internal set
+ {
+ sCurrentWindow = value;
+ sImpl.RenderTarget.CoordinateSystem.RenderTargetSize = sImpl.RenderTarget.Size;
+ }
}
/// <summary>
Modified: trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs 2014-09-03 06:16:47 UTC (rev 1509)
+++ trunk/AgateLib/Geometry/CoordinateSystems/SingleFixedDimension.cs 2014-09-03 06:36:22 UTC (rev 1510)
@@ -12,6 +12,7 @@
public SingleFixedDimension()
{
+ FixedDimension = Dimension.Vertical;
FixedDimensionValue = 600;
}
@@ -31,8 +32,44 @@
{
if (FixedDimensionValue < 1)
throw new InvalidOperationException();
+
+ switch (FixedDimension)
+ {
+ case Dimension.Vertical:
+ case Dimension.Horizontal:
+ SetRect(FixedDimension);
+ break;
+
+ case Dimension.Smaller:
+ if (RenderTargetSize.AspectRatio >= 1)
+ SetRect(Dimension.Vertical);
+ else
+ SetRect(Dimension.Horizontal);
+ break;
+
+ case Dimension.Larger:
+ if (RenderTargetSize.AspectRatio >= 1)
+ SetRect(Dimension.Horizontal);
+ else
+ SetRect(Dimension.Vertical);
+ break;
+ }
}
+ private void SetRect(Dimension dimension)
+ {
+ switch (dimension)
+ {
+ case Dimension.Vertical:
+ Coordinates = new Rectangle(0, 0, (int)(FixedDimensionValue * RenderTargetSize.AspectRatio), FixedDimensionValue);
+ break;
+
+ case Dimension.Horizontal:
+ Coordinates = new Rectangle(0, 0, FixedDimensionValue, (int)(FixedDimensionValue / RenderTargetSize.AspectRatio));
+ break;
+ }
+ }
+
/// <summary>
/// The value of the fixed dimension.
/// </summary>
@@ -44,9 +81,14 @@
public Dimension FixedDimension { get; set; }
}
+ /// <summary>
+ /// Indicates a dimension which will be fixed.
+ /// </summary>
public enum Dimension
{
Vertical,
Horizontal,
+ Smaller,
+ Larger,
}
}
Modified: trunk/Examples/ShootTheTraps/App.cs
===================================================================
--- trunk/Examples/ShootTheTraps/App.cs 2014-09-03 06:16:47 UTC (rev 1509)
+++ trunk/Examples/ShootTheTraps/App.cs 2014-09-03 06:36:22 UTC (rev 1510)
@@ -22,10 +22,11 @@
static void Main(string[] args)
{
SceneModelParameters p = new SceneModelParameters(args);
+
p.ApplicationName = "Shoot the Traps";
p.CoordinateSystem = new AgateLib.Geometry.CoordinateSystems.SingleFixedDimension();
+
SceneModel model = new SceneModel(p);
-
model.Run(new App());
}
@@ -105,10 +106,10 @@
// center introduction text
Point textPt = new Point((Display.Coordinates.Width - largestWidth) / 2, 20);
Rectangle boxArea = new Rectangle(
- textPt.X - 10,
+ textPt.X - 10,
textPt.Y - 10,
largestWidth + 20,
- (mIntroLines.Length +1) * font.FontHeight + 20);
+ (mIntroLines.Length + 1) * font.FontHeight + 20);
Display.FillRect(boxArea, Color.FromArgb(196, Color.Black));
@@ -123,8 +124,6 @@
textPt.Y += font.FontHeight;
}
-
- Display.FillRect(0, 0, 320, 240, Color.FromArgb(128, 128, 0, 0));
}
#endregion
Modified: trunk/Examples/ShootTheTraps/ShootTheTraps.csproj
===================================================================
--- trunk/Examples/ShootTheTraps/ShootTheTraps.csproj 2014-09-03 06:16:47 UTC (rev 1509)
+++ trunk/Examples/ShootTheTraps/ShootTheTraps.csproj 2014-09-03 06:36:22 UTC (rev 1510)
@@ -113,7 +113,7 @@
<Name>AgateLib.Platform.WinForms</Name>
</ProjectReference>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
- <Project>{198C4842-0000-0000-0000-000000000000}</Project>
+ <Project>{9490b719-829e-43a7-a5fe-8001f8a81759}</Project>
<Name>AgateLib</Name>
</ProjectReference>
</ItemGroup>
Modified: trunk/Examples.sln
===================================================================
--- trunk/Examples.sln 2014-09-03 06:16:47 UTC (rev 1509)
+++ trunk/Examples.sln 2014-09-03 06:36:22 UTC (rev 1510)
@@ -22,131 +22,101 @@
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|Mixed Platforms.Build.0 = Debug|x86
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|x64.ActiveCfg = Debug|x64
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|x64.Build.0 = Debug|x64
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|x86.ActiveCfg = Debug|x86
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Debug|x86.Build.0 = Debug|x86
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|Any CPU.Build.0 = Release|Any CPU
- {DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|Mixed Platforms.Build.0 = Release|x86
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|x64.ActiveCfg = Release|x64
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|x64.Build.0 = Release|x64
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|x86.ActiveCfg = Release|x86
{DD3CF4AA-02CC-4881-AFB1-6F10DFA1F8AF}.Release|x86.Build.0 = Release|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|Mixed Platforms.Build.0 = Debug|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|x64.ActiveCfg = Debug|x64
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|x64.Build.0 = Debug|x64
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|x86.ActiveCfg = Debug|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Debug|x86.Build.0 = Debug|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|Any CPU.Build.0 = Release|Any CPU
- {50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|Mixed Platforms.Build.0 = Release|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|x64.ActiveCfg = Release|x64
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|x64.Build.0 = Release|x64
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|x86.ActiveCfg = Release|x86
{50743D1B-A19E-42F1-842F-65FAD6D168C3}.Release|x86.Build.0 = Release|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|Mixed Platforms.Build.0 = Debug|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|x64.ActiveCfg = Debug|x64
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|x64.Build.0 = Debug|x64
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|x86.ActiveCfg = Debug|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Debug|x86.Build.0 = Debug|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|Any CPU.Build.0 = Release|Any CPU
- {436641C4-846C-42D0-8E8F-95F70E211D22}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {436641C4-846C-42D0-8E8F-95F70E211D22}.Release|Mixed Platforms.Build.0 = Release|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|x64.ActiveCfg = Release|x64
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|x64.Build.0 = Release|x64
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|x86.ActiveCfg = Release|x86
{436641C4-846C-42D0-8E8F-95F70E211D22}.Release|x86.Build.0 = Release|x86
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.Build.0 = Debug|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.Build.0 = Debug|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.Build.0 = Release|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x64.ActiveCfg = Release|Any CPU
{9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.ActiveCfg = Release|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|x64.Build.0 = Debug|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Debug|x86.Build.0 = Debug|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|Any CPU.Build.0 = Release|Any CPU
- {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|x64.ActiveCfg = Release|Any CPU
{8299274E-05DD-49E0-ACB8-70C2BBAC69D1}.Release|x86.ActiveCfg = Release|Any CPU
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|Mixed Platforms.Build.0 = Debug|x86
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.ActiveCfg = Debug|x64
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x64.Build.0 = Debug|x64
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.ActiveCfg = Debug|x86
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Debug|x86.Build.0 = Debug|x86
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Any CPU.Build.0 = Release|Any CPU
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|Mixed Platforms.Build.0 = Release|x86
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.ActiveCfg = Release|x64
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x64.Build.0 = Release|x64
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.ActiveCfg = Release|x86
{935D67A0-931E-46DE-9F6A-2D6DBC99AFF3}.Release|x86.Build.0 = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|Mixed Platforms.Build.0 = Debug|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x64.ActiveCfg = Debug|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x64.Build.0 = Debug|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x86.ActiveCfg = Debug|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Debug|x86.Build.0 = Debug|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Any CPU.Build.0 = Release|Any CPU
- {94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|Mixed Platforms.Build.0 = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x64.ActiveCfg = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x64.Build.0 = Release|x64
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.ActiveCfg = Release|x86
{94734E5A-0344-43E8-BB30-E32E3F57F611}.Release|x86.Build.0 = Release|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|Mixed Platforms.Build.0 = Debug|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x64.ActiveCfg = Debug|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x64.Build.0 = Debug|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x86.ActiveCfg = Debug|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Debug|x86.Build.0 = Debug|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Any CPU.Build.0 = Release|Any CPU
- {4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|Mixed Platforms.Build.0 = Release|x86
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x64.ActiveCfg = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x64.Build.0 = Release|x64
{4B12561E-D37B-48A1-B6DB-218E94906C22}.Release|x86.ActiveCfg = Release|x86
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-04 05:08:43
|
Revision: 1511
http://sourceforge.net/p/agate/code/1511
Author: kanato
Date: 2014-09-04 05:08:38 +0000 (Thu, 04 Sep 2014)
Log Message:
-----------
Implement streaming sound buffer for SDL.
Modified Paths:
--------------
trunk/AgateLib/AudioLib/ImplementationBase/AudioImpl.cs
trunk/AgateLib/AudioLib/Music.cs
trunk/AgateLib/AudioLib/SoundBuffer.cs
trunk/AgateLib/AudioLib/SoundBufferSession.cs
trunk/AgateLib/AudioLib/StreamingSoundBuffer.cs
trunk/AgateLib/Core.cs
trunk/AgateLib/Drivers/IAudioFactory.cs
trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs
trunk/AgateLib/Drivers/NullDrivers/NullSoundImpl.cs
trunk/AgateLib.AgateSDL/AgateLib.AgateSDL.csproj
trunk/AgateLib.AgateSDL/Audio/SDL_Audio.cs
trunk/AgateLib.AgateSDL/Sdl2/ISDLMixer.cs
trunk/AgateLib.AgateSDL/Sdl2/SDL32.cs
trunk/AgateLib.AgateSDL/Sdl2/SDL64.cs
trunk/AgateLib.AgateSDL/Sdl2/SDLConstants.cs
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
Added Paths:
-----------
trunk/AgateLib.AgateSDL/Audio/SDL_StreamingSoundBuffer.cs
trunk/AgateLib.AgateSDL/SdlFactory.cs
Removed Paths:
-------------
trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs
Modified: trunk/AgateLib/AudioLib/ImplementationBase/AudioImpl.cs
===================================================================
--- trunk/AgateLib/AudioLib/ImplementationBase/AudioImpl.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/AudioLib/ImplementationBase/AudioImpl.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -30,51 +30,8 @@
/// </summary>
public abstract class AudioImpl : DriverImplBase
{
- /// <summary>
- /// Creates a SoundBufferImpl object.
- /// </summary>
- /// <param name="filename"></param>
- /// <returns></returns>
- public abstract SoundBufferImpl CreateSoundBuffer(string filename);
/// <summary>
- /// Creates a MusicImpl object.
- /// </summary>
- /// <param name="filename"></param>
- /// <returns></returns>
- public abstract MusicImpl CreateMusic(string filename);
-
- /// <summary>
- /// Creates a MusicImpl object.
- /// </summary>
- /// <param name="musicStream"></param>
- /// <returns></returns>
- public abstract MusicImpl CreateMusic(Stream musicStream);
- /// <summary>
- /// Creates a SoundBufferSessionImpl object.
- /// </summary>
- /// <param name="buffer"></param>
- /// <returns></returns>
- public abstract SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer);
- /// <summary>
- /// Creates a SoundBufferImpl object.
- /// </summary>
- /// <param name="inStream"></param>
- /// <returns></returns>
- public abstract SoundBufferImpl CreateSoundBuffer(Stream inStream);
-
- /// <summary>
- /// Creates a streaming sound buffer.
- /// </summary>
- /// <param name="input"></param>
- /// <param name="format"></param>
- /// <returns></returns>
- public virtual StreamingSoundBufferImpl CreateStreamingSoundBuffer(Stream input, SoundFormat format)
- {
- throw new NotSupportedException();
- }
-
- /// <summary>
/// This function is called once a frame to allow the Audio driver to update
/// information. There is no need to call base.Update() if overriding this
/// function.
Modified: trunk/AgateLib/AudioLib/Music.cs
===================================================================
--- trunk/AgateLib/AudioLib/Music.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/AudioLib/Music.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -45,7 +45,7 @@
/// <param name="filename">The name of the file to load.</param>
public Music(string filename)
{
- impl = Audio.Impl.CreateMusic(filename);
+ impl = Core.Factory.AudioFactory.CreateMusic(filename);
mFilename = filename;
}
@@ -56,7 +56,7 @@
public Music(Stream source)
: this()
{
- impl = Audio.Impl.CreateMusic(source);
+ impl = Core.Factory.AudioFactory.CreateMusic(source);
}
/// <summary>
Modified: trunk/AgateLib/AudioLib/SoundBuffer.cs
===================================================================
--- trunk/AgateLib/AudioLib/SoundBuffer.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/AudioLib/SoundBuffer.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -65,7 +65,7 @@
/// <param name="filename"></param>
public SoundBuffer(string filename)
{
- mImpl = Audio.Impl.CreateSoundBuffer(filename);
+ mImpl = Core.Factory.AudioFactory.CreateSoundBuffer(filename);
mFilename = filename;
}
@@ -76,7 +76,7 @@
/// <param name="source"></param>
public SoundBuffer(Stream source)
{
- mImpl = Audio.Impl.CreateSoundBuffer(source);
+ mImpl = Core.Factory.AudioFactory.CreateSoundBuffer(source);
}
/// <summary>
Modified: trunk/AgateLib/AudioLib/SoundBufferSession.cs
===================================================================
--- trunk/AgateLib/AudioLib/SoundBufferSession.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/AudioLib/SoundBufferSession.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -44,7 +44,7 @@
{ }
internal SoundBufferSession(SoundBuffer source)
{
- impl = Audio.Impl.CreateSoundBufferSession(source.Impl);
+ impl = Core.Factory.AudioFactory.CreateSoundBufferSession(source.Impl);
mSource = source;
//mSource.StopEvent += new Audio.AudioCoreEventDelegate(Stop);
Modified: trunk/AgateLib/AudioLib/StreamingSoundBuffer.cs
===================================================================
--- trunk/AgateLib/AudioLib/StreamingSoundBuffer.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/AudioLib/StreamingSoundBuffer.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -42,7 +42,7 @@
/// new data is required.</param>
public StreamingSoundBuffer(Stream input, SoundFormat format, int chunkSize)
{
- impl = Audio.Impl.CreateStreamingSoundBuffer(input, format);
+ impl = Core.Factory.AudioFactory.CreateStreamingSoundBuffer(input, format);
stream = input;
ChunkSize = chunkSize;
}
Modified: trunk/AgateLib/Core.cs
===================================================================
--- trunk/AgateLib/Core.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/Core.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -333,7 +333,7 @@
FileSystem.Path = factory.PlatformFactory.CreatePath();
Display.Initialize(factory.DisplayFactory.DisplayImpl);
- Audio.Initialize(factory.AudioFactory.CreateAudioImpl());
+ Audio.Initialize(factory.AudioFactory.AudioImpl);
JoystickInput.Initialize(factory.InputFactory.CreateJoystickInputImpl());
InitializeDefaultResources();
Modified: trunk/AgateLib/Drivers/IAudioFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/IAudioFactory.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/Drivers/IAudioFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -1,4 +1,6 @@
-// The contents of this file are subject to the Mozilla Public License
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
@@ -18,6 +20,7 @@
//
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -26,6 +29,50 @@
{
public interface IAudioFactory
{
- AudioLib.ImplementationBase.AudioImpl CreateAudioImpl();
+ /// <summary>
+ /// Gets the audio system implementation object.
+ /// </summary>
+ AudioImpl AudioImpl { get; }
+
+ /// <summary>
+ /// Creates a SoundBufferImpl object.
+ /// </summary>
+ /// <param name="filename"></param>
+ /// <returns></returns>
+ SoundBufferImpl CreateSoundBuffer(string filename);
+
+ /// <summary>
+ /// Creates a MusicImpl object.
+ /// </summary>
+ /// <param name="filename"></param>
+ /// <returns></returns>
+ MusicImpl CreateMusic(string filename);
+
+ /// <summary>
+ /// Creates a MusicImpl object.
+ /// </summary>
+ /// <param name="musicStream"></param>
+ /// <returns></returns>
+ MusicImpl CreateMusic(Stream musicStream);
+ /// <summary>
+ /// Creates a SoundBufferSessionImpl object.
+ /// </summary>
+ /// <param name="buffer"></param>
+ /// <returns></returns>
+ SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer);
+ /// <summary>
+ /// Creates a SoundBufferImpl object.
+ /// </summary>
+ /// <param name="inStream"></param>
+ /// <returns></returns>
+ SoundBufferImpl CreateSoundBuffer(Stream inStream);
+
+ /// <summary>
+ /// Creates a streaming sound buffer.
+ /// </summary>
+ /// <param name="input"></param>
+ /// <param name="format"></param>
+ /// <returns></returns>
+ StreamingSoundBufferImpl CreateStreamingSoundBuffer(Stream input, SoundFormat format);
}
}
Modified: trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -1,4 +1,5 @@
-// The contents of this file are subject to the Mozilla Public License
+using AgateLib.AudioLib.ImplementationBase;
+// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
@@ -25,9 +26,37 @@
{
public class NullSoundFactory : IAudioFactory
{
- public AudioLib.ImplementationBase.AudioImpl CreateAudioImpl()
+ public NullSoundFactory()
{
- return new NullSoundImpl();
+ AudioImpl = new NullSoundImpl();
}
+
+ public AudioImpl AudioImpl { get;private set;}
+
+ public SoundBufferImpl CreateSoundBuffer(string filename)
+ {
+ return new NullSoundBufferImpl();
+ }
+ public SoundBufferImpl CreateSoundBuffer(System.IO.Stream inStream)
+ {
+ return new NullSoundBufferImpl();
+ }
+ public MusicImpl CreateMusic(string filename)
+ {
+ return new NullMusicImpl();
+ }
+ public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
+ {
+ return new NullSoundBufferSessionImpl();
+ }
+ public MusicImpl CreateMusic(System.IO.Stream musicStream)
+ {
+ return new NullMusicImpl();
+ }
+
+ public StreamingSoundBufferImpl CreateStreamingSoundBuffer(System.IO.Stream input, AudioLib.SoundFormat format)
+ {
+ throw new NotImplementedException();
+ }
}
}
Modified: trunk/AgateLib/Drivers/NullDrivers/NullSoundImpl.cs
===================================================================
--- trunk/AgateLib/Drivers/NullDrivers/NullSoundImpl.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib/Drivers/NullDrivers/NullSoundImpl.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -27,152 +27,155 @@
{
public class NullSoundImpl : AudioImpl
{
- class NullSoundBufferImpl : SoundBufferImpl
+ public override void Initialize()
{
- public override void Dispose()
- {
+ Report("No audio driver found. Audio will not be heard.");
+ }
- }
- public override double Volume
- {
- get
- {
- return 0;
- }
- set
- {
+ public override void Dispose()
+ {
+ }
- }
- }
+ protected internal override bool CapsBool(AgateLib.AudioLib.AudioBoolCaps audioBoolCaps)
+ {
+ return false;
+ }
+ }
+ class NullSoundBufferImpl : SoundBufferImpl
+ {
+ public override void Dispose()
+ {
}
- public class NullSoundBufferSessionImpl : SoundBufferSessionImpl
+ public override double Volume
{
- public override void Dispose()
+ get
{
+ return 0;
}
- public override void Play()
+ set
{
+
}
- public override void Stop()
+ }
+
+ }
+ public class NullSoundBufferSessionImpl : SoundBufferSessionImpl
+ {
+ public override void Dispose()
+ {
+ }
+ public override void Play()
+ {
+ }
+ public override void Stop()
+ {
+ }
+ public override double Volume
+ {
+ get
{
+ return 0;
}
- public override double Volume
+ set
{
- get
- {
- return 0;
- }
- set
- {
- }
}
- public override double Pan
+ }
+ public override double Pan
+ {
+ get
{
- get
- {
- return 0;
- }
- set
- {
-
- }
+ return 0;
}
- public override bool IsPlaying
+ set
{
- get { return false; }
- }
- public override int CurrentLocation
- {
- get { return 0; }
}
+ }
+ public override bool IsPlaying
+ {
+ get { return false; }
+ }
- protected internal override void Initialize()
- {
- }
+ public override int CurrentLocation
+ {
+ get { return 0; }
+ }
- public override bool IsPaused { get; set; }
+ protected internal override void Initialize()
+ {
}
- public class NullMusicImpl : MusicImpl
+
+ public override bool IsPaused { get; set; }
+ }
+
+ public class NullMusicImpl : MusicImpl
+ {
+ protected override void OnSetLoop(bool value)
{
- protected override void OnSetLoop(bool value)
- {
- }
- public override void Dispose()
- {
+ }
+ public override void Dispose()
+ {
- }
- public override void Play()
+ }
+ public override void Play()
+ {
+
+ }
+ public override void Stop()
+ {
+
+ }
+ public override double Volume
+ {
+ get
{
-
+ return 0;
}
- public override void Stop()
+ set
{
}
- public override double Volume
+ }
+ public override double Pan
+ {
+ get
{
- get
- {
- return 0;
- }
- set
- {
-
- }
+ return 0;
}
- public override double Pan
+ set
{
- get
- {
- return 0;
- }
- set
- {
- }
}
- public override bool IsPlaying
- {
- get { return false; }
- }
}
- public override void Initialize()
+ public override bool IsPlaying
{
- Report("No audio driver found. Audio will not be heard.");
+ get { return false; }
}
+ }
- public override void Dispose()
+ public class NullStreamingSoundBuffer : StreamingSoundBufferImpl
+ {
+ public override void Play()
{
}
- public override SoundBufferImpl CreateSoundBuffer(string filename)
+ public override void Stop()
{
- return new NullSoundBufferImpl();
}
- public override SoundBufferImpl CreateSoundBuffer(System.IO.Stream inStream)
+
+ public override int ChunkSize { get;set;}
+ public override bool IsPlaying
{
- return new NullSoundBufferImpl();
+ get { return false; }
}
- public override MusicImpl CreateMusic(string filename)
+
+ public override void Dispose()
{
- return new NullMusicImpl();
}
- public override SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
- {
- return new NullSoundBufferSessionImpl();
- }
- public override MusicImpl CreateMusic(System.IO.Stream musicStream)
- {
- return new NullMusicImpl();
- }
- protected internal override bool CapsBool(AgateLib.AudioLib.AudioBoolCaps audioBoolCaps)
- {
- return false;
- }
+ public override double Pan { get;set;}
}
}
Modified: trunk/AgateLib.AgateSDL/AgateLib.AgateSDL.csproj
===================================================================
--- trunk/AgateLib.AgateSDL/AgateLib.AgateSDL.csproj 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/AgateLib.AgateSDL.csproj 2014-09-04 05:08:38 UTC (rev 1511)
@@ -89,6 +89,7 @@
<Compile Include="Audio\SDL_Music.cs" />
<Compile Include="Audio\SDL_SoundBuffer.cs" />
<Compile Include="Audio\SDL_SoundBufferSession.cs" />
+ <Compile Include="Audio\SDL_StreamingSoundBuffer.cs" />
<Compile Include="Input\Joysitck_SDL.cs" />
<Compile Include="Input\SDL_Input.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -108,6 +109,7 @@
<Compile Include="Sdl2\ThirtyTwo\SDL2_image.cs" />
<Compile Include="Sdl2\ThirtyTwo\SDL2_mixer.cs" />
<Compile Include="Sdl2\ThirtyTwo\SDL2_ttf.cs" />
+ <Compile Include="SdlFactory.cs" />
</ItemGroup>
<ItemGroup>
<None Include="AgateLib.AgateSDL.dll.config" />
Modified: trunk/AgateLib.AgateSDL/Audio/SDL_Audio.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Audio/SDL_Audio.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/Audio/SDL_Audio.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -36,8 +36,6 @@
public SDL_Audio()
{
- sdl = SdlFactory.CreateSDL();
-
FileProvider = AgateLib.IO.FileProvider.SoundAssets;
}
public SDL_Audio(IReadFileProvider fileProvider)
@@ -86,38 +84,16 @@
}
}
- public override MusicImpl CreateMusic(string filename)
+ public override void Initialize()
{
- return new SDL_Music(this, filename);
- }
- public override MusicImpl CreateMusic(System.IO.Stream musicStream)
- {
- return new SDL_Music(this, musicStream);
- }
+ sdl = SdlFactory.CreateSDL();
- public override SoundBufferImpl CreateSoundBuffer(string filename)
- {
- return new SDL_SoundBuffer(filename);
- }
- public override SoundBufferImpl CreateSoundBuffer(System.IO.Stream inStream)
- {
- return new SDL_SoundBuffer(inStream);
- }
- public override SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
- {
- return new SDL_SoundBufferSession((SDL_SoundBuffer)buffer);
- }
-
-
- public override void Initialize()
- {
if (sdl.SDL_InitSubSystem(SDLConstants.SDL_INIT_AUDIO) != 0)
{
throw new AgateLib.AgateException("Failed to initialize SDL for audio playback.");
}
- if (sdl.Mixer.Mix_OpenAudio(
- SDLConstants.MIX_DEFAULT_FREQUENCY, SDLConstants.AUDIO_S16, 2, 512) != 0)
+ if (sdl.Mixer.Mix_OpenAudio(44100, SDLConstants.AUDIO_S16, 2, 512) != 0)
{
throw new AgateLib.AgateException("Failed to initialize SDL_mixer.");
}
@@ -146,5 +122,15 @@
{
mChannels[channel] = session;
}
+
+ public override void Update()
+ {
+ base.Update();
+
+ if (UpdateCalled != null)
+ UpdateCalled(this, EventArgs.Empty);
+ }
+
+ public event EventHandler UpdateCalled;
}
}
Added: trunk/AgateLib.AgateSDL/Audio/SDL_StreamingSoundBuffer.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Audio/SDL_StreamingSoundBuffer.cs (rev 0)
+++ trunk/AgateLib.AgateSDL/Audio/SDL_StreamingSoundBuffer.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -0,0 +1,75 @@
+using AgateLib.AgateSDL.Sdl2;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.AgateSDL.Audio
+{
+ class SDL_StreamingSoundBuffer : StreamingSoundBufferImpl
+ {
+ SDL_Audio mAudio;
+ ISDL mSdl;
+
+ Stream mInput;
+ SoundFormat mFormat;
+ bool mIsPlaying;
+
+ public SDL_StreamingSoundBuffer(SDL_Audio audio, Stream input, SoundFormat format)
+ {
+ mAudio = audio;
+ mInput = input;
+ mFormat = format;
+ mSdl = SdlFactory.CreateSDL();
+
+ mSdl.Mixer.Mix_HookMusic(MixFunction, IntPtr.Zero);
+ Play();
+ ChunkSize = 2048;
+ }
+ public override void Dispose()
+ {
+ mSdl.Mixer.Mix_HookMusic(null, IntPtr.Zero);
+ }
+
+ public override void Play()
+ {
+ mIsPlaying = true;
+ }
+
+ public override void Stop()
+ {
+ mIsPlaying = false;
+ }
+
+
+ byte[] buffer = new byte[100];
+
+ void MixFunction(IntPtr udata, IntPtr stream, int len)
+ {
+ if (buffer.Length < len)
+ buffer = new byte[len];
+
+ if (IsPlaying)
+ mInput.Read(buffer, 0, len);
+ else
+ Array.Clear(buffer, 0, len);
+
+ Marshal.Copy(buffer, 0, stream, len);
+ }
+
+ public override int ChunkSize { get; set; }
+
+ public override bool IsPlaying
+ {
+ get { return mIsPlaying; }
+ }
+
+ public override double Pan { get; set; }
+
+ }
+}
Modified: trunk/AgateLib.AgateSDL/Sdl2/ISDLMixer.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Sdl2/ISDLMixer.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/Sdl2/ISDLMixer.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -51,5 +51,7 @@
void Mix_Pause(int channel);
string GetError();
+
+ void Mix_HookMusic(SDL_mixer_MixFuncDelegate mix_func, IntPtr arg);
}
}
Modified: trunk/AgateLib.AgateSDL/Sdl2/SDL32.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Sdl2/SDL32.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/Sdl2/SDL32.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -245,5 +245,20 @@
{
return SDL.SDL_GetError();
}
+
+
+ SDL_mixer.MixFuncDelegate mixFuncStorage;
+ public void Mix_HookMusic(SDL_mixer_MixFuncDelegate mix_func, IntPtr arg)
+ {
+ if (mix_func != null)
+ {
+ mixFuncStorage = new SDL_mixer.MixFuncDelegate(mix_func);
+ SDL_mixer.Mix_HookMusic(mixFuncStorage, arg);
+ }
+ else
+ {
+ SDL_mixer.Mix_HookMusic(null, arg);
+ }
+ }
}
}
Modified: trunk/AgateLib.AgateSDL/Sdl2/SDL64.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Sdl2/SDL64.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/Sdl2/SDL64.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -234,5 +234,19 @@
{
return SDL.SDL_GetError();
}
+
+ SDL_mixer.MixFuncDelegate mixFuncStorage;
+ public void Mix_HookMusic(SDL_mixer_MixFuncDelegate mix_func, IntPtr arg)
+ {
+ if (mix_func != null)
+ {
+ mixFuncStorage = new SDL_mixer.MixFuncDelegate(mix_func);
+ SDL_mixer.Mix_HookMusic(mixFuncStorage, arg);
+ }
+ else
+ {
+ SDL_mixer.Mix_HookMusic(null, arg);
+ }
+ }
}
}
Modified: trunk/AgateLib.AgateSDL/Sdl2/SDLConstants.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Sdl2/SDLConstants.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.AgateSDL/Sdl2/SDLConstants.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace AgateLib.AgateSDL.Sdl2
{
- class SDLConstants
+ static class SDLConstants
{
public const uint SDL_INIT_TIMER = 0x00000001;
public const uint SDL_INIT_AUDIO = 0x00000010;
@@ -73,4 +74,11 @@
public const byte SDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP;
public const byte SDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN;
}
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void SDL_mixer_MixFuncDelegate(
+ IntPtr udata, // void*
+ IntPtr stream, // Uint8*
+ int len
+ );
}
Copied: trunk/AgateLib.AgateSDL/SdlFactory.cs (from rev 1510, trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs)
===================================================================
--- trunk/AgateLib.AgateSDL/SdlFactory.cs (rev 0)
+++ trunk/AgateLib.AgateSDL/SdlFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -0,0 +1,67 @@
+using AgateLib.AgateSDL.Audio;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.Drivers;
+using AgateLib.Drivers.NullDrivers;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.AgateSDL
+{
+ class AgateSdlFactory : IAudioFactory, IInputFactory
+ {
+ #region --- Audio Factory ---
+
+ SDL_Audio mAudioImpl;
+
+
+ public AudioImpl AudioImpl
+ {
+ get
+ {
+ if (mAudioImpl == null)
+ mAudioImpl = new SDL_Audio();
+ return mAudioImpl;
+ }
+ }
+
+ public MusicImpl CreateMusic(string filename)
+ {
+ return new SDL_Music(mAudioImpl, filename);
+ }
+ public MusicImpl CreateMusic(System.IO.Stream musicStream)
+ {
+ return new SDL_Music(mAudioImpl, musicStream);
+ }
+
+ public SoundBufferImpl CreateSoundBuffer(string filename)
+ {
+ return new SDL_SoundBuffer(filename);
+ }
+ public SoundBufferImpl CreateSoundBuffer(System.IO.Stream inStream)
+ {
+ return new SDL_SoundBuffer(inStream);
+ }
+ public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
+ {
+ return new SDL_SoundBufferSession((SDL_SoundBuffer)buffer);
+ }
+ public StreamingSoundBufferImpl CreateStreamingSoundBuffer(Stream input, SoundFormat format)
+ {
+ return new SDL_StreamingSoundBuffer(mAudioImpl, input, format);
+ }
+
+ #endregion
+ #region --- Input Factory ---
+
+ public InputLib.ImplementationBase.InputImpl CreateJoystickInputImpl()
+ {
+ return new AgateLib.AgateSDL.Input.SDL_Input();
+ }
+
+ #endregion
+ }
+}
Modified: trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
===================================================================
--- trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj 2014-09-04 05:08:38 UTC (rev 1511)
@@ -121,7 +121,6 @@
<Compile Include="Factories\DisplayFactory.cs" />
<Compile Include="Factories\FormsFactory.cs" />
<Compile Include="Factories\PlatformFactory.cs" />
- <Compile Include="Factories\SdlFactory.cs" />
<Compile Include="Factories\SysIoFile.cs" />
<Compile Include="Factories\SysIoPath.cs" />
<Compile Include="PixelBufferExtensions.cs" />
Modified: trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.Platform.WinForms/Factories/FormsFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -1,4 +1,5 @@
-using AgateLib.ApplicationModels;
+using AgateLib.AgateSDL;
+using AgateLib.ApplicationModels;
using AgateLib.DisplayLib;
using AgateLib.Drivers;
using AgateLib.Platform.WinForms.Resources;
@@ -20,7 +21,7 @@
DisplayFactory = new DisplayFactory();
mPlatformFactory = new PlatformFactory();
- var sdl = new SdlFactory();
+ var sdl = new AgateSdlFactory();
AudioFactory = sdl;
InputFactory = sdl;
Deleted: trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs 2014-09-03 06:36:22 UTC (rev 1510)
+++ trunk/AgateLib.Platform.WinForms/Factories/SdlFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
@@ -1,22 +0,0 @@
-using AgateLib.Drivers;
-using AgateLib.Drivers.NullDrivers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace AgateLib.Platform.WinForms.Factories
-{
- class SdlFactory : IAudioFactory, IInputFactory
- {
- public InputLib.ImplementationBase.InputImpl CreateJoystickInputImpl()
- {
- return new AgateLib.AgateSDL.Input.SDL_Input();
- }
-
- public AudioLib.ImplementationBase.AudioImpl CreateAudioImpl()
- {
- return new AgateLib.AgateSDL.Audio.SDL_Audio();
- }
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-04 05:21:31
|
Revision: 1512
http://sourceforge.net/p/agate/code/1512
Author: kanato
Date: 2014-09-04 05:21:16 +0000 (Thu, 04 Sep 2014)
Log Message:
-----------
Update old XAudio2 code into new model.
Modified Paths:
--------------
trunk/AgateLib/AudioLib/SoundBufferSession.cs
trunk/AgateLib/Drivers/IAudioFactory.cs
trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs
trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs
trunk/AgateLib.AgateSDL/Audio/SDL_SoundBufferSession.cs
trunk/AgateLib.AgateSDL/SdlFactory.cs
trunk/AgateLib.Platform.WindowsMetro/Factories/WindowsFactory.cs
trunk/AgateLib.Platform.WindowsMetro/packages.config
trunk/AgateLib.Platform.WindowsPhone/Factories/WindowsPhoneFactory.cs
trunk/AgateLib.Platform.WindowsPhone/packages.config
trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/FrameBufferWindow.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_FrameBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Interop.cs
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainBackgroundPanelAdapter.cs
trunk/AgateLib.Platform.WindowsStoreCommon/SwapChainPanelAdapter.cs
trunk/AgateLib.Platform.WindowsStoreCommon/packages.config
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Audio/SoundbufferStopTester.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeRenderTarget.cs
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WinForms/frmLauncher.Designer.cs
trunk/AgateLib.Tests/UnitTests/ApplicationModels/CoordinateSystemTest.cs
trunk/AgateLib.Tests/UnitTests/Display/DisplayWindowTest.cs
Added Paths:
-----------
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Audio.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Music.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBufferSession.cs
trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_StreamingSoundBuffer.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/AudioFactoryDX.cs
trunk/AgateLib.Platform.WindowsStoreCommon/RenderTargetAdapterBase.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/snda.wav
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/sndb.wav
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/Assets/snda.wav
trunk/AgateLib.Tests/Tests.WinForms/Assets/sndb.wav
Modified: trunk/AgateLib/AudioLib/SoundBufferSession.cs
===================================================================
--- trunk/AgateLib/AudioLib/SoundBufferSession.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib/AudioLib/SoundBufferSession.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -44,10 +44,9 @@
{ }
internal SoundBufferSession(SoundBuffer source)
{
- impl = Core.Factory.AudioFactory.CreateSoundBufferSession(source.Impl);
+ impl = Core.Factory.AudioFactory.CreateSoundBufferSession(this, source.Impl);
mSource = source;
- //mSource.StopEvent += new Audio.AudioCoreEventDelegate(Stop);
Initialize();
Modified: trunk/AgateLib/Drivers/IAudioFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/IAudioFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib/Drivers/IAudioFactory.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -59,7 +59,7 @@
/// </summary>
/// <param name="buffer"></param>
/// <returns></returns>
- SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer);
+ SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferSession owner, SoundBufferImpl buffer);
/// <summary>
/// Creates a SoundBufferImpl object.
/// </summary>
Modified: trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs
===================================================================
--- trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib/Drivers/NullDrivers/NullSoundFactory.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -1,4 +1,5 @@
-using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
@@ -45,7 +46,7 @@
{
return new NullMusicImpl();
}
- public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
+ public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferSession owner, SoundBufferImpl buffer)
{
return new NullSoundBufferSessionImpl();
}
Modified: trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs
===================================================================
--- trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib/Geometry/CoordinateSystems/FixedAspectRatioCoordinates.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -32,14 +32,15 @@
/// </summary>
public class FixedAspectRatioCoordinates : ICoordinateSystem
{
+ Point mOrigin;
+ Size mRenderTargetSize;
+
public FixedAspectRatioCoordinates()
{
PreserveDisplayAspectRatio = true;
AspectRatio = 16 / (double)9;
}
- Size mRenderTargetSize;
-
public Size RenderTargetSize
{
get { return mRenderTargetSize; }
@@ -49,6 +50,20 @@
DetermineCoordinateSystem();
}
}
+ /// <summary>
+ /// The value of the coordinate system in the upper left corner of
+ /// the display area.
+ /// </summary>
+ public Point Origin
+ {
+ get { return mOrigin; }
+ set
+ {
+ mOrigin = value;
+ DetermineCoordinateSystem();
+ }
+ }
+
public Rectangle Coordinates { get; private set; }
public void DetermineCoordinateSystem()
@@ -133,11 +148,5 @@
public double AspectRatio { get; set; }
- /// <summary>
- /// The value of the coordinate system in the upper left corner of
- /// the display area.
- /// </summary>
- public Point Origin { get; set; }
-
}
}
Modified: trunk/AgateLib.AgateSDL/Audio/SDL_SoundBufferSession.cs
===================================================================
--- trunk/AgateLib.AgateSDL/Audio/SDL_SoundBufferSession.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.AgateSDL/Audio/SDL_SoundBufferSession.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -25,6 +25,7 @@
using AgateLib.AudioLib.ImplementationBase;
using SDL2;
using AgateLib.AgateSDL.Sdl2;
+using AgateLib.AudioLib;
namespace AgateLib.AgateSDL.Audio
{
@@ -42,10 +43,11 @@
public bool mIsPlaying;
- public SDL_SoundBufferSession(SDL_SoundBuffer buffer)
+ public SDL_SoundBufferSession(SoundBufferSession owner, SDL_SoundBuffer buffer)
{
sdl = SdlFactory.CreateSDL();
-
+ Owner = owner;
+
this.buffer = buffer;
loop = buffer.Loop;
@@ -62,6 +64,7 @@
{
Stop();
}
+ public SoundBufferSession Owner { get; private set; }
protected override void Initialize()
{
Modified: trunk/AgateLib.AgateSDL/SdlFactory.cs
===================================================================
--- trunk/AgateLib.AgateSDL/SdlFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.AgateSDL/SdlFactory.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -45,9 +45,9 @@
{
return new SDL_SoundBuffer(inStream);
}
- public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
+ public SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferSession owner, SoundBufferImpl buffer)
{
- return new SDL_SoundBufferSession((SDL_SoundBuffer)buffer);
+ return new SDL_SoundBufferSession(owner, (SDL_SoundBuffer)buffer);
}
public StreamingSoundBufferImpl CreateStreamingSoundBuffer(Stream input, SoundFormat format)
{
Modified: trunk/AgateLib.Platform.WindowsMetro/Factories/WindowsFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/Factories/WindowsFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.Platform.WindowsMetro/Factories/WindowsFactory.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -21,7 +21,7 @@
mDisplayFactory = new DisplayFactory();
PlatformFactory = new WinPlatformFactory(assets);
- AudioFactory = new NullSoundFactory();
+ AudioFactory = new AudioFactoryDX();
InputFactory = new NullInputFactory();
}
Modified: trunk/AgateLib.Platform.WindowsMetro/packages.config
===================================================================
--- trunk/AgateLib.Platform.WindowsMetro/packages.config 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.Platform.WindowsMetro/packages.config 2014-09-04 05:21:16 UTC (rev 1512)
@@ -5,4 +5,5 @@
<package id="SharpDX.Direct3D11" version="2.6.2" targetFramework="win81" />
<package id="SharpDX.DXGI" version="2.6.2" targetFramework="win81" />
<package id="SharpDX.SimpleInitializer" version="1.0.0" targetFramework="win81" />
+ <package id="SharpDX.XAudio2" version="2.6.2" targetFramework="win81" />
</packages>
\ No newline at end of file
Modified: trunk/AgateLib.Platform.WindowsPhone/Factories/WindowsPhoneFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/Factories/WindowsPhoneFactory.cs 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.Platform.WindowsPhone/Factories/WindowsPhoneFactory.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -21,7 +21,7 @@
mDisplayFactory = new DisplayFactory();
PlatformFactory = new WPPlatformFactory(assets);
- AudioFactory = new NullSoundFactory();
+ AudioFactory = new AudioFactoryDX();
InputFactory = new NullInputFactory();
}
Modified: trunk/AgateLib.Platform.WindowsPhone/packages.config
===================================================================
--- trunk/AgateLib.Platform.WindowsPhone/packages.config 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.Platform.WindowsPhone/packages.config 2014-09-04 05:21:16 UTC (rev 1512)
@@ -5,4 +5,5 @@
<package id="SharpDX.Direct3D11" version="2.6.2" targetFramework="wpa81" />
<package id="SharpDX.DXGI" version="2.6.2" targetFramework="wpa81" />
<package id="SharpDX.SimpleInitializer" version="1.0.0" targetFramework="wpa81" />
+ <package id="SharpDX.XAudio2" version="2.6.2" targetFramework="wpa81" />
</packages>
\ No newline at end of file
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-09-04 05:08:38 UTC (rev 1511)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AgateLib.Platform.WindowsStoreCommon.csproj 2014-09-04 05:21:16 UTC (rev 1512)
@@ -74,6 +74,11 @@
<ItemGroup>
<Compile Include="ApplicationModels\WindowsStoreSerialModel.cs" />
<Compile Include="ApplicationModels\WindowsStoreSerialModelParameters.cs" />
+ <Compile Include="AudioImplementation\XAudio2_Audio.cs" />
+ <Compile Include="AudioImplementation\XAudio2_Music.cs" />
+ <Compile Include="AudioImplementation\XAudio2_SoundBuffer.cs" />
+ <Compile Include="AudioImplementation\XAudio2_SoundBufferSession.cs" />
+ <Compile Include="AudioImplementation\XAudio2_StreamingSoundBuffer.cs" />
<Compile Include="DisplayImplementation\D3DDevice.cs" />
<Compile Include="DisplayImplementation\DrawBuffer.cs" />
<Compile Include="DisplayImplementation\FrameBufferSurface.cs" />
@@ -89,6 +94,7 @@
<Compile Include="DisplayImplementation\Shaders\SDX_Lighting3DShader.cs" />
<Compile Include="DisplayImplementation\Shaders\ShaderFactory.cs" />
<Compile Include="DisplayImplementation\Shaders\ShaderSourceProvider.cs" />
+ <Compile Include="Factories\AudioFactoryDX.cs" />
<Compile Include="Factories\DisplayFactory.cs" />
<Compile Include="Factories\FakeFile.cs" />
<Compile Include="Factories\FakePath.cs" />
@@ -99,6 +105,7 @@
<Compile Include="PlatformImplementation\WindowsStorePlatformFactory.cs" />
<Compile Include="PlatformImplementation\WindowsStorePlatformInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RenderTargetAdapterBase.cs" />
<Compile Include="SwapChainPanelAdapter.cs" />
<Compile Include="SwapChainBackgroundPanelAdapter.cs" />
<Compile Include="ApplicationModels\WindowsStoreSceneModelParameters.cs" />
@@ -116,6 +123,9 @@
<Reference Include="SharpDX.SimpleInitializer">
<HintPath>..\packages\SharpDX.SimpleInitializer.1.0.0\lib\portable-netcore451+wpa81\SharpDX.SimpleInitializer.dll</HintPath>
</Reference>
+ <Reference Include="SharpDX.XAudio2">
+ <HintPath>..\packages\SharpDX.2.6.2\Bin\DirectX11_2-Signed-winrt\SharpDX.XAudio2.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\ShaderSource\Basic2Dpixel.hlsl" />
Added: trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Audio.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Audio.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Audio.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -0,0 +1,185 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.Drivers;
+using SharpDX.XAudio2;
+using SharpDX.Multimedia;
+using Windows.UI.Core;
+using System.Threading.Tasks;
+
+namespace AgateLib.Platform.WindowsStore.AudioImplementation
+{
+ public class XAudio2_Audio : AudioImpl
+ {
+ XAudio2 mDevice;
+ MasteringVoice mMasteringVoice;
+ bool stopThread;
+
+ List<InvokeData> methodsToInvoke = new List<InvokeData>();
+
+ struct InvokeData
+ {
+ public Delegate method;
+ public object[] args;
+ }
+
+ public XAudio2 Device
+ {
+ get { return mDevice; }
+ }
+
+ public XAudio2_Audio()
+ {
+
+ }
+
+ public CoreDispatcher Dispatcher { get; private set; }
+ public MasteringVoice MasteringVoice { get { return mMasteringVoice; } }
+
+ public override void Initialize()
+ {
+ Dispatcher = DisplayImplementation.SDX_Display.MainThreadCoreWindow.Dispatcher;
+
+ mDevice = new XAudio2();
+ mMasteringVoice = new MasteringVoice(mDevice);
+
+ Report("SharpDX XAudio2 driver instantiated for audio.");
+
+ }
+
+ #region --- Threading ---
+
+ public bool InvokeRequired
+ {
+ get
+ {
+ return false;
+ /*
+ if (Thread.CurrentThread == xaudThread)
+ return false;
+ else
+ return true;
+ * */
+ }
+ }
+
+
+ public void BeginInvoke(Delegate method, params object[] args)
+ {
+ InvokeData k = new InvokeData { method = method, args = args };
+
+ lock (methodsToInvoke)
+ {
+ methodsToInvoke.Add(k);
+ }
+ }
+
+ public void Invoke(Delegate method, object[] args)
+ {
+ BeginInvoke(method, args);
+
+ throw new NotImplementedException();
+ /*
+ while (methodsToInvoke.Count > 0)
+ Thread.Sleep(1);
+ * */
+ }
+
+ void Run(object unused)
+ {
+ mDevice = new XAudio2();
+ mMasteringVoice = new MasteringVoice(mDevice);
+
+ for (; ; )
+ {
+ int count = methodsToInvoke.Count;
+
+ for (int i = 0; i < count; i++)
+ {
+ if (stopThread)
+ break;
+
+ InvokeData k = methodsToInvoke[i];
+
+ k.method.DynamicInvoke(k.args);
+ }
+
+ lock (methodsToInvoke)
+ {
+ methodsToInvoke.RemoveRange(0, count);
+ }
+
+ if (stopThread)
+ break;
+
+ //Thread.Sleep(1);
+ }
+
+ Dispose();
+ }
+
+ #endregion
+
+ public override void Dispose()
+ {
+ if (InvokeRequired)
+ {
+ stopThread = true;
+
+ int count = 0;
+ /*
+ while (xaudThread.ThreadState == ThreadState.Running)
+ {
+ Thread.Sleep(10);
+ count++;
+
+ if (count > 20)
+ {
+ xaudThread.Abort();
+ }
+ }
+ */
+ return;
+ }
+
+ mMasteringVoice.Dispose();
+ mDevice.Dispose();
+ }
+
+ protected override bool CapsBool(AgateLib.AudioLib.AudioBoolCaps audioBoolCaps)
+ {
+ switch (audioBoolCaps)
+ {
+ case AudioBoolCaps.StreamingSoundBuffer:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public delegate void DisposeDelegate();
+}
Added: trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Music.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Music.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_Music.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -0,0 +1,238 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.Drivers;
+using SharpDX.XAudio2;
+using SharpDX.Multimedia;
+
+namespace AgateLib.Platform.WindowsStore.AudioImplementation
+{
+
+ public class XAudio2_Music : MusicImpl
+ {
+ XAudio2_Audio mAudio;
+
+ public XAudio2_Music(XAudio2_Audio audio, string filename)
+ {
+ mAudio = audio;
+
+ if (System.IO.Path.GetExtension(filename) == ".mp3")
+ throw new Exception("MP3 files cannot be played due to license restrictions.");
+
+ //LoadMusic(filename);
+ }
+
+ public XAudio2_Music(XAudio2_Audio audio, Stream infile)
+ {
+ mAudio = audio;
+
+ //string tempfile = Path.GetTempFileName();
+ //using (FileStream writer = File.OpenWrite(tempfile))
+ //{
+ // ReadWriteStream(infile, writer);
+ //}
+
+ //try
+ //{
+ // LoadMusic(tempfile);
+ //}
+ //catch (Microsoft.DirectX.DirectXException e)
+ //{
+ // throw new AgateLib.AgateException(
+ // "Could not load the music file. The file format may be unsupported by DirectX.", e);
+ //}
+ //finally
+ //{
+ // File.Delete(tempfile);
+ //}
+ }
+ /*
+ private void LoadMusic(string filename)
+ {
+ mAVAudio = new Microsoft.DirectX.AudioVideoPlayback.Audio(filename);
+ mAVAudio.Ending += new EventHandler(mAVAudio_Ending);
+ }
+
+ private void ReadWriteStream(Stream readStream, Stream writeStream)
+ {
+ int Length = 256;
+ Byte[] buffer = new Byte[Length];
+ int bytesRead = readStream.Read(buffer, 0, Length);
+ // write the required bytes
+ while (bytesRead > 0)
+ {
+ writeStream.Write(buffer, 0, bytesRead);
+ bytesRead = readStream.Read(buffer, 0, Length);
+ }
+ readStream.Close();
+ writeStream.Close();
+ }
+
+ public override void Dispose()
+ {
+ mAVAudio.Dispose();
+ }
+
+
+ protected override void OnSetLoop(bool value)
+ {
+ if (value == true)
+ mAVAudio.Ending += mAVAudio_Ending;
+ else
+ mAVAudio.Ending -= mAVAudio_Ending;
+ }
+
+ public override void Play()
+ {
+ mAVAudio.Play();
+ }
+
+ public override void Stop()
+ {
+ mAVAudio.Stop();
+ }
+
+ /// <summary>
+ /// </summary>
+ public override double Volume
+ {
+ get
+ {
+ try
+ {
+ /// The DirectX AudioVideoPlayback object takes volume in the range of
+ /// -10000 to 0, indicating the number of hundredths of decibels the volume
+ /// is attenuated by, so we convert to zero to 1.
+
+ double vol = (double)(mAVAudio.Volume + 10000) / 10000;
+ // logarithmic volume control
+ return Audio.TransformByExp(vol);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ System.Diagnostics.Debug.WriteLine("Failed to read volume.");
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ return 1.0;
+ }
+ }
+ set
+ {
+ // do a logarithmic volume control
+ try
+ {
+ mAVAudio.Volume = (int)(Audio.TransformByLog(value) * 10000.0 - 10000.0);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ System.Diagnostics.Debug.WriteLine("Failed to set volume.");
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ }
+ }
+ }
+
+
+ void mAVAudio_Ending(object sender, EventArgs e)
+ {
+ if (IsLooping)
+ {
+ mAVAudio.CurrentPosition = 0;
+ }
+ }
+
+ public override bool IsPlaying
+ {
+ get { return mAVAudio.Playing; }
+ }
+
+ public override double Pan
+ {
+ get
+ {
+ return mAVAudio.Balance / (double)10000.0;
+ }
+ set
+ {
+ try
+ {
+ mAVAudio.Balance = (int)(value * 10000.0);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ if (e.ErrorCode != -2147220909)
+ throw e;
+ }
+ }
+ }
+ * */
+ public override void Dispose()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override bool IsPlaying
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ protected override void OnSetLoop(bool value)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override double Pan
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ set
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ public override void Play()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void Stop()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override double Volume
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ set
+ {
+ throw new NotImplementedException();
+ }
+ }
+ }
+}
Added: trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBuffer.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBuffer.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBuffer.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -0,0 +1,85 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.Drivers;
+using SharpDX.XAudio2;
+using SharpDX.Multimedia;
+using SharpDX;
+
+namespace AgateLib.Platform.WindowsStore.AudioImplementation
+{
+ public class XAudio2_SoundBuffer : SoundBufferImpl
+ {
+ XAudio2_Audio mAudio;
+ AudioBuffer mBuffer;
+ double mVolume;
+ WaveFormat mFormat;
+
+ static Stream OpenFile(string filename)
+ {
+ return AgateLib.IO.FileProvider.SoundAssets.OpenReadAsync(filename).Result;
+ }
+ public XAudio2_SoundBuffer(XAudio2_Audio audio, Stream inStream)
+ {
+ mAudio = audio;
+
+ var stream = new SoundStream(inStream);
+
+ mBuffer = new AudioBuffer();
+ mBuffer.Stream = stream;
+ mBuffer.AudioBytes = (int)stream.Length;
+
+ mFormat = stream.Format;
+ }
+
+ public XAudio2_SoundBuffer(XAudio2_Audio audio, string filename)
+ : this(audio, OpenFile(filename))
+ {
+
+ }
+
+ public override bool Loop { get; set; }
+
+ public override void Dispose()
+ {
+ mBuffer.Stream.Dispose();
+ }
+
+ public AudioBuffer Buffer
+ {
+ get { return mBuffer; }
+ }
+ public WaveFormat Format
+ {
+ get { return mFormat; }
+ }
+
+ public override double Volume
+ {
+ get { return mVolume; }
+ set { mVolume = value; }
+ }
+ }
+}
Added: trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBufferSession.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBufferSession.cs (rev 0)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/AudioImplementation/XAudio2_SoundBufferSession.cs 2014-09-04 05:21:16 UTC (rev 1512)
@@ -0,0 +1,261 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using AgateLib.AudioLib;
+using AgateLib.AudioLib.ImplementationBase;
+using AgateLib.Drivers;
+using SharpDX.XAudio2;
+using SharpDX.Multimedia;
+using System.Threading.Tasks;
+
+namespace AgateLib.Platform.WindowsStore.AudioImplementation
+{
+ public class XAudio2_SoundBufferSession : SoundBufferSessionImpl
+ {
+ XAudio2_SoundBuffer mSource;
+ XAudio2_Audio mAudio;
+ AudioBuffer mBuffer;
+ SourceVoice mVoice;
+ double mVolume;
+ double mPan;
+ bool mIsPlaying;
+ bool mIsPaused;
+ bool mLoop = false;
+ bool mDisposing = false;
+
+ float[] channelVolumes = new float[2];
+ float[] outputMatrix = new float[8];
+
+ public XAudio2_SoundBufferSession(XAudio2_Audio audio, XAudio2_SoundBuffer source)
+ {
+ mAudio = audio;
+ mSource = source;
+ mBuffer = source.Buffer;
+ mVolume = source.Volume;
+ mLoop = source.Loop;
+
+ mVoice = new SourceVoice(mAudio.Device, mSource.Format);
+ mVoice.BufferEnd += mVoice_BufferEnd;
+ }
+
+ void mVoice_BufferEnd(IntPtr obj)
+ {
+ if (mDisposing)
+ {
+ mVoice.Dispose();
+ return;
+ }
+
+ if (mLoop)
+ {
+ mVoice.SubmitSourceBuffer(mBuffer, null);
+ }
+ else
+ {
+ mIsPlaying = false;
+ }
+ }
+ public override void Dispose()
+ {
+ mLoop = false;
+ mVoice.Stop();
+
+ mDisposing = true;
+ }
+
+ protected override void Initialize()
+ {
+ mVoice.Stop();
+ mVoice.SubmitSourceBuffer(mBuffer, null);
+ }
+
+ public override int CurrentLocation
+ {
+ get
+ {
+ return (int)mVoice.State.SamplesPlayed;
+ }
+ }
+ public override void Play()
+ {
+ mVoice.Stop();
+ mVoice.Start();
+ mIsPlaying = true;
+ }
+
+ public override void Stop()
+ {
+ mVoice.Stop();
+ }
+
+ public override bool IsPaused
+ {
+ get
+ {
+ return mIsPaused;
+ }
+ set
+ {
+ mIsPaused = value;
+
+ if (mIsPaused)
+ mVoice.Stop();
+ else
+ mVoice.Start();
+ }
+ }
+
+ public override double Volume
+ {
+ get { return mVolume; }
+ set
+ {
+ mVoice.SetVolume((float)value);
+ mVolume = value;
+ }
+ }
+
+ public override bool IsPlaying
+ {
+ get
+ {
+ return mIsPlaying;
+ }
+ }
+
+ public override double Pan
+ {
+ get { return mPan; }
+ set
+ {
+ SetPan(value);
+ }
+ }
+
+ private void SetPan(double value)
+ {
+ mPan = value;
+
+ // The description of this approach is found here:
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/hh405043%28v=vs.85%29.aspx
+
+ var outputChannels = (SpeakerConfigurations)mAudio.MasteringVoice.ChannelMask;
+ GetChannelVolumes((float)mPan);
+
+ float left = channelVolumes[0];
+ float right = channelVolumes[1];
+
+ switch (outputChannels)
+ {
+ case SpeakerConfigurations.SPEAKER_MONO:
+ outputMatrix[0] = 1.0f;
+ break;
+ case ...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-05 07:02:32
|
Revision: 1515
http://sourceforge.net/p/agate/code/1515
Author: kanato
Date: 2014-09-05 07:02:24 +0000 (Fri, 05 Sep 2014)
Log Message:
-----------
FileSystemProvider returns relative paths in GetAllFiles.
Modified Paths:
--------------
trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
Added Paths:
-----------
trunk/AgateLib.Tests/UnitTests/IO/
trunk/AgateLib.Tests/UnitTests/IO/FileSystemProviderTests.cs
Modified: trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-09-04 15:22:39 UTC (rev 1514)
+++ trunk/AgateLib.Platform.WinForms/IO/FileSystemProvider.cs 2014-09-05 07:02:24 UTC (rev 1515)
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Text;
using AgateLib.IO;
using System.Threading.Tasks;
@@ -32,6 +33,7 @@
public class FileSystemProvider : IReadFileProvider
{
string mPath;
+ Uri mPathUri;
/// <summary>
/// Constructs a FileSystemProvider object directing it to read files from the
@@ -41,6 +43,16 @@
public FileSystemProvider(string path)
{
mPath = path;
+
+ if (path.EndsWith("/") == false && path.EndsWith("\\") == false)
+ path += "/";
+
+ path = path.Replace('\\', '/');
+
+ if (path.StartsWith("./"))
+ path = Directory.GetCurrentDirectory() + path.Substring(1);
+
+ mPathUri = new Uri(path);
}
/// <summary>
/// Opens a file.
@@ -233,12 +245,26 @@
{
List<string> files = new List<string>();
- files.AddRange(Directory.GetFiles(mPath, searchPattern));
+ files.AddRange(Directory.GetFiles(mPath, searchPattern)
+ .Select(x => MakeRelativePath(x)));
return files;
}
/// <summary>
+ /// Constructs a path relative to the root of this file system provider.
+ /// </summary>
+ /// <param name="fullpath"></param>
+ /// <returns></returns>
+ public string MakeRelativePath(string fullpath)
+ {
+ var uri = new Uri(fullpath);
+ var rel = mPathUri.MakeRelativeUri(uri);
+
+ return rel.ToString();
+ }
+
+ /// <summary>
/// Returns a string representing the FileSystemProvider object.
/// </summary>
/// <returns></returns>
Modified: trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
===================================================================
--- trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-09-04 15:22:39 UTC (rev 1514)
+++ trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj 2014-09-05 07:02:24 UTC (rev 1515)
@@ -101,6 +101,7 @@
<Compile Include="Display\FontTests.cs" />
<Compile Include="Extensions\ListExtensions.cs" />
<Compile Include="Geometry\ColorTests.cs" />
+ <Compile Include="IO\FileSystemProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Platform\PlatformTests.cs" />
<Compile Include="Resources\SerializationTest.cs" />
Added: trunk/AgateLib.Tests/UnitTests/IO/FileSystemProviderTests.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/IO/FileSystemProviderTests.cs (rev 0)
+++ trunk/AgateLib.Tests/UnitTests/IO/FileSystemProviderTests.cs 2014-09-05 07:02:24 UTC (rev 1515)
@@ -0,0 +1,22 @@
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using AgateLib.Platform.WinForms.IO;
+
+namespace AgateLib.IO
+{
+ [TestClass]
+ public class FileSystemProviderTests
+ {
+ [TestMethod]
+ public void FspRelativePath()
+ {
+ FileSystemProvider fsp = new FileSystemProvider(@"c:\test\path");
+
+ Assert.AreEqual("to/somewhere.txt",
+ fsp.MakeRelativePath(@"c:\test\path\to\somewhere.txt"));
+
+ Assert.AreEqual("../alternate",
+ fsp.MakeRelativePath(@"c:\test\alternate"));
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-06 00:53:44
|
Revision: 1516
http://sourceforge.net/p/agate/code/1516
Author: kanato
Date: 2014-09-06 00:53:36 +0000 (Sat, 06 Sep 2014)
Log Message:
-----------
Fixes and cleanup to Css interpreter.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/ApplicationModels/AgateAppModel.cs
trunk/AgateLib/DisplayLib/ISurface.cs
trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs
trunk/AgateLib/UserInterface/Css/CssAdapter.cs
trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs
trunk/AgateLib/UserInterface/Css/CssStyle.cs
trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
trunk/AgateLib/UserInterface/Css/Extensions.cs
trunk/AgateLib/UserInterface/Css/ICssCanSelect.cs
trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorChain.cs
trunk/AgateLib/UserInterface/Css/Selectors/ICssSelector.cs
trunk/AgateLib.AgateSDL/Audio/SDL_Audio.cs
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssTestBase.cs
Added Paths:
-----------
trunk/AgateLib/ApplicationModels/ArgumentEventArgs.cs
trunk/AgateLib/DisplayLib/IDrawable.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssMediaIndividualSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssMediaSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorIndividual.cs
trunk/AgateLib/UserInterface/Css/Selectors/ICssMediaSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
trunk/AgateLib/UserInterface/Widgets/ImageBox.cs
trunk/AgateLib/UserInterface/Widgets/LabelImage.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssAdapterTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssParseTest.cs
Removed Paths:
-------------
trunk/AgateLib/UserInterface/Css/Documents/CssMediaSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorGroup.cs
trunk/AgateLib/UserInterface/Widgets/ImageDisplay.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/AdapterTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/BindingTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/LayoutTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/ParseTest.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-06 00:53:36 UTC (rev 1516)
@@ -48,6 +48,7 @@
<Compile Include="Algorithms\PathFinding\AStarNode.cs" />
<Compile Include="Algorithms\PathFinding\AStarState.cs" />
<Compile Include="Algorithms\Inverting.cs" />
+ <Compile Include="ApplicationModels\ArgumentEventArgs.cs" />
<Compile Include="ApplicationModels\PassiveModelParameters.cs" />
<Compile Include="ApplicationModels\SceneModelParameters.cs" />
<Compile Include="ApplicationModels\SerialModelParameters.cs" />
@@ -508,12 +509,13 @@
<Compile Include="UserInterface\Css\Documents\CssBorder.cs" />
<Compile Include="UserInterface\Css\Documents\CssBorderImage.cs" />
<Compile Include="UserInterface\Css\Documents\CssBoxComponent.cs" />
+ <Compile Include="UserInterface\Css\Selectors\CssMediaSelector.cs" />
<Compile Include="UserInterface\Css\Documents\PropertyEnums.cs" />
<Compile Include="UserInterface\Css\Documents\CssDistance.cs" />
<Compile Include="UserInterface\Css\Documents\CssDocument.cs" />
<Compile Include="UserInterface\Css\Documents\CssFont.cs" />
<Compile Include="UserInterface\Css\Documents\CssLayout.cs" />
- <Compile Include="UserInterface\Css\Documents\CssMediaSelector.cs" />
+ <Compile Include="UserInterface\Css\Selectors\CssMediaIndividualSelector.cs" />
<Compile Include="UserInterface\Css\CssPseudoClass.cs" />
<Compile Include="UserInterface\Css\Documents\CssRectangle.cs" />
<Compile Include="UserInterface\Css\CssRuleBlock.cs" />
@@ -547,10 +549,12 @@
<Compile Include="UserInterface\Css\Rendering\Transitions\SlideTransition.cs" />
<Compile Include="UserInterface\Css\Rendering\Transitions\TransitionFactory.cs" />
<Compile Include="UserInterface\Css\Rendering\WidgetAnimator.cs" />
+ <Compile Include="UserInterface\Css\Selectors\CssSelectorIndividual.cs" />
+ <Compile Include="UserInterface\Css\Selectors\CssSelectorChain.cs" />
<Compile Include="UserInterface\Css\Selectors\CssSelector.cs" />
- <Compile Include="UserInterface\Css\Selectors\CssSelectorChain.cs" />
- <Compile Include="UserInterface\Css\Selectors\CssSelectorGroup.cs" />
+ <Compile Include="UserInterface\Css\Selectors\ICssMediaSelector.cs" />
<Compile Include="UserInterface\Css\Selectors\ICssSelector.cs" />
+ <Compile Include="UserInterface\Css\Selectors\WidgetMatchParameters.cs" />
<Compile Include="UserInterface\IAudioPlayer.cs" />
<Compile Include="UserInterface\ISurfaceProvider.cs" />
<Compile Include="UserInterface\Widgets\Container.cs" />
@@ -558,12 +562,14 @@
<Compile Include="UserInterface\Widgets\Gui.cs" />
<Compile Include="UserInterface\Widgets\GuiInput.cs" />
<Compile Include="UserInterface\Widgets\GuiSound.cs" />
+ <Compile Include="DisplayLib\IDrawable.cs" />
<Compile Include="UserInterface\Widgets\IGuiLayoutEngine.cs" />
<Compile Include="UserInterface\Widgets\IGuiRenderer.cs" />
- <Compile Include="UserInterface\Widgets\ImageDisplay.cs" />
+ <Compile Include="UserInterface\Widgets\ImageBox.cs" />
<Compile Include="UserInterface\Widgets\InputMap.cs" />
<Compile Include="UserInterface\Widgets\KeyboardEventArgs.cs" />
<Compile Include="UserInterface\Widgets\Label.cs" />
+ <Compile Include="UserInterface\Widgets\LabelImage.cs" />
<Compile Include="UserInterface\Widgets\Menu.cs" />
<Compile Include="UserInterface\Widgets\MenuItem.cs" />
<Compile Include="UserInterface\Widgets\MouseEventArgs.cs" />
Modified: trunk/AgateLib/ApplicationModels/AgateAppModel.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -215,10 +215,30 @@
/// </remarks>
protected virtual void ProcessCustomArgument(string arg, IList<string> parm)
{
- Log.WriteLine("Unknown command line argument:");
- Log.WriteLine(" {0} {1}", arg, string.Join(" ", parm));
+ OnUnhandledArgument(arg, parm);
}
+ private void OnUnhandledArgument(string arg, IList<string> parm)
+ {
+ bool handled = false;
+ if (UnhandledArgument != null)
+ {
+ var args = new ArgumentEventArgs(arg, parm);
+
+ UnhandledArgument(this, args);
+
+ handled = args.Handled;
+ }
+
+ if (handled == false)
+ {
+ Log.WriteLine("Unknown command line argument:");
+ Log.WriteLine(" {0} {1}", arg, string.Join(" ", parm));
+ }
+ }
+
+ public event EventHandler<ArgumentEventArgs> UnhandledArgument;
+
protected void PrerunInitialization()
{
SetPlatformEmulation();
Added: trunk/AgateLib/ApplicationModels/ArgumentEventArgs.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/ArgumentEventArgs.cs (rev 0)
+++ trunk/AgateLib/ApplicationModels/ArgumentEventArgs.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.ApplicationModels
+{
+ public class ArgumentEventArgs : EventArgs
+ {
+ private string arg;
+ private IList<string> parm;
+
+ public ArgumentEventArgs(string arg, IList<string> parm)
+ {
+ // TODO: Complete member initialization
+ this.arg = arg;
+ this.parm = parm;
+ }
+
+ public string Argument { get { return arg; } }
+ public IEnumerable<string> Parameters { get { return parm; } }
+ public bool Handled { get; set; }
+ }
+}
Added: trunk/AgateLib/DisplayLib/IDrawable.cs
===================================================================
--- trunk/AgateLib/DisplayLib/IDrawable.cs (rev 0)
+++ trunk/AgateLib/DisplayLib/IDrawable.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -0,0 +1,15 @@
+using AgateLib.Geometry;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.DisplayLib
+{
+ public interface IDrawable
+ {
+ void Draw(Point point);
+
+ Size DisplaySize { get; set; }
+ }
+}
Modified: trunk/AgateLib/DisplayLib/ISurface.cs
===================================================================
--- trunk/AgateLib/DisplayLib/ISurface.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/DisplayLib/ISurface.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -24,7 +24,7 @@
/// <summary>
/// Public Surface interface.
/// </summary>
- public interface ISurface : IDisposable
+ public interface ISurface : IDisposable, IDrawable
{
/// <summary>
/// Gets or sets the alpha value for the surface.
Modified: trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Binders/CssTypeConverter.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -53,8 +53,12 @@
return true;
}
- if (value.StartsWith("#"))
+ if (value == "none")
{
+ return true;
+ }
+ else if (value.StartsWith("#"))
+ {
string subtext = value.Substring(1);
if (subtext.Length == 3)
Modified: trunk/AgateLib/UserInterface/Css/CssAdapter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -211,15 +211,11 @@
var control = style.Widget;
style.Cache.Id = control.Name;
- style.Cache.PseudoClass = GetPseudoClass(control);
+ style.Cache.PseudoClass = style.MatchParameters.PseudoClass;
- var classes = GetCssClasses(style);
-
style.Cache.CssClasses.Clear();
+ style.Cache.CssClasses.AddRange(style.MatchParameters.Classes);
- if (classes != null)
- style.Cache.CssClasses.AddRange(classes);
-
control.LayoutDirty = false;
}
private bool NeedStyleRefresh(Widget control)
@@ -227,12 +223,12 @@
CssStyle style = mObjectStyles[control];
if (control.LayoutDirty) return true;
+ style.MatchParameters.UpdateWidgetProperties();
- string id = control.Name;
- IEnumerable<string> classes = GetCssClasses(style);
+ IEnumerable<string> classes = style.MatchParameters.Classes;
- if (style.Cache.Id != id) return true;
- if (style.Cache.PseudoClass != GetPseudoClass(control)) return true;
+ if (style.Cache.Id != style.MatchParameters.Id) return true;
+ if (style.Cache.PseudoClass != style.MatchParameters.PseudoClass) return true;
if (classes != null)
{
if (style.Cache.CssClasses.All(x => classes.Contains(x)) == false) return true;
@@ -250,7 +246,6 @@
return;
mDefaultStyles[style.Widget.GetType()].InheritParentProperties(style, GetStyle(style.Widget.Parent));
-
}
private void ReportError(string p)
@@ -267,15 +262,13 @@
private void AssignApplicableBlocks(CssStyle style)
{
- var control = style.Widget;
- string id = control.Name;
- IEnumerable<string> classes = GetCssClasses(style);
+ style.MatchParameters.UpdateWidgetProperties();
foreach (var medium in ApplicableMedia)
{
foreach (var block in medium.RuleBlocks)
{
- if (BlockAppliesTo(block, control, id, classes))
+ if (BlockAppliesTo(block, style.MatchParameters))
{
if (style.AppliedBlocks.Contains(block) == false)
{
@@ -293,60 +286,23 @@
}
}
- private bool BlockAppliesTo(CssRuleBlock block, Widget control, string id,
- IEnumerable<string> classes)
+ private bool BlockAppliesTo(CssRuleBlock block, WidgetMatchParameters wmp)
{
- CssPseudoClass pseudoClass = GetPseudoClass(control);
-
foreach (var selector in block.Selector.IndividualSelectors)
{
- if (SelectorAppliesTo(selector, control, id, pseudoClass, classes))
+ if (SelectorAppliesTo(selector, wmp))
return true;
}
return false;
}
- private CssPseudoClass GetPseudoClass(Widget control)
- {
- if (control.MouseIn)
- return CssPseudoClass.Hover;
- if (control is Container)
- {
- Container container = (Container)control;
- if (container.ChildHasMouseIn)
- return CssPseudoClass.Hover;
- }
- if (control is MenuItem)
- {
- MenuItem mnuit = (MenuItem)control;
-
- if (mnuit.Selected)
- return CssPseudoClass.Selected;
- }
-
- return CssPseudoClass.None;
- }
-
- private bool SelectorAppliesTo(ICssSelector selector, Widget control,
- string id, CssPseudoClass pseudoClass, IEnumerable<string> classes)
+ private bool SelectorAppliesTo(ICssSelector selector, WidgetMatchParameters wmp)
{
- return selector.Matches(control, id, pseudoClass, classes);
+ return selector.Matches(this, wmp);
}
- private IEnumerable<string> GetCssClasses(CssStyle style)
- {
- Widget control = style.Widget;
-
- if (control.Style != style.ObjectClass)
- {
- style.ObjectClass = control.Style;
- }
-
- return style.SplitClasses;
- }
-
public CssMediumInfo MediumInfo { get; set; }
public IEnumerable<CssMediaSelector> ApplicableMedia
@@ -357,17 +313,17 @@
foreach (var medium in Document.Media)
{
- if (MediaSelectorApplies(medium.Selector, MediumInfo))
+ if (MediaSelectorApplies(medium, MediumInfo))
yield return medium;
}
}
}
- private bool MediaSelectorApplies(CssSelectorGroup selectorGroup, CssMediumInfo medium)
+ private bool MediaSelectorApplies(CssMediaSelector selectorGroup, CssMediumInfo medium)
{
foreach (var sel in selectorGroup.IndividualSelectors)
{
- if (sel.Matches(medium.MediaType.ToString(), null, CssPseudoClass.None, null))
+ if (sel.Matches(medium.MediaType.ToString()))
return true;
}
Modified: trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -41,7 +41,7 @@
public Dictionary<string, Binding> Bindings { get; private set; }
public Dictionary<string, string> Properties { get; private set; }
- public CssSelectorGroup Selector { get; set; }
+ public CssSelector Selector { get; set; }
public override string ToString()
{
Modified: trunk/AgateLib/UserInterface/Css/CssStyle.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssStyle.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/CssStyle.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -19,6 +19,7 @@
using AgateLib.UserInterface.Css.Cache;
using AgateLib.UserInterface.Css.Layout;
using AgateLib.UserInterface.Css.Rendering;
+using AgateLib.UserInterface.Css.Selectors;
using AgateLib.UserInterface.Widgets;
using System;
using System.Collections.Generic;
@@ -44,6 +45,8 @@
Cache = new StyleCache();
Animator = new WidgetAnimator(this);
+
+ MatchParameters = new WidgetMatchParameters(widget);
}
public CssStyleData Data { get; set; }
@@ -52,24 +55,6 @@
public Widget Widget { get; set; }
- public string ObjectClass
- {
- get { return mClassValue; }
- set
- {
- if (value == null) throw new ArgumentNullException();
- if (mClassValue.Equals(value, StringComparison.OrdinalIgnoreCase))
- return;
-
- mClassValue = value.ToLowerInvariant();
- mSplitClasses = ObjectClass
- .Split(Extensions.WhiteSpace, StringSplitOptions.RemoveEmptyEntries)
- .ToList();
-
- mSplitClasses.Sort();
- }
- }
-
public IEnumerable<string> SplitClasses { get { return mSplitClasses; } }
public List<CssRuleBlock> AppliedBlocks { get; private set; }
@@ -85,5 +70,7 @@
}
public AgateLib.DisplayLib.Font Font { get; set; }
+
+ public WidgetMatchParameters MatchParameters { get; private set; }
}
}
Modified: trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -17,6 +17,7 @@
// Contributor(s): Erik Ylvisaker
//
using AgateLib.UserInterface.Css.Binders;
+using AgateLib.UserInterface.Css.Selectors;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -31,7 +32,7 @@
public CssDocument()
{
- var defaultMedium = new CssMediaSelector { Selector = "all" };
+ var defaultMedium = new CssMediaSelector("all");
Media.Add(defaultMedium);
}
public static CssDocument Load(string filename)
@@ -56,6 +57,6 @@
public List<CssMediaSelector> Media { get { return mMedia; } }
- public CssMediaSelector DefaultMedium { get { return mMedia.First(x => x.Selector.Text == "all"); } }
+ public CssMediaSelector DefaultMedium { get { return mMedia.First(); } }
}
}
Deleted: trunk/AgateLib/UserInterface/Css/Documents/CssMediaSelector.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssMediaSelector.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssMediaSelector.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -1,38 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using AgateLib.UserInterface.Css.Selectors;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AgateLib.UserInterface.Css
-{
- public class CssMediaSelector : ICssCanSelect
- {
- public CssMediaSelector()
- {
- RuleBlocks = new List<CssRuleBlock>();
- }
-
- public CssSelectorGroup Selector { get;set;}
- public List<CssRuleBlock> RuleBlocks { get; private set; }
- }
-}
Modified: trunk/AgateLib/UserInterface/Css/Extensions.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Extensions.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Extensions.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -38,10 +38,14 @@
throw new Exception("the value is not found in the dictionary");
}
- public static T FindExactMatch<T>(this IEnumerable<T> list, CssSelectorGroup selector) where T : ICssCanSelect
+ public static CssRuleBlock FindExactMatch(this IEnumerable<CssRuleBlock> list, CssSelector selector)
{
return list.SingleOrDefault(x => x.Selector.Equals(selector));
}
+ public static CssMediaSelector FindExactMatch(this IEnumerable<CssMediaSelector> list, CssMediaSelector selector)
+ {
+ return list.SingleOrDefault(x => x.Equals(selector));
+ }
internal static readonly char[] WhiteSpace = new char[] { ' ', '\r', '\n', '\t' };
}
Modified: trunk/AgateLib/UserInterface/Css/ICssCanSelect.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/ICssCanSelect.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/ICssCanSelect.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -27,6 +27,6 @@
{
public interface ICssCanSelect
{
- CssSelectorGroup Selector { get; set; }
+ CssSelector Selector { get; set; }
}
}
Modified: trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -42,7 +42,6 @@
int index;
CssMediaSelector defaultMedium;
-
CssMediaSelector currentMedium;
CssRuleBlock currentBlock;
@@ -153,7 +152,7 @@
private void ParseBlock(string token)
{
- CssSelectorGroup selector = ReadSelector(token);
+ CssSelector selector = ReadSelector(token);
currentBlock = currentMedium.RuleBlocks.FindExactMatch(selector);
@@ -172,13 +171,13 @@
{
if (rule.StartsWith("@media"))
{
- CssSelectorGroup selector = ReadSelector();
+ CssMediaSelector selector = ReadMediaSelector();
currentMedium = target.Media.FindExactMatch(selector);
if (currentMedium == null)
{
- currentMedium = new CssMediaSelector { Selector = selector };
+ currentMedium = selector;
target.Media.Add(currentMedium);
}
@@ -188,12 +187,17 @@
}
}
- private CssSelectorGroup ReadSelector(string startText = "")
+ private CssSelector ReadSelector(string startText = "")
{
- return new CssSelectorGroup(ReadUntilToken(startText, CssTokenType.BlockOpen));
+ return new CssSelector(ReadUntilToken(startText, CssTokenType.BlockOpen));
}
+ private CssMediaSelector ReadMediaSelector(string startText = "")
+ {
+ return new CssMediaSelector(ReadUntilToken(startText, CssTokenType.BlockOpen));
+ }
+
private string ReadPropertyName(string startText = "")
{
return ReadUntilToken(startText, CssTokenType.Colon);
Copied: trunk/AgateLib/UserInterface/Css/Selectors/CssMediaIndividualSelector.cs (from rev 1515, trunk/AgateLib/UserInterface/Css/Documents/CssMediaSelector.cs)
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/CssMediaIndividualSelector.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Css/Selectors/CssMediaIndividualSelector.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -0,0 +1,56 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using AgateLib.UserInterface.Css;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.UserInterface.Css.Selectors
+{
+ public class CssMediaIndividualSelector : ICssMediaSelector
+ {
+ public CssMediaIndividualSelector(string text)
+ {
+ Text = text.ToLowerInvariant();
+ Parse();
+ }
+
+ private void Parse()
+ {
+ }
+
+ public CssMediaSelector Selector { get; set; }
+
+ public string Text { get; set; }
+
+ public bool Matches(string type)
+ {
+ if (Text == "all")
+ return true;
+
+ if (Text == type)
+ return true;
+
+
+ return false;
+ }
+ }
+}
Added: trunk/AgateLib/UserInterface/Css/Selectors/CssMediaSelector.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/CssMediaSelector.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Css/Selectors/CssMediaSelector.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.UserInterface.Css.Selectors
+{
+ public class CssMediaSelector : IEquatable<CssMediaSelector>
+ {
+ public static implicit operator CssMediaSelector(string text)
+ {
+ return new CssMediaSelector { Text = text };
+ }
+
+ string mText;
+ static readonly char[] comma = new char[] { ',' };
+
+ public CssMediaSelector()
+ {
+ RuleBlocks = new List<CssRuleBlock>();
+ }
+ public CssMediaSelector(string text)
+ :this()
+ {
+ Text = text;
+ }
+
+ public string Text
+ {
+ get { return mText; }
+ set
+ {
+ mText = value;
+
+ IndividualSelectors = mText
+ .Split(comma, StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => CreateSelector(x.Trim()));
+ }
+ }
+
+ private ICssMediaSelector CreateSelector(string text)
+ {
+ if (text.Contains(" ") || text.Contains(">"))
+ {
+ throw new NotImplementedException();
+ }
+ else
+ return new CssMediaIndividualSelector(text);
+ }
+
+ public IEnumerable<ICssMediaSelector> IndividualSelectors { get; private set; }
+
+ public bool Equals(CssMediaSelector other)
+ {
+ return Text.Equals(other.Text, StringComparison.Ordinal);
+ }
+ public override bool Equals(object obj)
+ {
+ if (obj is CssMediaSelector)
+ return Equals((CssMediaSelector)obj);
+
+ return false;
+ }
+ public override int GetHashCode()
+ {
+ return Text.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return Text;
+ }
+
+ public List<CssRuleBlock> RuleBlocks { get; private set; }
+ }
+}
Deleted: trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs 2014-09-05 07:02:24 UTC (rev 1515)
+++ trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs 2014-09-06 00:53:36 UTC (rev 1516)
@@ -1,142 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2014.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AgateLib.UserInterface.Css.Selectors
-{
- public class CssSelector : ICssSelector
- {
- List<string> classes = new List<string>();
-
- public CssSelector(string text)
- {
- Text = text.ToLowerInvariant();
-
- Parse();
- }
-
- private void Parse()
- {
- if (Text.Contains(":"))
- {
- try
- {
- PseudoClass = (CssPseudoClass)Enum.Parse(typeof(CssPseudoClass), CutIdentifier(Text.IndexOf(":") + 1), true);
- }
- catch(Exception)
- {
-
- }
- }
- if (Text.Contains("#"))
- {
- Id = CutIdentifier(Text.IndexOf('#') + 1);
- }
-
- int dot = Text.IndexOf('.');
- while (dot >= 0)
- {
- var cls = CutIdentifier(dot + 1);
-
- if (cls != null)
- classes.Add(cls);
-
- dot = Text.IndexOf('.', dot + 1);
- }
-
- ObjectType = CutIdentifier(0);
-
- classes.Sort();
- }
-
- private string CutIdentifier(int start)
- {
- int nextToken = FindNextToken(".#:", start);
-
- if (nextToken == start)
- return null;
-
- if (nextToken == -1)
- return Text.Substring(start);
-
- return Text.Substring(start, nextToken - start);
- }
-
- private int FindNextToken(string tokens, int start)
- {
- int retval = int.MaxValue;
-
- for(int i = 0; i < tokens.Length; i++)
- {
- int current = Text.IndexOf(tokens[i], start);
-
- if (current == -1)
- continue;
-
- if (current < retval)
- retval = current;
- }
-
- if (retval == int.MaxValue)
- return -1;
-
- return retval;
- }
-
- public string Text { get; private set; }
-
- public string ObjectType { get; private set; }
- public string Id { get; private set; }
- public IList<string> CssClasses { get { return classes; } }
- public CssPseudoClass PseudoClass { get; private set; }
-
- public bool Matches(string typename, string id, CssPseudoClass pc, IEnumerable<string> classes)
- {
- if (ObjectType != null &&
- ObjectType.Equals(typename, StringComparison.OrdinalIgnoreCase)
- == false)
- {
- return false;
- }
-
- if (PseudoClass != CssPseudoClass.None && PseudoClass != pc)
- return false;
-
- if (Id != null)
- {
- if (Id.Equals(id, StringComparison.OrdinalIgnoreCase))
- return true;
- else
- return false;
- }
-
- foreach (var cls in CssClasses)
- {
- if (classes.Contains(cls) == false)
- return false;
- }
-
- return true;
- }
- }
-}
Copied: trunk/AgateLib/UserInterface/Css/Selectors/CssSelector.cs (from rev 1515, trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorGroup.cs)
...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-06 07:37:54
|
Revision: 1518
http://sourceforge.net/p/agate/code/1518
Author: kanato
Date: 2014-09-06 07:37:48 +0000 (Sat, 06 Sep 2014)
Log Message:
-----------
Fix to not allow multiple windows to be active at the same time.
Modified Paths:
--------------
trunk/AgateLib/Diagnostics/AgateConsole.cs
trunk/AgateLib/InputLib/InputHandlerList.cs
trunk/AgateLib/UserInterface/Css/CssAdapter.cs
trunk/AgateLib/UserInterface/Css/CssStyle.cs
trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
trunk/AgateLib/UserInterface/Widgets/Gui.cs
trunk/AgateLib/UserInterface/Widgets/Label.cs
trunk/AgateLib/UserInterface/Widgets/Widget.cs
trunk/AgateLib/UserInterface/Widgets/Window.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
Modified: trunk/AgateLib/Diagnostics/AgateConsole.cs
===================================================================
--- trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/Diagnostics/AgateConsole.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -56,6 +56,11 @@
throw new AgateException("You must initalize the console before making it visible.");
sInstance.mVisible = value;
+
+ if (sInstance.mVisible)
+ Input.InputHandlers.BringToTop(sInstance);
+ else
+ Input.InputHandlers.SendToBack(sInstance);
}
}
@@ -72,7 +77,7 @@
return;
sInstance = Core.Factory.PlatformFactory.CreateConsole();
- InputLib.Input.InputHandlers.Add(sInstance);
+ Input.InputHandlers.Add(sInstance);
PrivateInitialize();
}
Modified: trunk/AgateLib/InputLib/InputHandlerList.cs
===================================================================
--- trunk/AgateLib/InputLib/InputHandlerList.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/InputLib/InputHandlerList.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -58,5 +58,23 @@
break;
}
}
+
+ internal void BringToTop(IInputHandler handler)
+ {
+ if (mHandlers.Contains(handler) == false)
+ throw new InvalidOperationException("Cannot move a handler which is not registered.");
+
+ mHandlers.Remove(handler);
+ mHandlers.Add(handler);
+ }
+
+ internal void SendToBack(IInputHandler handler)
+ {
+ if (mHandlers.Contains(handler) == false)
+ throw new InvalidOperationException("Cannot move a handler which is not registered.");
+
+ mHandlers.Remove(handler);
+ mHandlers.Insert(0, handler);
+ }
}
}
Modified: trunk/AgateLib/UserInterface/Css/CssAdapter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -216,15 +216,16 @@
style.Cache.CssClasses.Clear();
style.Cache.CssClasses.AddRange(style.MatchParameters.Classes);
- control.LayoutDirty = false;
+ control.StyleDirty = false;
}
private bool NeedStyleRefresh(Widget control)
{
CssStyle style = mObjectStyles[control];
- if (control.LayoutDirty) return true;
style.MatchParameters.UpdateWidgetProperties();
+ if (control.StyleDirty) return true;
+
IEnumerable<string> classes = style.MatchParameters.Classes;
if (style.Cache.Id != style.MatchParameters.Id) return true;
Modified: trunk/AgateLib/UserInterface/Css/CssStyle.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssStyle.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Css/CssStyle.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -37,6 +37,7 @@
public CssStyle(Widget widget)
{
Widget = widget;
+
Data = new CssStyleData();
BoxModel = new CssBoxModel();
Modified: trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -32,24 +32,55 @@
private CssPseudoClass GetPseudoClass(Widget control)
{
- if (control.MouseIn)
- return CssPseudoClass.Hover;
- if (control is Container)
+ if (InActiveWindow(control))
{
- Container container = (Container)control;
+ if (control.MouseIn)
+ return CssPseudoClass.Hover;
+ if (control is Container)
+ {
+ Container container = (Container)control;
- if (container.ChildHasMouseIn)
- return CssPseudoClass.Hover;
+ if (container.ChildHasMouseIn)
+ return CssPseudoClass.Hover;
+ }
+ if (control is MenuItem)
+ {
+ MenuItem mnuit = (MenuItem)control;
+
+ if (mnuit.Selected)
+ return CssPseudoClass.Selected;
+ }
}
- if (control is MenuItem)
+
+ return CssPseudoClass.None;
+ }
+
+ private bool InActiveWindow(Widget control)
+ {
+ var window = TopWindow(control);
+
+ if (window == null)
+ return false;
+
+ if (window.IsActive)
+ return true;
+ else
+ return false;
+ }
+
+ private Window TopWindow(Widget control)
+ {
+ var retval = control;
+
+ while (retval != null && retval.Parent != null)
{
- MenuItem mnuit = (MenuItem)control;
+ if (retval.Parent is Desktop)
+ return retval as Window;
- if (mnuit.Selected)
- return CssPseudoClass.Selected;
+ retval = retval.Parent;
}
- return CssPseudoClass.None;
+ return null;
}
private IEnumerable<string> GetCssClasses(Widget control)
Modified: trunk/AgateLib/UserInterface/Widgets/Gui.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -371,7 +371,6 @@
//}
internal AgateLib.UserInterface.Css.Documents.CssDocument CssDocument { get; set; }
-
}
class WindowList : IList<Window>
Modified: trunk/AgateLib/UserInterface/Widgets/Label.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -42,8 +42,13 @@
if (value == null)
value = string.Empty;
- mText = value.Replace("\r", "");
+ value = value.Replace("\r", "");
+ if (value == mText)
+ return;
+ LayoutDirty = true;
+ mText = value;
+
if (WrapText)
{
RewrapText(Width);
Modified: trunk/AgateLib/UserInterface/Widgets/Widget.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Widget.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Widgets/Widget.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -37,6 +37,7 @@
private Color? mFontColor;
private bool mEnabled = true;
string mStyle = string.Empty;
+ bool mLayoutDirty;
public Widget()
{
@@ -274,7 +275,16 @@
}
}
- public virtual bool LayoutDirty { get; set; }
+ public virtual bool LayoutDirty
+ {
+ get { return mLayoutDirty; }
+ set
+ {
+ mLayoutDirty = value;
+ StyleDirty = true;
+ }
+ }
+ internal bool StyleDirty { get; set; }
protected virtual Gui MyGui
{
@@ -362,7 +372,7 @@
public bool TabStop { get; set; }
protected bool AcceptFocus { get; set; }
-
+
protected internal virtual Widget FindFocusWidget()
{
if (AcceptFocus)
Modified: trunk/AgateLib/UserInterface/Widgets/Window.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Window.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib/UserInterface/Widgets/Window.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -38,5 +38,16 @@
: base(contents)
{
}
+
+ public bool IsActive
+ {
+ get
+ {
+ if (Parent == null)
+ return false;
+
+ return ((Desktop)Parent).TopWindow == this;
+ }
+ }
}
}
Modified: trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -32,13 +32,24 @@
[TestMethod]
public void SelectorMatching()
{
+ Gui gui = new Gui(null, null);
+ Desktop desktop = new Desktop(gui);
+ Window window = new Window();
+ desktop.Children.Add(window);
+
var label1 = new WidgetMatchParameters( new Label { Name = "label1" });
var noname = new WidgetMatchParameters(new Label { });
var hover = new WidgetMatchParameters( new Label { MouseIn = true });
+ window.Children.Add(hover.Widget);
+
CssSelectorIndividual sel = new CssSelectorIndividual("label");
CssAdapter adapter = new CssAdapter(CssDocument.FromText(""));
+ label1.UpdateWidgetProperties();
+ noname.UpdateWidgetProperties();
+ hover.UpdateWidgetProperties();
+
Assert.IsTrue(sel.Matches(adapter, label1), "Failed match test 1.");
Assert.IsTrue(sel.Matches(adapter, noname), "Failed match test 2.");
Assert.IsTrue(sel.Matches(adapter, hover), "Failed match test 3.");
@@ -57,9 +68,13 @@
[TestMethod]
public void PseudoClassMatching()
{
+ Gui gui = new Gui(null, null);
+ Desktop desktop = new Desktop(gui);
+ Window wind = new Window();
+ desktop.Children.Add(wind);
+
CssDocument doc = CssDocument.FromText("window:hover { padding: 8px; }");
CssAdapter adapter = new CssAdapter(doc);
- Window wind = new Window();
wind.MouseIn = true;
var style = adapter.GetStyle(wind);
Modified: trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs 2014-09-06 01:50:57 UTC (rev 1517)
+++ trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs 2014-09-06 07:37:48 UTC (rev 1518)
@@ -24,7 +24,7 @@
CssAdapter adapter;
[TestInitialize]
- public void Init()
+ public void CssLInit()
{
Core.Initialize(new FakeAgateFactory());
Core.InitAssetLocations(new AssetLocations());
@@ -47,11 +47,13 @@
"window { layout: column; margin: 6px; padding: 8px;} label { margin-left: 4px; } " +
"window.fixed { position: fixed; right: 4px; bottom: 8px; margin: 14px; padding: 9px; border: 2px; } "+
"window.fixedleft { position: fixed; left: 4px; top: 8px; margin: 14px; padding: 9px; border: 2px; }");
+
adapter = new CssAdapter(doc, ff);
engine = new CssLayoutEngine(adapter);
- gui = new Gui(new FakeRenderer(), engine);
+ gui = new Gui(new FakeRenderer(), engine);
+
Core.Initialize(new FakeAgateFactory());
Core.InitAssetLocations(new AssetLocations());
@@ -68,7 +70,7 @@
}
[TestMethod]
- public void BoxModel()
+ public void CssLBoxModel()
{
CssDocument doc = CssDocument.FromText("window { border: 5px solid black; padding: 10px; margin: 20px; }");
CssAdapter adapter = new CssAdapter(doc);
@@ -80,7 +82,7 @@
}
[TestMethod]
- public void ColumnLayout()
+ public void CssLColumnLayout()
{
int fh = ff.FontHeight;
@@ -99,7 +101,7 @@
[TestMethod]
- public void FixedRightBottom()
+ public void CssLFixedRightBottom()
{
Window wind = new Window() { Style = "fixed" };
gui.Desktop.Children.Add(wind);
@@ -111,7 +113,7 @@
}
[TestMethod]
- public void FixedTopLeft()
+ public void CssLFixedTopLeft()
{
Window wind = new Window() { Style = "fixedleft" };
gui.Desktop.Children.Add(wind);
@@ -121,5 +123,62 @@
Assert.AreEqual(18, wind.WidgetRect.Left);
Assert.AreEqual(22, wind.WidgetRect.Top);
}
+
+ [TestMethod]
+ public void CssLNestedContainers()
+ {
+ Window wind = new Window();
+ Menu mnu = new Menu();
+ Container c = new Container();
+ ImageBox ib = new ImageBox();
+ Label lbl1 = new Label("Test1");
+ Label lbl2 = new Label("Test2");
+
+ c.Children.AddRange(new Widget[] { ib, lbl1, lbl2 });
+ mnu.Children.Add(new MenuItem(c));
+ wind.Children.Add(mnu);
+
+ gui.Desktop.Children.Add(wind);
+
+ RedoLayout();
+
+ Assert.AreEqual(40, ff.MeasureString(lbl1.Text).Width);
+ Assert.AreEqual(new Rectangle(100, 0, 40, 8), lbl1.WidgetRect);
+ Assert.AreEqual(new Rectangle(144, 0, 40, 8), lbl2.WidgetRect);
+ Assert.AreEqual(new Rectangle(0, 0, 96, 96), ib.WidgetRect);
+ }
+ [TestMethod]
+ public void CssLNestedContainersWithUpdate()
+ {
+ Window wind = new Window();
+ Menu mnu = new Menu();
+ Container c = new Container();
+ ImageBox ib = new ImageBox();
+ Label lbl1 = new Label("Test1");
+ Label lbl2 = new Label("Test2");
+
+ c.Children.AddRange(new Widget[] { ib, lbl1, lbl2 });
+ mnu.Children.Add(new MenuItem(c));
+ wind.Children.Add(mnu);
+
+ gui.Desktop.Children.Add(wind);
+
+ RedoLayout();
+
+ Assert.AreEqual(40, ff.MeasureString(lbl1.Text).Width);
+ Assert.AreEqual(new Rectangle(100, 0, 40, 8), lbl1.WidgetRect);
+ Assert.AreEqual(new Rectangle(144, 0, 40, 8), lbl2.WidgetRect);
+ Assert.AreEqual(new Rectangle(0, 0, 96, 96), ib.WidgetRect);
+
+ lbl1.Text = "Test1Test2Test3";
+
+ RedoLayout();
+
+ Assert.AreEqual(120, ff.MeasureString(lbl1.Text).Width);
+ Assert.AreEqual(new Rectangle(100, 0, 120, 8), lbl1.WidgetRect);
+ Assert.AreEqual(new Rectangle(224, 0, 40, 8), lbl2.WidgetRect);
+ Assert.AreEqual(new Rectangle(0, 0, 96, 96), ib.WidgetRect);
+
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-07 22:49:51
|
Revision: 1519
http://sourceforge.net/p/agate/code/1519
Author: kanato
Date: 2014-09-07 22:49:41 +0000 (Sun, 07 Sep 2014)
Log Message:
-----------
Several CSS fixes and refactorings in the UI portion of the code.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/UserInterface/Css/CssAdapter.cs
trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs
trunk/AgateLib/UserInterface/Css/CssStyleData.cs
trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
trunk/AgateLib/UserInterface/Css/Documents/CssFont.cs
trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs
trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
trunk/AgateLib/UserInterface/Css/Layout/Defaults/DefaultStyleCollection.cs
trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs
trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs
trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
trunk/AgateLib/UserInterface/Widgets/Container.cs
trunk/AgateLib/UserInterface/Widgets/Label.cs
trunk/AgateLib/UserInterface/Widgets/LabelImage.cs
trunk/AgateLib/UserInterface/Widgets/Panel.cs
trunk/AgateLib/UserInterface/Widgets/ProgressBar.cs
trunk/AgateLib/UserInterface/Widgets/Widget.cs
trunk/AgateLib/UserInterface/Widgets/WidgetList.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/UnitTests/AgateLib.Tests.UnitTests.csproj
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Widgets/ConversionTests.cs
Added Paths:
-----------
trunk/AgateLib/UserInterface/Css/Documents/CssText.cs
trunk/AgateLib/UserInterface/Css/Layout/Defaults/ProgressBarDefaultStyle.cs
trunk/AgateLib/UserInterface/Widgets/Extensions/
trunk/AgateLib/UserInterface/Widgets/Extensions/WidgetExtensions.cs
trunk/AgateLib/UserInterface/Widgets/ITextAlignment.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeGuiEngine.cs
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-07 22:49:41 UTC (rev 1519)
@@ -509,6 +509,8 @@
<Compile Include="UserInterface\Css\Documents\CssBorder.cs" />
<Compile Include="UserInterface\Css\Documents\CssBorderImage.cs" />
<Compile Include="UserInterface\Css\Documents\CssBoxComponent.cs" />
+ <Compile Include="UserInterface\Css\Documents\CssText.cs" />
+ <Compile Include="UserInterface\Css\Layout\Defaults\ProgressBarDefaultStyle.cs" />
<Compile Include="UserInterface\Css\Selectors\CssMediaSelector.cs" />
<Compile Include="UserInterface\Css\Documents\PropertyEnums.cs" />
<Compile Include="UserInterface\Css\Documents\CssDistance.cs" />
@@ -559,6 +561,7 @@
<Compile Include="UserInterface\ISurfaceProvider.cs" />
<Compile Include="UserInterface\Widgets\Container.cs" />
<Compile Include="UserInterface\Widgets\Desktop.cs" />
+ <Compile Include="UserInterface\Widgets\Extensions\WidgetExtensions.cs" />
<Compile Include="UserInterface\Widgets\Gui.cs" />
<Compile Include="UserInterface\Widgets\GuiInput.cs" />
<Compile Include="UserInterface\Widgets\GuiSound.cs" />
@@ -567,6 +570,7 @@
<Compile Include="UserInterface\Widgets\IGuiRenderer.cs" />
<Compile Include="UserInterface\Widgets\ImageBox.cs" />
<Compile Include="UserInterface\Widgets\InputMap.cs" />
+ <Compile Include="UserInterface\Widgets\ITextAlignment.cs" />
<Compile Include="UserInterface\Widgets\KeyboardEventArgs.cs" />
<Compile Include="UserInterface\Widgets\Label.cs" />
<Compile Include="UserInterface\Widgets\LabelImage.cs" />
Modified: trunk/AgateLib/UserInterface/Css/CssAdapter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -40,7 +40,7 @@
internal CssAdapter(CssDocument doc)
{
Document = doc;
-
+ Document.Updated += Document_Updated;
MediumInfo = new CssMediumInfo();
switch (Core.Platform.DeviceType)
@@ -114,6 +114,7 @@
{
int scale = 1;
double amount = distance.Amount;
+ Font font = null;
switch (distance.DistanceUnit)
{
@@ -134,7 +135,7 @@
break;
case DistanceUnit.FontHeight:
- var font = style.Widget.Font;
+ font = style.Widget.Font;
if (font != null)
scale = font.FontHeight;
@@ -143,6 +144,16 @@
break;
+ case DistanceUnit.FontAverageWidth:
+ font = style.Widget.Font;
+
+ if (font != null)
+ scale = font.FontHeight / 2;
+ else
+ scale = 0;
+
+ break;
+
default:
throw new NotImplementedException();
}
@@ -330,5 +341,26 @@
return false;
}
+
+
+ void Document_Updated(object sender, EventArgs e)
+ {
+ foreach (var widget in mObjectStyles.Keys)
+ {
+ widget.LayoutDirty = true;
+ widget.StyleDirty = true;
+
+ mObjectStyles[widget].AppliedBlocks.Clear();
+ }
+ }
+
+
+ public void SetFont(Widget control)
+ {
+ var style = GetStyle(control);
+
+ control.Font = style.Font;
+ control.Font.Style = style.Data.Font.Weight;
+ }
}
}
Modified: trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/CssRuleBlock.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -52,9 +52,9 @@
public void AddProperty(string name, string value)
{
- Properties.Add(name, value);
+ Properties[name] = value;
- Bindings.Add(name, new Binding(map, name, value));
+ Bindings[name] = new Binding(map, name, value);
}
Modified: trunk/AgateLib/UserInterface/Css/CssStyleData.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssStyleData.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/CssStyleData.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -46,6 +46,7 @@
Border = new CssBorder();
Layout = new CssLayout();
Transition = new CssTransition();
+ Text = new CssText();
Display = CssDisplay.Initial;
}
@@ -77,5 +78,8 @@
[CssPromoteProperties(prefix: "transition")]
public CssTransition Transition { get; set; }
+
+ [CssPromoteProperties]
+ public CssText Text { get; set; }
}
}
Modified: trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -32,31 +32,55 @@
public CssDocument()
{
+ Clear();
+ }
+
+ public static CssDocument FromText(string css)
+ {
+ CssDocument doc = new CssDocument();
+
+ doc.Parse(css);
+
+ return doc;
+ }
+
+ public void Clear()
+ {
+ mMedia.Clear();
+
var defaultMedium = new CssMediaSelector("all");
Media.Add(defaultMedium);
}
- public static CssDocument Load(string filename)
+
+ public void Load(string filename)
{
- CssDocument doc = new CssDocument();
CssParser parser = new CssParser();
- parser.Load(doc, filename);
+ parser.Load(this, filename);
- return doc;
+ OnUpdated();
}
- public static CssDocument FromText(string text)
+ public void Parse(string css)
{
- CssDocument doc = new CssDocument();
CssParser parser = new CssParser();
- parser.ParseCss(doc, text);
+ parser.ParseCss(this, css);
- return doc;
+ OnUpdated();
}
+ private void OnUpdated()
+ {
+ if (Updated != null)
+ Updated(this, EventArgs.Empty);
+ }
+
public List<CssMediaSelector> Media { get { return mMedia; } }
public CssMediaSelector DefaultMedium { get { return mMedia.First(); } }
+
+
+ public event EventHandler Updated;
}
}
Modified: trunk/AgateLib/UserInterface/Css/Documents/CssFont.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssFont.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssFont.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -1,4 +1,5 @@
-// The contents of this file are subject to the Mozilla Public License
+using AgateLib.DisplayLib;
+// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
@@ -40,7 +41,12 @@
[CssAlias("font-size")]
public CssDistance Size { get; set; }
+ [CssAlias("font-weight")]
+ public FontStyles Weight { get; set; }
+
public Color Color { get; set; }
}
+
+
}
Added: trunk/AgateLib/UserInterface/Css/Documents/CssText.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssText.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssText.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -0,0 +1,15 @@
+using AgateLib.UserInterface.Css.Binders;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.UserInterface.Css.Documents
+{
+ public class CssText
+ {
+ [CssAlias("text-align")]
+ public CssTextAlign Align { get; set; }
+ }
+}
Modified: trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -28,6 +28,7 @@
{
Initial,
None,
+ Block,
}
public enum CssTransitionType
@@ -103,4 +104,13 @@
Absolute,
Fixed,
}
+
+ public enum CssTextAlign
+ {
+ Inherit,
+ Initial,
+ Left,
+ Right,
+ Center,
+ }
}
Modified: trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -46,6 +46,7 @@
totalRefresh |= gui.Desktop.Width != renderTargetSize.Width;
totalRefresh |= gui.Desktop.Height != renderTargetSize.Height;
+ totalRefresh |= gui.Desktop.LayoutDirty;
gui.Desktop.Width = renderTargetSize.Width;
gui.Desktop.Height = renderTargetSize.Height;
@@ -54,7 +55,14 @@
RedoLayout(gui.Desktop, totalRefresh);
- RedoFixedLayout(gui.Desktop);
+ if (totalRefresh || gui.Desktop.Descendants.Any(x => x.LayoutDirty))
+ {
+ RedoFixedLayout(gui.Desktop);
+
+ gui.Desktop.LayoutDirty = false;
+ foreach (var w in gui.Desktop.Descendants)
+ w.LayoutDirty = false;
+ }
}
private void SetDesktopAnimatorProperties(Desktop desktop)
@@ -62,12 +70,16 @@
var style = mAdapter.GetStyle(desktop);
style.Animator.ClientRect = new Rectangle(0, 0, desktop.Width, desktop.Height);
- style.Animator.WidgetSize = new Size(desktop.Width, desktop.Height);
}
private void RedoFixedLayout(Desktop desktop)
{
- foreach (var child in desktop.Descendants)
+ var deskStyle = mAdapter.GetStyle(desktop);
+ deskStyle.Animator.ClientRect = new Rectangle(0, 0, desktop.Width, desktop.Height);
+
+ foreach (var child in desktop.Descendants.Where(x => {
+ var pos = mAdapter.GetStyle(x).Data.Position;
+ return pos == CssPosition.Absolute || pos == CssPosition.Fixed;} ))
{
var style = mAdapter.GetStyle(child);
var sz = style.Animator.ClientRect.Size;
@@ -97,7 +109,7 @@
if (position.Right.Automatic == false)
{
int targetRight = ConvertDistance(style.Widget, position.Right, true, false).Value;
- targetRight = parentStyle.Animator.WidgetSize.Width - targetRight;
+ targetRight = parentStyle.Animator.ClientRect.Width - targetRight;
anim.ClientRect.X = targetRight - anim.ClientRect.Width - box.Right;
}
@@ -110,7 +122,7 @@
if (position.Bottom.Automatic == false)
{
int targetBottom = ConvertDistance(style.Widget, position.Bottom, false, false).Value;
- targetBottom = parentStyle.Animator.WidgetSize.Height - targetBottom;
+ targetBottom = parentStyle.Animator.ClientRect.Height - targetBottom;
anim.ClientRect.Y = targetBottom - anim.ClientRect.Height - box.Bottom;
}
@@ -123,21 +135,24 @@
var containerAnim = containerStyle.Animator;
CssBoxModel containerBox = containerStyle.BoxModel;
- containerAnim.ClientRect.X = 0;
- containerAnim.ClientRect.Y = 0;
-
if (forceRefresh == false)
{
- if (container.Descendants.Any(x => x.LayoutDirty) == false)
+ if (container.LayoutDirty == false &&
+ container.Descendants.Any(x => x.LayoutDirty) == false)
+ {
return;
+ }
}
+ containerAnim.ClientRect.X = 0;
+ containerAnim.ClientRect.Y = 0;
+
int maxWidth = ComputeMaxWidthForContainer(containerStyle);
Point nextPos = Point.Empty;
int maxHeight = 0;
maxWidth -= containerBox.Left + containerBox.Right;
-
+
int largestWidth = 0;
int bottom = 0;
@@ -148,12 +163,19 @@
if (fixedContainerWidth != null)
maxWidth = (int)fixedContainerWidth;
+ bool resetNextPosition = false;
+
foreach (var child in container.Children)
{
var style = mAdapter.GetStyle(child);
child.Font = style.Font;
- var sz = ComputeSize(child, containerStyle);
+ if (child.Visible == false)
+ continue;
+ if (style.Data.Display == CssDisplay.None)
+ continue;
+
+ var sz = ComputeSize(child, containerStyle, forceRefresh);
var box = style.BoxModel;
int? fixedWidth = ConvertDistance(child, style.Data.PositionData.Width, true);
int? fixedHeight = ConvertDistance(child, style.Data.PositionData.Height, false);
@@ -161,10 +183,32 @@
if (fixedWidth != null) sz.Width = (int)fixedWidth;
if (fixedHeight != null) sz.Height = (int)fixedHeight;
+ int? minWidth = ConvertDistance(child, style.Data.PositionData.MinWidth, true, true);
+ int? minHeight = ConvertDistance(child, style.Data.PositionData.MinHeight, true, true);
+
+ if (minWidth != null && sz.Width < (int)minWidth) sz.Width = (int)minWidth;
+ if (minHeight != null && sz.Height < (int)minHeight) sz.Height = (int)minHeight;
+
+ bool resetPosition = false;
+
switch (containerStyle.Data.Layout.Kind)
{
case CssLayoutKind.Flow:
+ if (resetNextPosition)
+ {
+ resetPosition = true;
+ resetNextPosition = false;
+ }
+ if (style.Data.Display == CssDisplay.Block)
+ {
+ resetPosition = true;
+ resetNextPosition = true;
+ }
+
if (nextPos.X + sz.Width + style.BoxModel.Left + style.BoxModel.Right > maxWidth)
+ resetPosition = true;
+
+ if (resetPosition)
{
nextPos.X = 0;
nextPos.Y += maxHeight;
@@ -174,11 +218,8 @@
}
bool includeInLayout = true;
-
+
var anim = style.Animator;
-
- anim.ClientRect.X = nextPos.X + box.Left;
- anim.ClientRect.Y = nextPos.Y + box.Top;
anim.ClientRect.Width = sz.Width;
anim.ClientRect.Height = sz.Height;
@@ -186,7 +227,7 @@
{
case CssPosition.Absolute:
includeInLayout = false;
- anim.ParentCoordinateSystem = TopLevelWidget(child, x => mAdapter.GetStyle(x).Data.Position == CssPosition.Relative);
+ anim.ParentCoordinateSystem = TopLevelWidget(child, x => mAdapter.GetStyle(x).Data.Position == CssPosition.Static);
break;
case CssPosition.Fixed:
@@ -195,14 +236,16 @@
break;
}
+ if (includeInLayout)
+ {
+ anim.ClientRect.X = nextPos.X + box.Left;
+ anim.ClientRect.Y = nextPos.Y + box.Top;
+ }
+
anim.ClientWidgetOffset = new Point(
box.Padding.Left + box.Border.Left,
box.Padding.Top + box.Border.Top);
- anim.WidgetSize = new Size(
- anim.ClientRect.Width + box.Padding.Left + box.Padding.Right + box.Border.Left + box.Border.Right,
- anim.ClientRect.Height + box.Padding.Top + box.Padding.Bottom + box.Border.Bottom + box.Border.Top);
-
if (includeInLayout)
{
switch (containerStyle.Data.Layout.Kind)
@@ -223,7 +266,6 @@
bottom = Math.Max(bottom, anim.ClientRect.Y + anim.ClientRect.Height + box.Bottom); // only add box.Bottom here, because box.Top is taken into account in child.Y.
}
- child.LayoutDirty = false;
}
containerAnim.ClientRect.Width = Math.Min(largestWidth, maxWidth);
@@ -260,7 +302,6 @@
break;
}
- container.LayoutDirty = false;
}
private Widget TopLevelWidget(Widget child)
@@ -302,15 +343,16 @@
}
}
- private Size ComputeSize(Widget control, CssStyle parentStyle)
+ private Size ComputeSize(Widget control, CssStyle parentStyle, bool forceRefresh)
{
- return ComputeSize(control, parentStyle.Data);
+ return ComputeSize(control, parentStyle.Data, forceRefresh);
}
- private Size ComputeSize(Widget control, CssStyleData parentStyle)
+ private Size ComputeSize(Widget control, CssStyleData parentStyle, bool forceRefresh)
{
if (control is Container)
- return ComputeContainerSize((Container)control);
+ return ComputeContainerSize((Container)control, forceRefresh);
+ mAdapter.SetFont(control);
var style = mAdapter.GetStyle(control);
return control.ComputeSize(
@@ -328,9 +370,9 @@
return mAdapter.CssDistanceToPixels(control, cssDistance, width);
}
- private Size ComputeContainerSize(Container container)
+ private Size ComputeContainerSize(Container container, bool forceRefresh)
{
- RedoLayout(container);
+ RedoLayout(container, forceRefresh);
var anim = mAdapter.GetStyle(container).Animator;
return new Size(anim.ClientRect.Width, anim.ClientRect.Height);
Modified: trunk/AgateLib/UserInterface/Css/Layout/Defaults/DefaultStyleCollection.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/Defaults/DefaultStyleCollection.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Layout/Defaults/DefaultStyleCollection.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -34,6 +34,7 @@
{
mSetters[typeof(Window)] = new WindowDefaultStyle();
mSetters[typeof(Menu)] = new MenuDefaultStyle();
+ mSetters[typeof(ProgressBar)] = new ProgressBarDefaultStyle();
}
public void Add(IDefaultStyleSetter styleSetter, params Type[] types)
Added: trunk/AgateLib/UserInterface/Css/Layout/Defaults/ProgressBarDefaultStyle.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/Defaults/ProgressBarDefaultStyle.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Css/Layout/Defaults/ProgressBarDefaultStyle.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -0,0 +1,19 @@
+using AgateLib.UserInterface.Css.Documents;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.UserInterface.Css.Layout.Defaults
+{
+ class ProgressBarDefaultStyle : BlankDefaultStyle
+ {
+ public override void SetDefaultStyle(CssStyle style)
+ {
+ style.Data.PositionData.MinWidth = CssDistance.FromString("40px");
+ style.Data.PositionData.MinHeight = CssDistance.FromString("4px");
+ style.Data.Border.SetValueFromText("1px solid black");
+ }
+ }
+}
Modified: trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -92,8 +92,15 @@
{
CssStyle style = mAdapter.GetStyle(control);
- control.Font = style.Font;
+ mAdapter.SetFont(control);
+ if (control is ITextAlignment)
+ {
+ ITextAlignment txa = (ITextAlignment)control;
+
+ txa.TextAlign = ConvertTextAlign(style.Data.Text.Align);
+ }
+
if (style.Animator.Visible == false)
return;
@@ -104,6 +111,21 @@
control.DrawImpl();
}
+ private OriginAlignment ConvertTextAlign(CssTextAlign cssTextAlign)
+ {
+ switch(cssTextAlign)
+ {
+ case CssTextAlign.Right:
+ return OriginAlignment.TopRight;
+
+ case CssTextAlign.Center:
+ return OriginAlignment.TopCenter;
+
+ default:
+ return OriginAlignment.TopLeft;
+ }
+ }
+
private void SetFontProperties(CssStyle style)
{
style.Widget.FontColor = style.Data.Font.Color;
@@ -178,7 +200,6 @@
DrawRepeatedClipped(image, srcRect, startPt, clipRect, repeatX, repeatY);
}
-
private void DrawRepeatedClipped(Surface image, Rectangle srcRect, Point startPt, Rectangle clipRect, bool repeatX, bool repeatY)
{
int countX = (int)Math.Ceiling(clipRect.Width / (double)srcRect.Width);
Modified: trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -31,9 +31,20 @@
{
CssStyle mStyle;
+ public Point ClientWidgetOffset { get; set; }
+ public Size WidgetSize
+ {
+ get
+ {
+ var widgetSize = ClientRect.Size;
+ var box = mStyle.BoxModel;
- public Point ClientWidgetOffset { get; set; }
- public Size WidgetSize { get; set; }
+ widgetSize.Width += box.Padding.Left + box.Padding.Right + box.Border.Left + box.Border.Right;
+ widgetSize.Height += box.Padding.Top + box.Padding.Bottom + box.Border.Bottom + box.Border.Top;
+
+ return widgetSize;
+ }
+ }
public Rectangle ClientRect;
public bool Active { get; private set; }
Modified: trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -4,6 +4,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using AgateLib.UserInterface.Widgets.Extensions;
namespace AgateLib.UserInterface.Css.Selectors
{
@@ -40,7 +41,7 @@
{
Container container = (Container)control;
- if (container.ChildHasMouseIn)
+ if (container.ChildHasMouseIn())
return CssPseudoClass.Hover;
}
if (control is MenuItem)
Modified: trunk/AgateLib/UserInterface/Widgets/Container.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Container.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/Container.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -24,7 +24,7 @@
namespace AgateLib.UserInterface.Widgets
{
- public class Container : Widget
+ public abstract class Container : Widget
{
public Container()
{
@@ -47,25 +47,16 @@
foreach (var w in Children)
{
yield return w;
- }
- foreach (var w in Children.OfType<Container>())
- {
- foreach (var ww in ((Container)w).Descendants)
- yield return ww;
+ if (w is Container)
+ {
+ foreach (var ww in ((Container)w).Descendants)
+ yield return ww;
+ }
}
}
}
- public bool ChildHasMouseIn
- {
- get
- {
- return Children.Any(x => x.MouseIn) ||
- Children.OfType<Container>().Any(x => x.ChildHasMouseIn);
- }
- }
-
public void BringToFront(Widget item)
{
if (Children.Contains(item) == false)
Added: trunk/AgateLib/UserInterface/Widgets/Extensions/WidgetExtensions.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Extensions/WidgetExtensions.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Widgets/Extensions/WidgetExtensions.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.UserInterface.Widgets.Extensions
+{
+ public static class WidgetExtensions
+ {
+ public static bool ChildHasMouseIn(this Container c)
+ {
+ return c.Descendants.Any(x => x.MouseIn);
+ }
+ }
+}
Added: trunk/AgateLib/UserInterface/Widgets/ITextAlignment.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/ITextAlignment.cs (rev 0)
+++ trunk/AgateLib/UserInterface/Widgets/ITextAlignment.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -0,0 +1,14 @@
+using AgateLib.DisplayLib;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.UserInterface.Widgets
+{
+ public interface ITextAlignment
+ {
+ OriginAlignment TextAlign { get; set; }
+ }
+}
Modified: trunk/AgateLib/UserInterface/Widgets/Label.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -25,7 +25,7 @@
namespace AgateLib.UserInterface.Widgets
{
- public class Label : Widget
+ public class Label : Widget, ITextAlignment
{
string mText = string.Empty;
bool mWrapText;
Modified: trunk/AgateLib/UserInterface/Widgets/LabelImage.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/LabelImage.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/LabelImage.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -7,7 +7,7 @@
namespace AgateLib.UserInterface.Widgets
{
- public class LabelImage : Container
+ public class LabelImage : Container, ITextAlignment
{
Label mLabel;
ImageBox mImageBox;
@@ -21,7 +21,7 @@
Children.Add(mLabel);
}
public LabelImage(string text, IDrawable image)
- :this()
+ : this()
{
Text = text;
Image = image;
@@ -32,5 +32,7 @@
public Label Label { get { return mLabel; } }
public ImageBox ImageBox { get { return mImageBox; } }
+
+ public OriginAlignment TextAlign { get { return Label.TextAlign; } set { Label.TextAlign = value; } }
}
}
Modified: trunk/AgateLib/UserInterface/Widgets/Panel.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Panel.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/Panel.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -23,7 +23,7 @@
namespace AgateLib.UserInterface.Widgets
{
- class Panel : Container
+ public class Panel : Container
{
}
}
Modified: trunk/AgateLib/UserInterface/Widgets/ProgressBar.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/ProgressBar.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/ProgressBar.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -47,7 +47,7 @@
public override void DrawImpl()
{
Rectangle destRect = ClientToScreen(
- new Rectangle(X, Y, Width, Height));
+ new Rectangle(0, 0, Width, Height));
if (Max > 0)
{
@@ -56,6 +56,8 @@
int maxBarWidth = Width;
int width = (int)(percentage * maxBarWidth);
+ destRect.Width = width;
+
var grad = new Gradient(Gradient.TopLeft);
grad.TopRight = Gradient.Interpolate(width, 0);
grad.BottomRight = grad.TopRight;
Modified: trunk/AgateLib/UserInterface/Widgets/Widget.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Widget.cs 2014-09-06 07:37:48 UTC (rev 1518)
+++ trunk/AgateLib/UserInterface/Widgets/Widget.cs 2014-09-07 22:49:41 UTC (rev 1519)
@@ -29,6 +29,7 @@
{
public class Widget
{
+ Container mParentCoordinateSystem;
private Point mClientWidgetOffset;
private Size mWidgetSize;
@@ -38,6 +39,7 @@
private bool mEnabled = true;
string mStyle = string.Empty;
bool mLayoutDirty;
+ bool mVisible;
public Widget()
{
@@ -82,7 +84,10 @@
public Size WidgetSize
{
get { return mWidgetSize; }
- set { mWidgetSize = value; }
+ set
+ {
+ mWidgetSize = value;
+ }
}
public override string ToString()
@@ -106,6 +111,20 @@
public bool AutoSize { get; set; }
public virtual Container Parent { get; set; }
+ protected internal Container ParentCoordinateSystem
+ {
+ get
+ {
+ if (mParentCoordinateSystem == null)
+ return Parent;
+ else
+ return mParentCoordinateSystem;
+ }
+ internal set
+ {
+ mParentCoordinateSystem = value;
+ }
+ }
public Font Font
{
get
@@ -120,7 +139,7 @@
mFont = value;
}
}
- public Color FontColor
+ public virtual Color FontColor
{
get
{
@@ -192,7 +211,7 @@
Point translated = ClientToParent(clientPoint);
- return Parent.ClientToScreen(translated);
+ return ParentCoordinateSystem.ClientToScreen(translated);
}
public Point ScreenToClient(Point screenPoint)
{
@@ -261,8 +280,19 @@
public virtual void Refresh()
{ }
- public virtual bool Visible { get; set; }
+ public virtual bool Visible
+ {
+ get { return mVisible; }
+ set
+ {
+ if (value == mVisible)
+ return;
+ mVisible = value;
+ LayoutDirty = true;
+ }
+ }
+
public string Style
{
get { return mStyle; }
@@ -270,8 +300,11 @@
{
if (value == null)
throw new ArgumentNullException();
+ if (value == mStyle)
+ return;
mStyle = value;
+ LayoutDirt...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-09 05:35:08
|
Revision: 1522
http://sourceforge.net/p/agate/code/1522
Author: kanato
Date: 2014-09-09 05:35:01 +0000 (Tue, 09 Sep 2014)
Log Message:
-----------
Some css fixes.
Modified Paths:
--------------
trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs
trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorIndividual.cs
trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
trunk/AgateLib/UserInterface/Widgets/Gui.cs
trunk/AgateLib/UserInterface/Widgets/Label.cs
trunk/AgateLib/UserInterface/Widgets/Menu.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
Modified: trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -104,27 +104,27 @@
{
var targetLeft = ConvertDistance(style.Widget, position.Left, true, false).Value;
- anim.ClientRect.X = targetLeft + box.Left;
+ anim.ClientX = targetLeft + box.Left;
}
if (position.Right.Automatic == false)
{
int targetRight = ConvertDistance(style.Widget, position.Right, true, false).Value;
targetRight = parentStyle.Animator.ClientRect.Width - targetRight;
- anim.ClientRect.X = targetRight - anim.ClientRect.Width - box.Right;
+ anim.ClientX = targetRight - anim.ClientRect.Width - box.Right;
}
if (position.Top.Automatic == false)
{
int targetTop = ConvertDistance(style.Widget, position.Top, false, false).Value;
- anim.ClientRect.Y = targetTop + box.Top;
+ anim.ClientY = targetTop + box.Top;
}
if (position.Bottom.Automatic == false)
{
int targetBottom = ConvertDistance(style.Widget, position.Bottom, false, false).Value;
targetBottom = parentStyle.Animator.ClientRect.Height - targetBottom;
- anim.ClientRect.Y = targetBottom - anim.ClientRect.Height - box.Bottom;
+ anim.ClientY = targetBottom - anim.ClientRect.Height - box.Bottom;
}
}
@@ -144,8 +144,8 @@
}
}
- containerAnim.ClientRect.X = 0;
- containerAnim.ClientRect.Y = 0;
+ containerAnim.ClientX = 0;
+ containerAnim.ClientY = 0;
int maxWidth = ComputeMaxWidthForContainer(containerStyle);
Point nextPos = Point.Empty;
@@ -156,7 +156,7 @@
int largestWidth = 0;
int bottom = 0;
- containerAnim.ClientRect.Width = maxWidth;
+ containerAnim.ClientWidth = maxWidth;
int? fixedContainerWidth = ConvertDistance(container, containerStyle.Data.PositionData.Width, true);
int? fixedContainerHeight = ConvertDistance(container, containerStyle.Data.PositionData.Height, true);
@@ -217,36 +217,35 @@
break;
}
- bool includeInLayout = true;
-
var anim = style.Animator;
- anim.ClientRect.Width = sz.Width;
- anim.ClientRect.Height = sz.Height;
+ anim.IncludeInLayout = true;
+ anim.ClientWidth = sz.Width;
+ anim.ClientHeight = sz.Height;
switch (style.Data.Position)
{
case CssPosition.Absolute:
- includeInLayout = false;
- anim.ParentCoordinateSystem = TopLevelWidget(child, x => mAdapter.GetStyle(x).Data.Position == CssPosition.Static);
+ anim.IncludeInLayout = false;
+ child.ParentCoordinateSystem = TopLevelWidget(child, x => mAdapter.GetStyle(x).Data.Position != CssPosition.Static);
break;
case CssPosition.Fixed:
- includeInLayout = false;
- anim.ParentCoordinateSystem = TopLevelWidget(child);
+ anim.IncludeInLayout = false;
+ child.ParentCoordinateSystem = TopLevelWidget(child, x => x is Desktop);
break;
}
- if (includeInLayout)
+ if (anim.IncludeInLayout)
{
- anim.ClientRect.X = nextPos.X + box.Left;
- anim.ClientRect.Y = nextPos.Y + box.Top;
+ anim.ClientX = nextPos.X + box.Left;
+ anim.ClientY = nextPos.Y + box.Top;
}
anim.ClientWidgetOffset = new Point(
box.Padding.Left + box.Border.Left,
box.Padding.Top + box.Border.Top);
- if (includeInLayout)
+ if (anim.IncludeInLayout)
{
switch (containerStyle.Data.Layout.Kind)
{
@@ -265,16 +264,15 @@
maxHeight = Math.Max(maxHeight, anim.ClientRect.Height + box.Top + box.Bottom);
bottom = Math.Max(bottom, anim.ClientRect.Y + anim.ClientRect.Height + box.Bottom); // only add box.Bottom here, because box.Top is taken into account in child.Y.
}
-
}
- containerAnim.ClientRect.Width = Math.Min(largestWidth, maxWidth);
- containerAnim.ClientRect.Height = bottom;
+ containerAnim.ClientWidth = Math.Min(largestWidth, maxWidth);
+ containerAnim.ClientHeight = bottom;
if (fixedContainerWidth != null)
- containerAnim.ClientRect.Width = (int)fixedContainerWidth;
+ containerAnim.ClientWidth = (int)fixedContainerWidth;
if (fixedContainerHeight != null)
- containerAnim.ClientRect.Height = (int)fixedContainerHeight;
+ containerAnim.ClientHeight = (int)fixedContainerHeight;
switch (containerStyle.Data.Layout.Kind)
{
@@ -286,6 +284,9 @@
var box = style.BoxModel;
int width = containerAnim.ClientRect.Width - box.Left - box.Right;
+ if (anim.IncludeInLayout == false)
+ continue;
+
if (style.Data.PositionData.MinWidth.Automatic == false)
{
int minwidth = mAdapter.CssDistanceToPixels(containerStyle, style.Data.PositionData.MinWidth, true);
@@ -297,28 +298,28 @@
width = Math.Min(width, maxwidth);
}
- anim.ClientRect.Width = width;
+ anim.ClientWidth = width;
}
break;
}
}
- private Widget TopLevelWidget(Widget child)
+ private Container TopLevelWidget(Widget child)
{
return TopLevelWidget(child, x => true);
}
- private Widget TopLevelWidget(Widget child, Func<Widget, bool> continueToParent)
+ private Container TopLevelWidget(Widget child, Func<Widget, bool> validMatch)
{
var retval = child.Parent;
if (retval == null)
- return child;
+ return null;
- if (continueToParent(retval) == false)
+ if (validMatch(retval))
return retval;
- return TopLevelWidget(retval, continueToParent);
+ return TopLevelWidget(retval, validMatch);
}
private int ComputeMaxWidthForContainer(CssStyle style)
Modified: trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -19,6 +19,7 @@
using AgateLib.Geometry;
using AgateLib.UserInterface.Css.Documents;
using AgateLib.UserInterface.Css.Rendering.Transitions;
+using AgateLib.UserInterface.Widgets;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -30,6 +31,7 @@
public class WidgetAnimator
{
CssStyle mStyle;
+ Rectangle mClientRect;
public Point ClientWidgetOffset { get; set; }
public Size WidgetSize
@@ -45,8 +47,33 @@
return widgetSize;
}
}
- public Rectangle ClientRect;
+ public Rectangle ClientRect
+ {
+ get { return mClientRect; }
+ set { mClientRect = value; }
+ }
+ public int ClientX
+ {
+ get { return mClientRect.X; }
+ set { mClientRect.X = value; }
+ }
+ public int ClientY
+ {
+ get { return mClientRect.Y; }
+ set { mClientRect.Y = value; }
+ }
+ public int ClientWidth
+ {
+ get { return mClientRect.Width; }
+ set { mClientRect.Width = value; }
+ }
+ public int ClientHeight
+ {
+ get { return mClientRect.Height; }
+ set { mClientRect.Height = value; }
+ }
+
public bool Active { get; private set; }
public bool Visible { get; set; }
@@ -76,6 +103,13 @@
}
}
- public Widgets.Widget ParentCoordinateSystem { get; set; }
+ public Container ParentCoordinateSystem { get { return mStyle.Widget.ParentCoordinateSystem; } }
+
+ public override string ToString()
+ {
+ return "Animator: " + mStyle.Widget.ToString();
+ }
+
+ public bool IncludeInLayout { get; set; }
}
}
Modified: trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorIndividual.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorIndividual.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Css/Selectors/CssSelectorIndividual.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -113,12 +113,21 @@
public bool Matches(CssAdapter adapter, WidgetMatchParameters wmp)
{
- var typename = wmp.TypeName;
- if (ObjectType != null &&
- ObjectType.Equals(typename, StringComparison.OrdinalIgnoreCase)
- == false)
+ if (string.IsNullOrEmpty(ObjectType) == false)
{
- return false;
+ bool typeMatch = false;
+
+ foreach (var typename in wmp.TypeNames)
+ {
+ if (ObjectType.Equals(typename, StringComparison.OrdinalIgnoreCase))
+ {
+ typeMatch = true;
+ break;
+ }
+ }
+
+ if (typeMatch == false)
+ return false;
}
if (PseudoClass != CssPseudoClass.None && PseudoClass != wmp.PseudoClass)
Modified: trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using AgateLib.UserInterface.Widgets.Extensions;
@@ -11,11 +12,13 @@
public class WidgetMatchParameters
{
Widget mWidget;
+ List<string> mTypeNames = new List<string>();
public WidgetMatchParameters(Widget w)
{
mWidget = w;
+ UpdateWidgetTypeNames();
UpdateWidgetProperties();
}
@@ -26,11 +29,23 @@
public void UpdateWidgetProperties()
{
- TypeName = mWidget.GetType().Name;
PseudoClass = GetPseudoClass(mWidget);
Classes = GetCssClasses(mWidget);
}
+ private void UpdateWidgetTypeNames()
+ {
+ mTypeNames.Clear();
+
+ var type = mWidget.GetType();
+
+ while (type != typeof(Widget))
+ {
+ mTypeNames.Add(type.Name);
+ type = type.GetTypeInfo().BaseType;
+ }
+ }
+
private CssPseudoClass GetPseudoClass(Widget control)
{
if (InActiveWindow(control))
@@ -98,7 +113,7 @@
string cachedClass;
- public string TypeName { get; private set; }
+ public IEnumerable<string> TypeNames { get { return mTypeNames; } }
public string Id { get { return Widget.Name; } }
public CssPseudoClass PseudoClass { get; private set; }
Modified: trunk/AgateLib/UserInterface/Widgets/Gui.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -50,7 +50,7 @@
ForwardUnhandledEvents = true;
}
- public InputMap InputMap { get ; set; }
+ public InputMap InputMap { get; set; }
public Desktop Desktop { get { return mDesktop; } }
void DispatchEvent(Func<Window, bool> action)
@@ -142,6 +142,8 @@
{
DispatchEvent(window => { window.OnInputButtonDown(args.KeyCode, ref handled); return handled; });
}
+
+ args.Handled = handled;
}
public void OnKeyUp(AgateInputEventArgs args)
{
@@ -275,7 +277,8 @@
targetWidget.OnMouseDown(e.MouseButtons, targetWidget.ScreenToClient(e.MousePosition));
}
- [Obsolete] public void OnMouseUp(InputEventArgs e)
+ [Obsolete]
+ public void OnMouseUp(InputEventArgs e)
{
Widget targetWidget = mMouseEventWidget;
@@ -371,6 +374,11 @@
//}
internal AgateLib.UserInterface.Css.Documents.CssDocument CssDocument { get; set; }
+
+ public void AddWindow(Window wind)
+ {
+ Desktop.Children.Add(wind);
+ }
}
class WindowList : IList<Window>
Modified: trunk/AgateLib/UserInterface/Widgets/Label.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Widgets/Label.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -65,6 +65,9 @@
private void RewrapText(int maxWidth)
{
+ if (Font == null)
+ return;
+
mWrapPositions.Clear();
List<int> spacePositions = new List<int>();
Modified: trunk/AgateLib/UserInterface/Widgets/Menu.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Menu.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib/UserInterface/Widgets/Menu.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -248,8 +248,6 @@
OnCancelPressed();
break;
}
-
- handled = true;
}
protected internal override void OnUpdate(double deltaTime)
{
Modified: trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -17,7 +17,7 @@
public class CssBindingTest : CssTestBase
{
[TestMethod]
- public void PropertyMapping()
+ public void CssBPropertyMapping()
{
CssPropertyMap pm = new CssPropertyMap();
CssBindingMapper bm = new CssBindingMapper(pm);
@@ -30,7 +30,7 @@
}
[TestMethod]
- public void SelectorMatching()
+ public void CssBSelectorMatching()
{
Gui gui = new Gui(null, null);
Desktop desktop = new Desktop(gui);
@@ -66,7 +66,7 @@
}
[TestMethod]
- public void PseudoClassMatching()
+ public void CssBPseudoClassMatching()
{
Gui gui = new Gui(null, null);
Desktop desktop = new Desktop(gui);
@@ -83,7 +83,7 @@
}
[TestMethod]
- public void DescendentMatching()
+ public void CssBDescendentMatching()
{
CssDocument doc = CssDocument.FromText("labelimage imagebox { margin-right: 12px; }");
CssAdapter adapter = new CssAdapter(doc);
@@ -102,5 +102,44 @@
style = adapter.GetStyle(ib);
Assert.AreEqual(0, style.AppliedBlocks.Count);
}
+
+ class CustomWindow : Window
+ {
+
+ }
+
+ [TestMethod]
+ public void CssBInheritanceMatching()
+ {
+ CssDocument doc = CssDocument.FromText("window { margin: 4px; }");
+ CssAdapter adapter = new CssAdapter(doc);
+ var customWindow = new CustomWindow();
+
+ var style = adapter.GetStyle(customWindow);
+
+ Assert.AreEqual(1, style.AppliedBlocks.Count);
+ DistanceAssert(false, 4, DistanceUnit.Pixels, style.Data.Margin.Top);
+ }
+
+ [TestMethod]
+ public void CssBStyleMatching()
+ {
+ CssDocument doc = CssDocument.FromText("window { transition: slide top; } window.style { transition: none; }");
+ CssAdapter adapter = new CssAdapter(doc);
+
+ var window = new Window();
+ var stylish = new Window { Style = "style" };
+
+ var swindow = adapter.GetStyle(window);
+ Assert.AreEqual(1, swindow.AppliedBlocks.Count);
+ var selector = swindow.AppliedBlocks[0].Selector.IndividualSelectors.First();
+ Assert.IsTrue(selector is CssSelectorIndividual);
+
+ CssSelectorIndividual indv = (CssSelectorIndividual)selector;
+ Assert.AreEqual(0, indv.CssClasses.Count);
+
+ var sstyle = adapter.GetStyle(stylish);
+ Assert.AreEqual(2, sstyle.AppliedBlocks.Count);
+ }
}
}
Modified: trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs
===================================================================
--- trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs 2014-09-07 23:06:48 UTC (rev 1521)
+++ trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssLayoutTest.cs 2014-09-09 05:35:01 UTC (rev 1522)
@@ -398,5 +398,26 @@
Assert.AreEqual(new Rectangle(133, 43, 500, 400), window.ClientRect);
Assert.AreEqual(new Rectangle(450, 0, 50, 40), panel.WidgetRect);
}
+
+ [TestMethod]
+ public void CssLAbsolutePositionSizing()
+ {
+ doc.Clear();
+ doc.Parse(@"window { layout: column; }
+#abs { position: absolute; width: 400px; }");
+
+
+ var window = new Window();
+ var label = new Label { Text = "text" };
+ var test = new Label { Name = "abs" };
+
+ window.Children.Add(label, test);
+ gui.AddWindow(window);
+
+ RedoLayout();
+
+ Assert.AreEqual(label.Width, window.Width);
+ Assert.AreEqual(400, test.Width);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-09-13 23:40:04
|
Revision: 1523
http://sourceforge.net/p/agate/code/1523
Author: kanato
Date: 2014-09-13 23:39:50 +0000 (Sat, 13 Sep 2014)
Log Message:
-----------
Several fixes and additions to user interface components to make them more touch friendly.
Added GUI debugger window.
Added Gamepad mapper.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/ApplicationModels/AgateAppModel.cs
trunk/AgateLib/Geometry/Vector2.cs
trunk/AgateLib/InputLib/Input.cs
trunk/AgateLib/InputLib/Joystick.cs
trunk/AgateLib/InputLib/JoystickEventArgs.cs
trunk/AgateLib/Properties/AssemblyInfo.cs
trunk/AgateLib/Settings/PersistantSettings.cs
trunk/AgateLib/UserInterface/Css/CssAdapter.cs
trunk/AgateLib/UserInterface/Css/CssStyleData.cs
trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs
trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
trunk/AgateLib/UserInterface/Css/Layout/Defaults/MenuDefaultStyle.cs
trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs
trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs
trunk/AgateLib/UserInterface/Css/Rendering/WidgetAnimator.cs
trunk/AgateLib/UserInterface/Css/Selectors/WidgetMatchParameters.cs
trunk/AgateLib/UserInterface/Widgets/Desktop.cs
trunk/AgateLib/UserInterface/Widgets/Gui.cs
trunk/AgateLib/UserInterface/Widgets/GuiSound.cs
trunk/AgateLib/UserInterface/Widgets/IGuiRenderer.cs
trunk/AgateLib/UserInterface/Widgets/InputMap.cs
trunk/AgateLib/UserInterface/Widgets/Menu.cs
trunk/AgateLib/UserInterface/Widgets/MenuItem.cs
trunk/AgateLib/UserInterface/Widgets/Widget.cs
trunk/AgateLib/UserInterface/Widgets/WidgetList.cs
trunk/AgateLib.AgateSDL/SdlFactory.cs
trunk/AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
trunk/AgateLib.Platform.WinForms/ApplicationModels/SerialModel.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/DesktopGLDisplay.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_DisplayControl.cs
trunk/AgateLib.Platform.WinForms/DisplayImplementation/GL_GameWindow.cs
trunk/AgateLib.Platform.WinForms/PlatformImplementation/FormsPlatformInfo.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Fakes/FakeGuiEngine.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/Input/InputTester.cs
trunk/AgateLib.Tests/Tests.WinForms/InputTests/Input/frmInputTester.cs
trunk/AgateLib.Tests/UnitTests/UserInterface/Css/CssBindingTest.cs
Added Paths:
-----------
trunk/AgateLib/InputLib/DirectionPad.cs
trunk/AgateLib/InputLib/Gamepad.cs
trunk/AgateLib/InputLib/GamepadButtonEventArgs.cs
trunk/AgateLib/InputLib/GamepadMap.cs
trunk/AgateLib/InputLib/GamepadMapDatabase.cs
trunk/AgateLib/InputLib/GamepadStickEventArgs.cs
trunk/AgateLib/UserInterface/GestureEffect.cs
trunk/AgateLib/UserInterface/GuiStack.cs
trunk/AgateLib/UserInterface/Widgets/AxisType.cs
trunk/AgateLib/UserInterface/Widgets/Gesture.cs
trunk/AgateLib/UserInterface/Widgets/Gestures/
trunk/AgateLib/UserInterface/Widgets/Gestures/IGestureController.cs
trunk/AgateLib/UserInterface/Widgets/Gestures/MouseGesture.cs
trunk/AgateLib/UserInterface/Widgets/InputMode.cs
trunk/AgateLib.Platform.WinForms/GuiDebug/
trunk/AgateLib.Platform.WinForms/GuiDebug/frmGuiDebug.Designer.cs
trunk/AgateLib.Platform.WinForms/GuiDebug/frmGuiDebug.cs
trunk/AgateLib.Platform.WinForms/GuiDebug/frmGuiDebug.resx
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/AgateLib.csproj 2014-09-13 23:39:50 UTC (rev 1523)
@@ -38,9 +38,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <!-- A reference to the entire .NET Framework is automatically included -->
- </ItemGroup>
- <ItemGroup>
<Compile Include="AgateException.cs">
<SubType>Code</SubType>
</Compile>
@@ -65,6 +62,12 @@
<Compile Include="Drivers\NullDrivers\NullInputFactory.cs" />
<Compile Include="Drivers\NullDrivers\NullSoundFactory.cs" />
<Compile Include="Geometry\CoordinateSystems\SingleFixedDimension.cs" />
+ <Compile Include="InputLib\DirectionPad.cs" />
+ <Compile Include="InputLib\Gamepad.cs" />
+ <Compile Include="InputLib\GamepadButtonEventArgs.cs" />
+ <Compile Include="InputLib\GamepadMap.cs" />
+ <Compile Include="InputLib\GamepadMapDatabase.cs" />
+ <Compile Include="InputLib\GamepadStickEventArgs.cs" />
<Compile Include="Mathematics\MathHelper.cs" />
<Compile Include="Algorithms\PathFinding\IAStarMap.cs" />
<Compile Include="Algorithms\Pair.cs" />
@@ -557,11 +560,17 @@
<Compile Include="UserInterface\Css\Selectors\ICssMediaSelector.cs" />
<Compile Include="UserInterface\Css\Selectors\ICssSelector.cs" />
<Compile Include="UserInterface\Css\Selectors\WidgetMatchParameters.cs" />
+ <Compile Include="UserInterface\GestureEffect.cs" />
+ <Compile Include="UserInterface\GuiStack.cs" />
<Compile Include="UserInterface\IAudioPlayer.cs" />
<Compile Include="UserInterface\ISurfaceProvider.cs" />
+ <Compile Include="UserInterface\Widgets\AxisType.cs" />
<Compile Include="UserInterface\Widgets\Container.cs" />
<Compile Include="UserInterface\Widgets\Desktop.cs" />
<Compile Include="UserInterface\Widgets\Extensions\WidgetExtensions.cs" />
+ <Compile Include="UserInterface\Widgets\Gesture.cs" />
+ <Compile Include="UserInterface\Widgets\Gestures\IGestureController.cs" />
+ <Compile Include="UserInterface\Widgets\Gestures\MouseGesture.cs" />
<Compile Include="UserInterface\Widgets\Gui.cs" />
<Compile Include="UserInterface\Widgets\GuiInput.cs" />
<Compile Include="UserInterface\Widgets\GuiSound.cs" />
@@ -570,6 +579,7 @@
<Compile Include="UserInterface\Widgets\IGuiRenderer.cs" />
<Compile Include="UserInterface\Widgets\ImageBox.cs" />
<Compile Include="UserInterface\Widgets\InputMap.cs" />
+ <Compile Include="UserInterface\Widgets\InputMode.cs" />
<Compile Include="UserInterface\Widgets\ITextAlignment.cs" />
<Compile Include="UserInterface\Widgets\KeyboardEventArgs.cs" />
<Compile Include="UserInterface\Widgets\Label.cs" />
Modified: trunk/AgateLib/ApplicationModels/AgateAppModel.cs
===================================================================
--- trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/ApplicationModels/AgateAppModel.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -337,6 +337,8 @@
/// </summary>
public virtual void KeepAlive()
{
+ Input.PollJoysticks();
+
Input.DispatchQueuedEvents();
}
}
Modified: trunk/AgateLib/Geometry/Vector2.cs
===================================================================
--- trunk/AgateLib/Geometry/Vector2.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/Geometry/Vector2.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -52,6 +52,16 @@
mY = (float)y;
}
/// <summary>
+ /// Constructs a Vector2 object from a Point.
+ /// </summary>
+ /// <param name="pt"></param>
+ public Vector2(Point pt)
+ {
+ mX = pt.X;
+ mY = pt.Y;
+ }
+
+ /// <summary>
/// X coordinate.
/// </summary>
public float X
@@ -184,6 +194,26 @@
return new Vector2(a.X * b, a.Y * b);
}
/// <summary>
+ /// Scales a vector by a scalar floating point value.
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static Vector2 operator *(Vector2 a, double b)
+ {
+ return new Vector2(a.X * b, a.Y * b);
+ }
+ /// <summary>
+ /// Scales a vector by a scalar floating point value.
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static Vector2 operator *(double b, Vector2 a)
+ {
+ return new Vector2(a.X * b, a.Y * b);
+ }
+ /// <summary>
/// Divides a vector's components by a floating point value.
/// </summary>
/// <param name="a"></param>
@@ -195,6 +225,17 @@
}
/// <summary>
+ /// Divides a vector's components by a floating point value.
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static Vector2 operator /(Vector2 a, double b)
+ {
+ return a * (float)(1.0f / b);
+ }
+
+ /// <summary>
/// Computes and returns the dot product with another vector.
/// </summary>
/// <param name="b"></param>
Added: trunk/AgateLib/InputLib/DirectionPad.cs
===================================================================
--- trunk/AgateLib/InputLib/DirectionPad.cs (rev 0)
+++ trunk/AgateLib/InputLib/DirectionPad.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public class DirectionPad
+ {
+ public bool Up { get; internal set; }
+ public bool Down { get; internal set; }
+ public bool Left { get; internal set; }
+ public bool Right { get; internal set; }
+
+ internal void OnChanged(Gamepad gamepad)
+ {
+ if (Changed != null)
+ Changed(gamepad, EventArgs.Empty);
+ }
+
+ public event EventHandler Changed;
+ }
+}
Added: trunk/AgateLib/InputLib/Gamepad.cs
===================================================================
--- trunk/AgateLib/InputLib/Gamepad.cs (rev 0)
+++ trunk/AgateLib/InputLib/Gamepad.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,260 @@
+using AgateLib.Geometry;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public class Gamepad : IDisposable
+ {
+ static List<HatState> mHatUpStates = new List<HatState>();
+ static List<HatState> mHatLeftStates = new List<HatState>();
+ static List<HatState> mHatRightStates = new List<HatState>();
+ static List<HatState> mHatDownStates = new List<HatState>();
+
+ static Gamepad()
+ {
+ mHatUpStates.AddRange(new[] { HatState.Up, HatState.UpLeft, HatState.UpRight });
+ mHatLeftStates.AddRange(new[] { HatState.Left, HatState.UpLeft, HatState.DownLeft });
+ mHatRightStates.AddRange(new[] { HatState.Right, HatState.UpRight, HatState.DownRight });
+ mHatDownStates.AddRange(new[] { HatState.Down, HatState.DownLeft, HatState.DownRight });
+ }
+
+ Joystick mJoystick;
+ GamepadMap mMap;
+ Dictionary<GamepadButton, bool> mButtonState = new Dictionary<GamepadButton, bool>();
+ Vector2 mLeftStick;
+ Vector2 mRightStick;
+ float mLeftTrigger, mRightTrigger;
+
+ public Gamepad(Joystick joystick)
+ : this(joystick, GamepadMapDatabase.FindMap(joystick.Guid))
+ {
+ }
+
+ private Gamepad(Joystick joystick, GamepadMap map)
+ {
+ mMap = map;
+
+ mJoystick = joystick;
+
+ mJoystick.AxisChanged += joystick_AxisChanged;
+ mJoystick.ButtonPressed += joystick_ButtonPressed;
+ mJoystick.ButtonReleased += joystick_ButtonReleased;
+ mJoystick.HatStateChanged += joystick_HatStateChanged;
+ }
+
+ /// <summary>
+ /// Disconnects the Gamepad instance from the hardware joystick.
+ /// </summary>
+ public void Dispose()
+ {
+ mJoystick.AxisChanged -= joystick_AxisChanged;
+ mJoystick.ButtonPressed -= joystick_ButtonPressed;
+ mJoystick.ButtonReleased -= joystick_ButtonReleased;
+ mJoystick.HatStateChanged -= joystick_HatStateChanged;
+ }
+
+
+ public DirectionPad DPad { get; private set; }
+ public Vector2 LeftStick { get { return mLeftStick; } }
+ public Vector2 RightStick { get { return mRightStick; } }
+ public float LeftTrigger { get { return mLeftTrigger; } }
+ public float RightTrigger { get { return mRightTrigger; } }
+ public Dictionary<GamepadButton, bool> Buttons { get { return mButtonState; } }
+
+ void joystick_HatStateChanged(object sender, JoystickEventArgs e)
+ {
+ var hat = mJoystick.HatState[e.Index];
+
+ DPad.Up = mHatUpStates.Contains(hat);
+ DPad.Left = mHatLeftStates.Contains(hat);
+ DPad.Right = mHatRightStates.Contains(hat);
+ DPad.Down = mHatDownStates.Contains(hat);
+
+ DPad.OnChanged(this);
+ }
+
+ void joystick_AxisChanged(object sender, JoystickEventArgs e)
+ {
+ var target = mMap.AxisMap[e.Index];
+
+ if (target == GamepadMapTarget.None)
+ return;
+
+ var value = (float)mJoystick.GetAxisValue(e.Index);
+
+ SetValue(target, value);
+ }
+
+ void joystick_ButtonReleased(object sender, JoystickEventArgs e)
+ {
+ MapButton(e.Index, 0);
+ }
+ void joystick_ButtonPressed(object sender, JoystickEventArgs e)
+ {
+ MapButton(e.Index, 1);
+ }
+
+ private void MapButton(int joystickButtonIndex, int value)
+ {
+ var target = mMap.ButtonMap[joystickButtonIndex];
+
+ if (target == GamepadMapTarget.None)
+ return;
+
+ SetValue(target, 0);
+ }
+
+ private void SetValue(GamepadMapTarget target, float value)
+ {
+ switch (target)
+ {
+ case GamepadMapTarget.LeftX:
+ case GamepadMapTarget.LeftY:
+ case GamepadMapTarget.RightX:
+ case GamepadMapTarget.RightY:
+ case GamepadMapTarget.LeftTrigger:
+ case GamepadMapTarget.RightTrigger:
+ SetAxisValue(target, value);
+ break;
+
+ case GamepadMapTarget.A:
+ case GamepadMapTarget.B:
+ case GamepadMapTarget.X:
+ case GamepadMapTarget.Y:
+ case GamepadMapTarget.LeftBumper:
+ case GamepadMapTarget.RightBumper:
+ case GamepadMapTarget.Select:
+ case GamepadMapTarget.Start:
+ case GamepadMapTarget.LeftStickButton:
+ case GamepadMapTarget.RightStickButton:
+ case GamepadMapTarget.DPadUp:
+ case GamepadMapTarget.DPadRight:
+ case GamepadMapTarget.DPadLeft:
+ case GamepadMapTarget.DPadDown:
+ SetButtonValue(target, value);
+ break;
+
+ default:
+ throw new NotImplementedException();
+ }
+ }
+
+ void SetAxisValue(GamepadMapTarget target, float value)
+ {
+ var val = (float)value;
+
+ switch (target)
+ {
+ case GamepadMapTarget.LeftX: mLeftStick.X = val; OnLeftStickMoved(); break;
+ case GamepadMapTarget.LeftY: mLeftStick.Y = val; OnLeftStickMoved(); break;
+ case GamepadMapTarget.RightX: mRightStick.X = val; OnRightStickMoved(); break;
+ case GamepadMapTarget.RightY: mRightStick.Y = val; OnRightStickMoved(); break;
+ case GamepadMapTarget.LeftTrigger: mLeftTrigger = val; OnLeftTriggerMoved(); break;
+ case GamepadMapTarget.RightTrigger: mRightTrigger = val; OnRightTriggerMoved(); break;
+
+ default:
+ throw new NotImplementedException();
+ }
+ }
+
+
+ void SetButtonValue(GamepadMapTarget target, float value)
+ {
+ if (value > 0.5)
+ SetButtonValue(target, true);
+ else
+ SetButtonValue(target, false);
+ }
+
+ void SetButtonValue(GamepadMapTarget target, bool value)
+ {
+ GamepadButton mappedTarget;
+
+ switch (target)
+ {
+ case GamepadMapTarget.A: mappedTarget = GamepadButton.A; break;
+ case GamepadMapTarget.B: mappedTarget = GamepadButton.B; break;
+ case GamepadMapTarget.X: mappedTarget = GamepadButton.X; break;
+ case GamepadMapTarget.Y: mappedTarget = GamepadButton.Y; break;
+ case GamepadMapTarget.LeftBumper: mappedTarget = GamepadButton.LeftBumper; break;
+ case GamepadMapTarget.RightBumper: mappedTarget = GamepadButton.RightBumper; break;
+ case GamepadMapTarget.Select: mappedTarget = GamepadButton.Select; break;
+ case GamepadMapTarget.Start: mappedTarget = GamepadButton.Start; break;
+ case GamepadMapTarget.LeftStickButton: mappedTarget = GamepadButton.LeftStickButton; break;
+ case GamepadMapTarget.RightStickButton: mappedTarget = GamepadButton.RightStickButton; break;
+ case GamepadMapTarget.Home: mappedTarget = GamepadButton.Home; break;
+
+ case GamepadMapTarget.DPadUp: DPad.Up = value; DPad.OnChanged(this); return;
+ case GamepadMapTarget.DPadRight: DPad.Right = value; DPad.OnChanged(this); return;
+ case GamepadMapTarget.DPadLeft: DPad.Left = value; DPad.OnChanged(this); return;
+ case GamepadMapTarget.DPadDown: DPad.Down = value; DPad.OnChanged(this); return;
+
+ default:
+ throw new NotImplementedException();
+ }
+
+ mButtonState[mappedTarget] = value;
+
+ if (value)
+ OnButtonPressed(mappedTarget);
+ else
+ OnButtonReleased(mappedTarget);
+ }
+
+
+ private void OnLeftStickMoved()
+ {
+ if (LeftStickMoved != null)
+ LeftStickMoved(this, EventArgs.Empty);
+ }
+ private void OnRightStickMoved()
+ {
+ if (RightStickMoved != null)
+ RightStickMoved(this, EventArgs.Empty);
+ }
+ private void OnLeftTriggerMoved()
+ {
+ }
+ private void OnRightTriggerMoved()
+ {
+ }
+
+ private void OnButtonPressed(GamepadButton mappedTarget)
+ {
+ if (ButtonPressed != null)
+ ButtonPressed(this, new GamepadButtonEventArgs(mappedTarget));
+ }
+ private void OnButtonReleased(GamepadButton mappedTarget)
+ {
+ if (ButtonReleased != null)
+ ButtonReleased(this, new GamepadButtonEventArgs(mappedTarget));
+ }
+
+ public event EventHandler LeftStickMoved;
+ public event EventHandler RightStickMoved;
+
+ public event EventHandler<GamepadButtonEventArgs> ButtonPressed;
+ public event EventHandler<GamepadButtonEventArgs> ButtonReleased;
+
+ }
+
+
+ public enum GamepadButton
+ {
+ A,
+ B,
+ X,
+ Y,
+ LeftBumper,
+ RightBumper,
+ Select,
+ Start,
+ LeftStickButton,
+ RightStickButton,
+ Home
+ }
+}
Added: trunk/AgateLib/InputLib/GamepadButtonEventArgs.cs
===================================================================
--- trunk/AgateLib/InputLib/GamepadButtonEventArgs.cs (rev 0)
+++ trunk/AgateLib/InputLib/GamepadButtonEventArgs.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public class GamepadButtonEventArgs : EventArgs
+ {
+ private GamepadButton mappedTarget;
+
+ public GamepadButtonEventArgs(GamepadButton mappedTarget)
+ {
+ // TODO: Complete member initialization
+ this.mappedTarget = mappedTarget;
+ }
+ }
+}
Added: trunk/AgateLib/InputLib/GamepadMap.cs
===================================================================
--- trunk/AgateLib/InputLib/GamepadMap.cs (rev 0)
+++ trunk/AgateLib/InputLib/GamepadMap.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,78 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public class GamepadMap
+ {
+ public GamepadMap()
+ {
+ AxisMap = new GamepadMapTarget[6];
+ ButtonMap = new GamepadMapTarget[16];
+
+ InitializeMapTarget(AxisMap);
+ InitializeMapTarget(ButtonMap);
+
+ InitializeXboxControllerMap();
+ }
+
+ private void InitializeXboxControllerMap()
+ {
+ ButtonMap[0] = GamepadMapTarget.DPadUp;
+ ButtonMap[1] = GamepadMapTarget.DPadDown;
+ ButtonMap[2] = GamepadMapTarget.DPadLeft;
+ ButtonMap[3] = GamepadMapTarget.DPadRight;
+ ButtonMap[4] = GamepadMapTarget.Start;
+ ButtonMap[5] = GamepadMapTarget.Select;
+ ButtonMap[6] = GamepadMapTarget.LeftStickButton;
+ ButtonMap[7] = GamepadMapTarget.RightStickButton;
+ ButtonMap[8] = GamepadMapTarget.LeftBumper;
+ ButtonMap[9] = GamepadMapTarget.RightBumper;
+ ButtonMap[10] = GamepadMapTarget.A;
+ ButtonMap[11] = GamepadMapTarget.B;
+ ButtonMap[12] = GamepadMapTarget.X;
+ ButtonMap[13] = GamepadMapTarget.Y;
+ ButtonMap[14] = GamepadMapTarget.Home;
+ }
+
+ private void InitializeMapTarget(GamepadMapTarget[] map)
+ {
+ for (int i = 0; i < map.Length; i++)
+ map[i] = (GamepadMapTarget)i;
+ }
+
+ public GamepadMapTarget[] AxisMap { get; set; }
+ public GamepadMapTarget[] ButtonMap { get; set; }
+ }
+
+
+ public enum GamepadMapTarget
+ {
+ None = -1,
+ LeftX,
+ LeftY,
+ RightX,
+ RightY,
+ LeftTrigger,
+ RightTrigger,
+ A,
+ B,
+ X,
+ Y,
+ LeftBumper,
+ RightBumper,
+ Select,
+ Start,
+ LeftStickButton,
+ RightStickButton,
+ DPadUp,
+ DPadDown,
+ DPadLeft,
+ DPadRight,
+ Home,
+ }
+
+}
Added: trunk/AgateLib/InputLib/GamepadMapDatabase.cs
===================================================================
--- trunk/AgateLib/InputLib/GamepadMapDatabase.cs (rev 0)
+++ trunk/AgateLib/InputLib/GamepadMapDatabase.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public static class GamepadMapDatabase
+ {
+ static Dictionary<Guid, string> mMapStrings = new Dictionary<Guid, string>();
+
+ /// <summary>
+ /// Finds the mapping from the joystick inputs to the gamepad inputs.
+ /// Returns a default GamepadMap object if nothing is found.
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ public static GamepadMap FindMap(Guid guid)
+ {
+ return new GamepadMap();
+ }
+ }
+}
Added: trunk/AgateLib/InputLib/GamepadStickEventArgs.cs
===================================================================
--- trunk/AgateLib/InputLib/GamepadStickEventArgs.cs (rev 0)
+++ trunk/AgateLib/InputLib/GamepadStickEventArgs.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.InputLib
+{
+ public class GamepadStickEventArgs : EventArgs
+ {
+ }
+}
Modified: trunk/AgateLib/InputLib/Input.cs
===================================================================
--- trunk/AgateLib/InputLib/Input.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/InputLib/Input.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -61,5 +61,10 @@
}
public static InputHandlerList InputHandlers { get { return mInputHandlers; } }
+
+ internal static void PollJoysticks()
+ {
+ JoystickInput.PollTimer();
+ }
}
}
Modified: trunk/AgateLib/InputLib/Joystick.cs
===================================================================
--- trunk/AgateLib/InputLib/Joystick.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/InputLib/Joystick.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -33,6 +33,7 @@
JoystickImpl impl;
bool[] mButtonState;
HatState[] mHatState;
+ double[] mAxisState;
internal Joystick(JoystickImpl i)
{
@@ -42,7 +43,7 @@
mButtonState = new bool[ButtonCount];
mHatState = new HatState[HatCount];
-
+ mAxisState = new double[AxisCount];
}
/// <summary>
@@ -222,17 +223,33 @@
OnHatStateChanged(i);
}
}
+
+ for (int i = 0; i < mAxisState.Length; i++)
+ {
+ double newValue = GetAxisValue(i);
+
+ if (Math.Abs(newValue - mAxisState[i]) > 0.001)
+ {
+ mAxisState[i] = newValue;
+ OnAxisChanged(i);
+ }
+ }
}
-
+ public event JoystickEventHandler AxisChanged;
public event JoystickEventHandler ButtonPressed;
public event JoystickEventHandler ButtonReleased;
public event JoystickEventHandler HatStateChanged;
+ private void OnAxisChanged(int axisIndex)
+ {
+ if (AxisChanged != null)
+ AxisChanged(this, new JoystickEventArgs(JoystickEventType.Axis, axisIndex));
+ }
private void OnButtonPressed(int index)
{
if (ButtonPressed != null)
- ButtonPressed(this,
+ ButtonPressed(this,
new JoystickEventArgs(JoystickEventType.Button, index));
}
private void OnButtonReleased(int index)
Modified: trunk/AgateLib/InputLib/JoystickEventArgs.cs
===================================================================
--- trunk/AgateLib/InputLib/JoystickEventArgs.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/InputLib/JoystickEventArgs.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -25,6 +25,7 @@
{
public enum JoystickEventType
{
+ Axis,
Button,
Hat,
}
Modified: trunk/AgateLib/Properties/AssemblyInfo.cs
===================================================================
--- trunk/AgateLib/Properties/AssemblyInfo.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/Properties/AssemblyInfo.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -34,6 +34,7 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: InternalsVisibleTo("AgateLib.UnitTests")]
+[assembly: InternalsVisibleTo("AgateLib.Platform.WinForms")]
[assembly: CLSCompliant(true)]
Modified: trunk/AgateLib/Settings/PersistantSettings.cs
===================================================================
--- trunk/AgateLib/Settings/PersistantSettings.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/Settings/PersistantSettings.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -167,6 +167,9 @@
try
{
+ if (FileSystem.File.Exists(SettingsFilename) == false)
+ return;
+
doc = XDocument.Load(XmlReader.Create(FileSystem.File.OpenRead(SettingsFilename)));
}
catch (FileNotFoundException)
Modified: trunk/AgateLib/UserInterface/Css/CssAdapter.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/CssAdapter.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -97,7 +97,10 @@
if (refresh)
{
- RebuildStyle(control);
+ lock (Document)
+ {
+ RebuildStyle(control);
+ }
}
var style = mObjectStyles[control];
Modified: trunk/AgateLib/UserInterface/Css/CssStyleData.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/CssStyleData.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/CssStyleData.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -49,13 +49,16 @@
Text = new CssText();
Display = CssDisplay.Initial;
+ Overflow = CssOverflow.Visible;
}
+ public CssDisplay Display { get; set; }
+ public CssOverflow Overflow { get; set; }
+ public CssPosition Position { get; set; }
+
[CssPromoteProperties]
public CssRectangle PositionData { get; set; }
- public CssPosition Position { get; set; }
-
[CssPromoteProperties]
public CssFont Font { get; set; }
@@ -74,12 +77,11 @@
[CssPromoteProperties]
public CssLayout Layout { get; set; }
- public CssDisplay Display { get; set; }
-
[CssPromoteProperties(prefix: "transition")]
public CssTransition Transition { get; set; }
[CssPromoteProperties]
public CssText Text { get; set; }
+
}
}
Modified: trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Documents/CssDocument.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -46,17 +46,23 @@
public void Clear()
{
- mMedia.Clear();
+ lock (this)
+ {
+ mMedia.Clear();
- var defaultMedium = new CssMediaSelector("all");
- Media.Add(defaultMedium);
+ var defaultMedium = new CssMediaSelector("all");
+ Media.Add(defaultMedium);
+ }
}
public void Load(string filename)
{
CssParser parser = new CssParser();
- parser.Load(this, filename);
+ lock (this)
+ {
+ parser.Load(this, filename);
+ }
OnUpdated();
}
@@ -64,7 +70,10 @@
{
CssParser parser = new CssParser();
- parser.ParseCss(this, css);
+ lock (this)
+ {
+ parser.ParseCss(this, css);
+ }
OnUpdated();
}
Modified: trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Documents/PropertyEnums.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -113,4 +113,14 @@
Right,
Center,
}
+
+ public enum CssOverflow
+ {
+ Visible,
+ Initial = Visible,
+ Hidden,
+ Scroll,
+ Auto,
+ Inherit,
+ }
}
Modified: trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Layout/CssLayoutEngine.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -128,6 +128,7 @@
}
}
+ public CssAdapter Adapter { get { return mAdapter; } }
private void RedoLayout(Container container, bool forceRefresh = false)
{
Modified: trunk/AgateLib/UserInterface/Css/Layout/Defaults/MenuDefaultStyle.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Layout/Defaults/MenuDefaultStyle.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Layout/Defaults/MenuDefaultStyle.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -30,6 +30,7 @@
public override void SetDefaultStyle(CssStyle style)
{
style.Data.Layout.Kind = CssLayoutKind.Column;
+ style.Data.Overflow = CssOverflow.Hidden;
}
}
Modified: trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Parser/CssParser.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -142,7 +142,14 @@
if (mBindingMapper.FindPropertyChain(property))
{
- currentBlock.AddProperty(name, value);
+ try
+ {
+ currentBlock.AddProperty(name, value);
+ }
+ catch(Exception)
+ {
+ Log.WriteLine(string.Format("Failed to parse property {0}.", property));
+ }
}
else
{
Modified: trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs
===================================================================
--- trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs 2014-09-09 05:35:01 UTC (rev 1522)
+++ trunk/AgateLib/UserInterface/Css/Rendering/CssRenderer.cs 2014-09-13 23:39:50 UTC (rev 1523)
@@ -37,6 +37,7 @@
ICssImageProvider mImageProvider = new CssDefaultImageProvider();
private CssAdapt...
[truncated message content] |
|
From: <ka...@us...> - 2014-09-14 00:09:19
|
Revision: 1524
http://sourceforge.net/p/agate/code/1524
Author: kanato
Date: 2014-09-14 00:09:08 +0000 (Sun, 14 Sep 2014)
Log Message:
-----------
Connect touch events for WP apps.
Modified Paths:
--------------
trunk/AgateLib/UserInterface/Widgets/MenuItem.cs
trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs
trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs
trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
trunk/AgateLib.Platform.WindowsStoreCommon/RenderTargetAdapterBase.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/GuiTest.cs
trunk/AgateLib.Tests/Tests.WindowsMetro/TestContainer.xaml.cs
trunk/AgateLib.Tests/Tests.WindowsPhone/TestContainer.xaml.cs
Added Paths:
-----------
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/CssTest.css
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Images/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Resources/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Style.css
trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/
trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/BasicGuiTest.cs
trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/GuiStuff.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/frmCssEdit.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/frmCssEdit.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/frmCssEdit.resx
Removed Paths:
-------------
trunk/AgateLib.Tests/Tests.WinForms/Assets/Images/
trunk/AgateLib.Tests/Tests.WinForms/Assets/Style.css
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.Designer.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.cs
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.resx
trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/GuiStuff.cs
Modified: trunk/AgateLib/UserInterface/Widgets/MenuItem.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/MenuItem.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib/UserInterface/Widgets/MenuItem.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -136,6 +136,7 @@
}
bool mouseDown;
+
void widget_MouseDown(object sender, MouseEventArgs e)
{
OnMouseDown(e.Buttons, e.Location);
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/DisplayImplementation/SDX_Surface.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -203,9 +203,10 @@
await window.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
- var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(mFileName));
- var sourceStream = await file.OpenStreamForReadAsync();
-
+ //var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(mFileName));
+ //var sourceStream = await file.OpenStreamForReadAsync();
+ var sourceStream = new NativeFileStream(mFileName, NativeFileMode.Open, NativeFileAccess.Read);
+
ReadFromStream(sourceStream, true);
});
}
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/Factories/DisplayFactory.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -82,7 +82,7 @@
if (resources == null)
{
- var assets = new WindowsStoreAssetFileProvider("ms-appx:///AgateLib.Platform.WindowsStoreCommon/Assets");
+ var assets = new WindowsStoreAssetFileProvider("AgateLib.Platform.WindowsStoreCommon/Assets");
resources = new AgateResourceCollection();
AgateResourceLoader.LoadResources(resources,
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/PlatformImplementation/WindowsStoreAssetFileProvider.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -1,4 +1,5 @@
using AgateLib.Platform.WindowsStore.DisplayImplementation;
+using SharpDX.IO;
using System;
using System.Collections.Generic;
using System.IO;
@@ -13,6 +14,7 @@
public class WindowsStoreAssetFileProvider : IReadFileProvider
{
string path;
+ string uriBase;
public WindowsStoreAssetFileProvider(string path)
{
@@ -20,10 +22,12 @@
path += "/";
this.path = path;
+
+ uriBase = "ms-appx:///" + path;
}
public async Task<System.IO.Stream> OpenReadAsync(string filename)
{
- Uri uri = new Uri(path + filename);
+ Uri uri = new Uri(uriBase + filename);
StorageFile storageFile =
await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(uri).AsTask().ConfigureAwait(false);
@@ -50,7 +54,7 @@
public string ReadAllText(string filename)
{
- throw new NotImplementedException();
+ return NativeFile.ReadAllText(path + filename);
}
public bool IsRealFile(string filename)
Modified: trunk/AgateLib.Platform.WindowsStoreCommon/RenderTargetAdapterBase.cs
===================================================================
--- trunk/AgateLib.Platform.WindowsStoreCommon/RenderTargetAdapterBase.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Platform.WindowsStoreCommon/RenderTargetAdapterBase.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -73,13 +73,6 @@
Disposed(this, EventArgs.Empty);
}
- void mRenderTarget_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
- {
- Input.QueueInputEvent(AgateInputEventArgs.KeyUp(
- TransformKey(e.Key),
- GetKeyModifiers()));
- }
-
private KeyModifiers GetKeyModifiers()
{
return new KeyModifiers(false, false, false);
@@ -102,9 +95,17 @@
TransformKey(e.Key),
GetKeyModifiers()));
}
+ void mRenderTarget_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ Input.QueueInputEvent(AgateInputEventArgs.KeyUp(
+ TransformKey(e.Key),
+ GetKeyModifiers()));
+ }
void mRenderTarget_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
+ Input.QueueInputEvent(AgateInputEventArgs.MouseUp(Owner,
+ e.GetCurrentPoint(RenderTargetControl).Position.ToAgatePoint(), MouseButton.Primary));
}
void mRenderTarget_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
@@ -116,6 +117,8 @@
void mRenderTarget_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
+ Input.QueueInputEvent(AgateInputEventArgs.MouseMove(Owner,
+ e.GetCurrentPoint(RenderTargetControl).Position.ToAgatePoint()));
}
void mRenderTarget_PointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
Modified: trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/AgateLib.Tests.Portable.csproj 2014-09-14 00:09:08 UTC (rev 1524)
@@ -74,6 +74,8 @@
<Compile Include="ISerialModelTest.cs" />
<Compile Include="TestInfo.cs" />
<Compile Include="TestCollection.cs" />
+ <Compile Include="UserInterfaceTests\BasicGuiTest.cs" />
+ <Compile Include="UserInterfaceTests\GuiStuff.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -88,6 +90,9 @@
<Content Include="Assets\boxsprite.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Assets\CssTest.css">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="Assets\fonts\MedievalSharp14.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -106,9 +111,39 @@
<Content Include="Assets\fonts\sample_font.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Assets\Images\ui_back_1.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Images\ui_border_1.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Images\ui_border_2.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Images\ui_widget.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Assets\jellybean.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Assets\Resources\fonts.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources\Fonts\MedievalSharp14.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources\Fonts\MedievalSharp18.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources\Fonts\MedievalSharpBold14.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources\Fonts\MedievalSharpBold18.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Resources\Fonts\MedievalSharpBold22.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Assets\smoke.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -124,6 +159,9 @@
<Content Include="Assets\spike.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Assets\Style.css">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Assets\TestResourceFile.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Copied: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/CssTest.css (from rev 1519, trunk/AgateLib.Tests/Tests.WinForms/Assets/CssTest.css)
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/CssTest.css (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/CssTest.css 2014-09-14 00:09:08 UTC (rev 1524)
@@ -0,0 +1,45 @@
+
+window
+{
+ background-image: Window;
+ background-color: #000000;
+ background-repeat: no-repeat;
+}
+
+button
+{
+ background-image: Button;
+ bg-image-stretch-left: 5;
+ bg-image-stretch-right: 5;
+ bg-image-stretch-top: 5;
+ bg-image-stretch-bottom: 5;
+ text-color: white;
+ align: center;
+ vertical-align: center;
+}
+
+button:default
+{
+ background-image: ButtonDefault;
+}
+
+button:pressed
+{
+ background-image: ButtonPressed;
+}
+
+button:hover
+{
+ overlay-image: ButtonHover;
+}
+
+button:focus
+{
+ overlay-image: ButtonFocus;
+}
+
+button:disabled
+{
+ overlay-image: ButtonDisabled;
+ text-color: gray;
+}
\ No newline at end of file
Copied: trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Style.css (from rev 1519, trunk/AgateLib.Tests/Tests.WinForms/Assets/Style.css)
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Style.css (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/Assets/Style.css 2014-09-14 00:09:08 UTC (rev 1524)
@@ -0,0 +1,29 @@
+
+window {
+ background-color: blue;
+ padding: 8px;
+ border: 10px solid black;
+ background-image: url(Images/ui_back_1.png);
+ border-image-source: url(Images/ui_border_2.png);
+ border-image-slice: 10;
+ transition: slide;
+ layout: column;
+}
+
+
+menuitem {
+ padding: 8px;
+}
+
+menuitem:selected {
+ border-image-source: url(Images/ui_border_1.png);
+ border-image-slice: 6;
+}
+
+label {
+ color: navy;
+}
+
+label#label1 {
+ color: pink;
+}
Added: trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/BasicGuiTest.cs
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/BasicGuiTest.cs (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/BasicGuiTest.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -0,0 +1,51 @@
+using AgateLib.ApplicationModels;
+using AgateLib.DisplayLib;
+using AgateLib.Geometry;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Testing.UserInterfaceTests
+{
+ public class BasicGuiTest : Scene, ISceneModelTest
+ {
+ public void ModifyModelParameters(SceneModelParameters parameters)
+ {
+ }
+
+ public Scene StartScene
+ {
+ get { return this; }
+ }
+
+ public string Name
+ {
+ get { return "Basic GUI"; }
+ }
+
+ public string Category
+ {
+ get { return "User Interface"; }
+ }
+
+ GuiStuff gs;
+
+ protected override void OnSceneStart()
+ {
+ gs = new GuiStuff();
+ gs.CreateGui();
+ }
+ public override void Update(double delta_t)
+ {
+ gs.Update();
+ }
+
+ public override void Draw()
+ {
+ Display.Clear(Color.Purple);
+ gs.Draw();
+ }
+ }
+}
Copied: trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/GuiStuff.cs (from rev 1520, trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/GuiStuff.cs)
===================================================================
--- trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/GuiStuff.cs (rev 0)
+++ trunk/AgateLib.Tests/AgateLib.Tests.Portable/UserInterfaceTests/GuiStuff.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -0,0 +1,175 @@
+using AgateLib.DisplayLib;
+using AgateLib.Geometry;
+using AgateLib.InputLib;
+using AgateLib.InputLib.Legacy;
+using AgateLib.Resources.Legacy;
+using AgateLib.UserInterface.Css;
+using AgateLib.UserInterface.Css.Documents;
+using AgateLib.UserInterface.Css.Layout;
+using AgateLib.UserInterface.Css.Rendering;
+using AgateLib.UserInterface.Widgets;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AgateLib.Testing.UserInterfaceTests
+{
+ public class GuiStuff
+ {
+ Gui gui;
+ CssAdapter adapter;
+ List<Window> windows = new List<Window>();
+ Font font;
+ Joystick joy;
+
+ public void CreateGui()
+ {
+ AgateResourceCollection res = new AgateResourceCollection("Resources/fonts.xml");
+
+ font = new Font("Medieval Sharp");
+ font.AddFont(new FontSurface(res, "MedievalSharp18"), 18, FontStyles.None);
+ font.AddFont(new FontSurface(res, "MedievalSharp14"), 14, FontStyles.None);
+
+ var doc = new CssDocument();
+
+ doc.Load("Style.css");
+ adapter = new CssAdapter(doc, font);
+
+ gui = new Gui(new CssRenderer(adapter), new CssLayoutEngine(adapter));
+
+ //var wind = CreateWindow(res);
+
+ //wind.Children.Add(new Label("This is a label") { Name = "label1" });
+ //wind.Children.Add(new Label("This is another label") { Name = "label2" });
+
+ joy = AgateLib.InputLib.JoystickInput.Joysticks.FirstOrDefault();
+
+ var wind = CreateWindow();
+ var menu = new Menu();
+
+ menu.Children.Add(MenuItem.OfLabel("First Label", "lblA"));
+ menu.Children.Add(MenuItem.OfLabel("Second Label", "lblB"));
+ menu.Children.Add(MenuItem.OfLabel("Third Label", "lblC"));
+
+ foreach(MenuItem menuItem in menu.Children)
+ {
+ menuItem.AllowDiscard = true;
+ }
+
+ wind.Children.Add(menu);
+
+ Mouse.MouseMove += Mouse_MouseMove;
+ Mouse.MouseDown += Mouse_MouseDown;
+ Mouse.MouseUp += Mouse_MouseUp;
+
+ Keyboard.KeyDown += Keyboard_KeyDown;
+ Keyboard.KeyUp += Keyboard_KeyUp;
+
+ if (joy != null)
+ {
+ joy.ButtonPressed += joy_ButtonPressed;
+ joy.ButtonReleased += joy_ButtonReleased;
+ }
+
+ AgateLib.InputLib.Input.InputHandlers.Add(gui);
+
+ foreach (var ctrl in gui.Desktop.Descendants)
+ ctrl.MouseDown += ctrl_MouseDown;
+ }
+
+ void joy_ButtonReleased(object sender, JoystickEventArgs e)
+ {
+
+ }
+
+ void joy_ButtonPressed(object sender, JoystickEventArgs e)
+ {
+ }
+
+ void Keyboard_KeyUp(InputEventArgs e)
+ {
+ gui.OnKeyUp(e);
+ }
+
+ void Keyboard_KeyDown(InputEventArgs e)
+ {
+ gui.OnKeyDown(e);
+ }
+
+ private Window CreateWindow()
+ {
+ var wind = new Window();
+
+ windows.Add(wind);
+ gui.Desktop.Children.Add(wind);
+
+ return wind;
+ }
+
+ public CssAdapter Adapter { get { return adapter; } }
+
+ void ctrl_MouseDown(object sender, MouseEventArgs e)
+ {
+ if (ItemClicked != null)
+ ItemClicked(sender, e);
+ }
+
+ void Mouse_MouseUp(InputEventArgs e)
+ {
+ gui.OnMouseUp(e);
+ }
+
+ void Mouse_MouseDown(InputEventArgs e)
+ {
+ gui.OnMouseDown(e);
+ }
+
+ void Mouse_MouseMove(InputEventArgs e)
+ {
+ gui.OnMouseMove(e);
+ }
+
+ public event EventHandler ItemClicked;
+
+
+ public string Css
+ {
+ set
+ {
+ adapter.Document = CssDocument.FromText(value);
+ }
+ }
+ public void Update()
+ {
+ gui.OnUpdate(Display.DeltaTime, true);
+ }
+ public void Draw()
+ {
+ gui.Draw();
+ }
+
+ public void Render()
+ {
+ gui.OnUpdate(Display.DeltaTime / 1000.0, true);
+
+ Display.BeginFrame();
+ Display.Clear(Color.FromArgb(146, 146, 146));
+
+ Draw();
+
+ Display.EndFrame();
+ }
+
+ int index;
+
+ public void HideShow()
+ {
+ windows[index].Visible = !windows[index].Visible;
+
+ index++;
+ index %= windows.Count;
+ }
+ }
+}
Modified: trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj
===================================================================
--- trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Tests/Tests.WinForms/AgateLib.Tests.WinForms.csproj 2014-09-14 00:09:08 UTC (rev 1524)
@@ -324,13 +324,12 @@
<DependentUpon>LightingTestForm.cs</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Compile Include="UserInterfaceTests\Form1.cs">
+ <Compile Include="UserInterfaceTests\frmCssEdit.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="UserInterfaceTests\Form1.Designer.cs">
- <DependentUpon>Form1.cs</DependentUpon>
+ <Compile Include="UserInterfaceTests\frmCssEdit.Designer.cs">
+ <DependentUpon>frmCssEdit.cs</DependentUpon>
</Compile>
- <Compile Include="UserInterfaceTests\GuiStuff.cs" />
<Compile Include="UserInterfaceTests\GuiTest.cs" />
<Compile Include="WinFormsTests\Converters.cs">
<SubType>Code</SubType>
@@ -403,8 +402,8 @@
<SubType>Designer</SubType>
<DependentUpon>LightingTestForm.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="UserInterfaceTests\Form1.resx">
- <DependentUpon>Form1.cs</DependentUpon>
+ <EmbeddedResource Include="UserInterfaceTests\frmCssEdit.resx">
+ <DependentUpon>frmCssEdit.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Assets\9ball.png">
@@ -465,9 +464,6 @@
</None>
</ItemGroup>
<ItemGroup>
- <None Include="Assets\Style.css">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Assets\largeimage.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -486,18 +482,6 @@
<Content Include="Assets\fonts\MedievalSharpBold22.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="Assets\Images\ui_back_1.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="Assets\Images\ui_border_1.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="Assets\Images\ui_border_2.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="Assets\Images\ui_widget.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="Assets\mask_bg-bricks.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Deleted: trunk/AgateLib.Tests/Tests.WinForms/Assets/Style.css
===================================================================
--- trunk/AgateLib.Tests/Tests.WinForms/Assets/Style.css 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Tests/Tests.WinForms/Assets/Style.css 2014-09-14 00:09:08 UTC (rev 1524)
@@ -1,32 +0,0 @@
-
-window {
- background-color: blue;
- padding: 8px;
- border: 10px solid black;
- background-image: url(Images/ui_back_1.png);
- border-image-source: url(Images/ui_border_2.png);
- border-image-slice: 10;
- transition: slide;
- layout: column;
-}
-
-
-menuitem:hover {
- border-image-source: url(Images/ui_border_1.png);
- border-image-slice: 6;
-}
-
-menuitem:selected {
- border-image-source: url(Images/ui_border_1.png);
- border-image-slice: 6;
-}
-
-label {
- color: lightgreen;
- margin-left: 4px;
- background-color: rgba(255, 216, 0, 0.15);
-}
-
-label#label1 {
- color: pink;
-}
Deleted: trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.Designer.cs
===================================================================
--- trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.Designer.cs 2014-09-13 23:39:50 UTC (rev 1523)
+++ trunk/AgateLib.Tests/Tests.WinForms/UserInterfaceTests/Form1.Designer.cs 2014-09-14 00:09:08 UTC (rev 1524)
@@ -1,194 +0,0 @@
-namespace AgateLib.Testing.UserInterfaceTests
-{
- partial class Form1
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.artGuiTest = new AgateLib.Platform.WinForms.Controls.AgateRenderTarget();
- this.splitContainer1 = new System.Windows.Forms.SplitContainer();
- this.panel1 = new System.Windows.Forms.Panel();
- this.cboPropertyItems = new System.Windows.Forms.ComboBox();
- this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
- this.lblFrames = new System.Windows.Forms.Label();
- this.txtCss = new System.Windows.Forms.TextBox();
- this.artGuiTest = new AgateLib.Platform.WinForms.Controls.AgateRenderTarget();
- this.splitContainer2 = new System.Windows.Forms.SplitContainer();
- this.btnHideShow = new System.Windows.Forms.Button();
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
- this.splitContainer1.Panel1.SuspendLayout();
- this.splitContainer1.Panel2.SuspendLayout();
- this.splitContainer1.SuspendLayout();
- this.panel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
- this.splitContainer2.Panel1.SuspendLayout();
- this.splitContainer2.Panel2.SuspendLayout();
- this.splitContainer2.SuspendLayout();
- this.SuspendLayout();
- //
- // splitContainer1
- //
- this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer1.Location = new System.Drawing.Point(0, 0);
- this.splitContainer1.Name = "splitContainer1";
- //
- // splitContainer1.Panel1
- //
- this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
- //
- // splitContainer1.Panel2
- //
- this.splitContainer1.Panel2.Controls.Add(this.artGuiTest);
- this.splitContainer1.Size = new System.Drawing.Size(926, 590);
- this.splitContainer1.SplitterDistance = 472;
- this.splitContainer1.TabIndex = 0;
- //
- // panel1
- //
- this.panel1.Controls.Add(this.btnHideShow);
- this.panel1.Controls.Add(this.cboPropertyItems);
- this.panel1.Controls.Add(this.propertyGrid1);
- this.panel1.Controls.Add(this.lblFrames);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Location = new System.Drawing.Point(0, 0);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(472, 291);
- this.panel1.TabIndex = 1;
- //
- // cboPropertyItems
- //
- this.cboPropertyItems.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cboPropertyItems.FormattingEnabled = true;
- this.cboPropertyItems.Location = new System.Drawing.Point(12, 47);
- this.cboPropertyItems.Name = "cboPropertyItems";
- this.cboPropertyItems.Size = new System.Drawing.Size(454, 21);
- this.cboPropertyItems.TabIndex = 2;
- this.cboPropertyItems.SelectedIndexChanged += new System.EventHandler(this.cboPropertyItems_SelectedIndexChanged);
- //
- // propertyGrid1
- //
- this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.propertyGrid1.Location = new System.Drawing.Point(12, 74);
- this.propertyGrid1.Name = "propertyGrid1";
- this.propertyGrid1.Size = new System.Drawing.Size(457, 208);
- this.propertyGrid1.TabIndex = 1;
- //
- // lblFrames
- //
- this.lblFrames.AutoSize = true;
- this.lblFrames.Location = new System.Drawing.Point(12, 15);
- this.lblFrames.Name = "lblFrames";
- this.lblFrames.Size = new System.Drawing.Size(35, 13);
- this.lblFrames.TabIndex = 0;
- this.lblFrames.Text = "label1";
- //
- // txtCss
- //
- this.txtCss.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtCss.Location = new System.Drawing.Point(0, 0);
- this.txtCss.Multiline = true;
- this.txtCss.Name = "txtCss";
- this.txtCss.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.txtCss.Size = new System.Drawing.Size(472, 295);
- this.txtCss.TabIndex = 0;
- this.txtCss.TextChanged += new System.EventHandler(this.txtCss_TextChanged);
- //
- // artGuiTest
- //
- this.artGuiTest.Dock = System.Windows.Forms.DockStyle.Fill;
- this.artGuiTest.Location = new System.Drawing.Point(0, 0);
- this.artGuiTest.Name = "artGuiTest";
- this.artGuiTest.Size = new System.Drawing.Size(450, 590);
- this.artGuiTest.TabIndex = 0;
- //
- // splitContainer2
- //
- this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer2.Location = new System.Drawing.Point(0, 0);
- this.splitContainer2.Name = "splitContainer2";
- this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
- //
- // splitContainer2.Panel1
- //
- this.splitContainer2.Panel1.Controls.Add(this.txtCss);
- //
- // splitContainer2.Panel2
- //
- this.splitContainer2.Panel2.Controls.Add(this.panel1);
- this.splitContainer2.Size = new System.Drawing.Size(472, 590);
- this.splitContainer2.SplitterDistance = 295;
- this.splitContainer2.TabIndex = 2;
- //
- // btnHideShow
- //
- this.btnHideShow.Location = new System.Drawing.Point(391, 10);
- this.btnHideShow.Name = "btnHideShow";
- this.btnHideShow.Size = new System.Drawing.Size(75, 23);
- this.btnHideShow.TabIndex = 3;
- this.btnHideShow.Text = "Hide/Show";
- this.btnHideShow.UseVisualStyleBackColor = true;
- this.btnHideShow.Click += new System.EventHandler(this.btnHideShow_Click);
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(926, 590);
- this.Controls.Add(this.splitContainer1);
- this.Name = "Form1";
- this.Text = "Form1";
- this.Load += new System.EventHandler(this.Form1_Load);
- this.splitContainer1.Panel1.ResumeLayout(false);
- this.splitContainer1.Panel2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
- this.splitContainer1.ResumeLayout(false);
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- this.splitContainer2.Panel1.ResumeLayout(false);
- this.splitContainer2.Panel1.PerformLayout();
- this.splitContainer2.Panel2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
- this.splitContainer2.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private AgateLib.Platform.WinForms.Controls.AgateRenderTarget artGuiTest;
- private System.Windows.Forms.SplitContainer splitContainer1;
- private System.Windows.Forms.TextBox txtCss;
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Label lblFrames;
- private System.Windows.Forms.PropertyGrid propertyGrid1;
- private System.Windows.Forms.ComboBox cboPropertyItems;
- private System.Windows.Forms.SplitContainer splitContainer2;
- ...
[truncated message content] |