summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2013-05-04 22:59:31 -0700
committerRobin Watts <robin.watts@artifex.com>2013-05-16 19:25:44 +0100
commitced8337a902cfb9988d014c099b90b2b66212825 (patch)
treec91a41d504b4cbddec169a2e5e4a2a5031863ad4
parent4bbdac7510e0a02f86fd00629a8b344d85404528 (diff)
downloadmupdf-ced8337a902cfb9988d014c099b90b2b66212825.tar.xz
Major changes in the entire design.
Initial commit of this and it has several issues that have to be worked through. Lots of broken stuff but I needed to get it in place. Added 2 new classes. One is muctx which contains all the interfacing to mupdf and uses standard c++ types. The other is mudocument which interfaces between muctx and the WinRT world. It passes WinRT objects to and from applications which can be written in C++, C#, Visual Basic, Javascript etc. mudocument and muctx will reside in a winRT DLL. The Viewer application (c++ version) is now in mupdf_cpp project and now has a flip view structure that includes a scroll viewer which has data binding to a collection. This enables much easier zooming and updating, however I am still trying how to bind the canvas elements that contain the text search or link information.
-rw-r--r--winrt/mupdf.sln234
-rw-r--r--winrt/mupdf_cpp/App.xaml20
-rw-r--r--winrt/mupdf_cpp/App.xaml.cpp107
-rw-r--r--winrt/mupdf_cpp/App.xaml.h24
-rw-r--r--winrt/mupdf_cpp/Assets/mupdf_logo.pngbin0 -> 12690 bytes
-rw-r--r--winrt/mupdf_cpp/Assets/mupdf_smallogo.pngbin0 -> 4108 bytes
-rw-r--r--winrt/mupdf_cpp/Assets/mupdf_splash.pngbin0 -> 23297 bytes
-rw-r--r--winrt/mupdf_cpp/Assets/mupdf_storelogo.pngbin0 -> 5382 bytes
-rw-r--r--winrt/mupdf_cpp/Common/StandardStyles.xaml1879
-rw-r--r--winrt/mupdf_cpp/DocumentPage.cpp14
-rw-r--r--winrt/mupdf_cpp/DocumentPage.h97
-rw-r--r--winrt/mupdf_cpp/LVContents.cpp9
-rw-r--r--winrt/mupdf_cpp/LVContents.h12
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml149
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml.cpp1565
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml.h198
-rw-r--r--winrt/mupdf_cpp/Package.appxmanifest48
-rw-r--r--winrt/mupdf_cpp/RectList.cpp16
-rw-r--r--winrt/mupdf_cpp/RectList.h68
-rw-r--r--winrt/mupdf_cpp/mupdf_cpp.vcxproj202
-rw-r--r--winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters56
-rw-r--r--winrt/mupdf_cpp/pch.cpp6
-rw-r--r--winrt/mupdf_cpp/pch.h9
-rw-r--r--winrt/mupdfwinrt/Links.cpp11
-rw-r--r--winrt/mupdfwinrt/Links.h72
-rw-r--r--winrt/mupdfwinrt/muctx.cpp404
-rw-r--r--winrt/mupdfwinrt/muctx.h81
-rw-r--r--winrt/mupdfwinrt/mudocument.cpp212
-rw-r--r--winrt/mupdfwinrt/mudocument.h40
-rw-r--r--winrt/mupdfwinrt/mupdfwinrt.vcxproj230
-rw-r--r--winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters22
-rw-r--r--winrt/mupdfwinrt/pch.cpp6
-rw-r--r--winrt/mupdfwinrt/pch.h6
-rw-r--r--winrt/mupdfwinrt/utils.h8
-rw-r--r--winrt/winapp/MainPage.xaml9
-rw-r--r--winrt/winapp/MainPage.xaml.cpp114
-rw-r--r--winrt/winapp/MainPage.xaml.h16
-rw-r--r--winrt/winapp/winapp.vcxproj2
38 files changed, 5920 insertions, 26 deletions
diff --git a/winrt/mupdf.sln b/winrt/mupdf.sln
index 60aebbeb..86d70448 100644
--- a/winrt/mupdf.sln
+++ b/winrt/mupdf.sln
@@ -24,113 +24,347 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmupdf-nov8_winRT", "libm
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libthirdparty_winRT", "libthirdparty_winRT.vcxproj", "{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdfwinrt", "mupdfwinrt\mupdfwinrt.vcxproj", "{9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mupdf_csharp", "mupdf_csharp\mupdf_csharp.csproj", "{FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdf_cpp", "mupdf_cpp\mupdf_cpp.vcxproj", "{0204A4E7-F1B8-4268-A67C-A2C674B4742D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33} = {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
+ Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Memento|Any CPU = Memento|Any CPU
Memento|ARM = Memento|ARM
+ Memento|Mixed Platforms = Memento|Mixed Platforms
Memento|Win32 = Memento|Win32
Memento|x64 = Memento|x64
+ Memento|x86 = Memento|x86
+ Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
+ Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|ARM.ActiveCfg = Debug|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|ARM.Build.0 = Debug|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Win32.ActiveCfg = Debug|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Win32.Build.0 = Debug|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|x64.ActiveCfg = Debug|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|x86.ActiveCfg = Debug|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|x86.Build.0 = Debug|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Any CPU.ActiveCfg = Memento|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|ARM.ActiveCfg = Memento|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Mixed Platforms.ActiveCfg = Memento|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Mixed Platforms.Build.0 = Memento|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Win32.ActiveCfg = Memento|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|x64.ActiveCfg = Memento|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|x86.ActiveCfg = Memento|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|x86.Build.0 = Memento|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Any CPU.ActiveCfg = Release|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|ARM.ActiveCfg = Release|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|ARM.Build.0 = Release|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Mixed Platforms.Build.0 = Release|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Win32.ActiveCfg = Release|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Win32.Build.0 = Release|Win32
{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|x64.ActiveCfg = Release|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|x86.ActiveCfg = Release|Win32
+ {A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|x86.Build.0 = Release|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|ARM.ActiveCfg = Debug|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|ARM.Build.0 = Debug|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|ARM.Deploy.0 = Debug|ARM
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Mixed Platforms.Deploy.0 = Debug|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Win32.ActiveCfg = Debug|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Win32.Build.0 = Debug|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|Win32.Deploy.0 = Debug|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x64.ActiveCfg = Debug|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x64.Build.0 = Debug|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x64.Deploy.0 = Debug|x64
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x86.ActiveCfg = Debug|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x86.Build.0 = Debug|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Debug|x86.Deploy.0 = Debug|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Any CPU.ActiveCfg = Memento|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|ARM.ActiveCfg = Memento|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|ARM.Build.0 = Memento|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|ARM.Deploy.0 = Memento|ARM
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Mixed Platforms.ActiveCfg = Memento|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Mixed Platforms.Build.0 = Memento|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Mixed Platforms.Deploy.0 = Memento|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Win32.ActiveCfg = Memento|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Win32.Build.0 = Memento|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|Win32.Deploy.0 = Memento|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x64.ActiveCfg = Memento|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x64.Build.0 = Memento|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x64.Deploy.0 = Memento|x64
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x86.ActiveCfg = Memento|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x86.Build.0 = Memento|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Memento|x86.Deploy.0 = Memento|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Any CPU.ActiveCfg = Release|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|ARM.ActiveCfg = Release|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|ARM.Build.0 = Release|ARM
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|ARM.Deploy.0 = Release|ARM
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Mixed Platforms.Deploy.0 = Release|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Win32.ActiveCfg = Release|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Win32.Build.0 = Release|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|Win32.Deploy.0 = Release|Win32
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x64.ActiveCfg = Release|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x64.Build.0 = Release|x64
{35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x64.Deploy.0 = Release|x64
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x86.ActiveCfg = Release|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x86.Build.0 = Release|Win32
+ {35C27DF7-0CF2-413E-9C7A-6436AFEE5D4E}.Release|x86.Deploy.0 = Release|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|ARM.ActiveCfg = Debug|ARM
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|ARM.Build.0 = Debug|ARM
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|Win32.ActiveCfg = Debug|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|Win32.Build.0 = Debug|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|x64.ActiveCfg = Debug|x64
{0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|x64.Build.0 = Debug|x64
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|x86.ActiveCfg = Debug|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Debug|x86.Build.0 = Debug|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|Any CPU.ActiveCfg = Memento|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|ARM.ActiveCfg = Memento|ARM
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|ARM.Build.0 = Memento|ARM
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|Mixed Platforms.ActiveCfg = Memento|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|Mixed Platforms.Build.0 = Memento|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|Win32.ActiveCfg = Memento|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|Win32.Build.0 = Memento|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|x64.ActiveCfg = Memento|x64
{0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|x64.Build.0 = Memento|x64
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|x86.ActiveCfg = Memento|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Memento|x86.Build.0 = Memento|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Release|Any CPU.ActiveCfg = Release|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|ARM.ActiveCfg = Release|ARM
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|ARM.Build.0 = Release|ARM
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Release|Mixed Platforms.Build.0 = Release|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|Win32.ActiveCfg = Release|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|Win32.Build.0 = Release|Win32
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|x64.ActiveCfg = Release|x64
{0715F3CF-5D1B-4617-A331-6527371365B7}.Release|x64.Build.0 = Release|x64
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Release|x86.ActiveCfg = Release|Win32
+ {0715F3CF-5D1B-4617-A331-6527371365B7}.Release|x86.Build.0 = Release|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|Any CPU.ActiveCfg = Debug|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|ARM.ActiveCfg = Debug|ARM
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|ARM.Build.0 = Debug|ARM
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|Win32.ActiveCfg = Debug|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|Win32.Build.0 = Debug|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|x64.ActiveCfg = Debug|x64
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|x64.Build.0 = Debug|x64
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|x86.ActiveCfg = Debug|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Debug|x86.Build.0 = Debug|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|Any CPU.ActiveCfg = Memento|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|ARM.ActiveCfg = Memento|ARM
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|ARM.Build.0 = Memento|ARM
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|Mixed Platforms.ActiveCfg = Memento|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|Mixed Platforms.Build.0 = Memento|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|Win32.ActiveCfg = Memento|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|Win32.Build.0 = Memento|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|x64.ActiveCfg = Memento|x64
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|x64.Build.0 = Memento|x64
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|x86.ActiveCfg = Memento|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Memento|x86.Build.0 = Memento|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|Any CPU.ActiveCfg = Release|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|ARM.ActiveCfg = Release|ARM
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|ARM.Build.0 = Release|ARM
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|Mixed Platforms.Build.0 = Release|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|Win32.ActiveCfg = Release|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|Win32.Build.0 = Release|Win32
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|x64.ActiveCfg = Release|x64
{5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|x64.Build.0 = Release|x64
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|x86.ActiveCfg = Release|Win32
+ {5AFFE821-C5C8-45FB-B834-10FED76E49A7}.Release|x86.Build.0 = Release|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|ARM.ActiveCfg = Debug|ARM
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|ARM.Build.0 = Debug|ARM
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|Win32.ActiveCfg = Debug|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|Win32.Build.0 = Debug|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|x64.ActiveCfg = Debug|x64
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|x64.Build.0 = Debug|x64
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|x86.ActiveCfg = Debug|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Debug|x86.Build.0 = Debug|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|Any CPU.ActiveCfg = Memento|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|ARM.ActiveCfg = Memento|ARM
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|ARM.Build.0 = Memento|ARM
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|Mixed Platforms.ActiveCfg = Memento|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|Mixed Platforms.Build.0 = Memento|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|Win32.ActiveCfg = Memento|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|Win32.Build.0 = Memento|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|x64.ActiveCfg = Memento|x64
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|x64.Build.0 = Memento|x64
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|x86.ActiveCfg = Memento|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Memento|x86.Build.0 = Memento|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|Any CPU.ActiveCfg = Release|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|ARM.ActiveCfg = Release|ARM
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|ARM.Build.0 = Release|ARM
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|Mixed Platforms.Build.0 = Release|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|Win32.ActiveCfg = Release|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|Win32.Build.0 = Release|Win32
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|x64.ActiveCfg = Release|x64
{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|x64.Build.0 = Release|x64
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|x86.ActiveCfg = Release|Win32
+ {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}.Release|x86.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|ARM.ActiveCfg = Debug|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|ARM.Build.0 = Debug|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|Win32.Build.0 = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|x64.ActiveCfg = Debug|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|x64.Build.0 = Debug|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|x86.ActiveCfg = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Debug|x86.Build.0 = Debug|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|Any CPU.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|ARM.ActiveCfg = Release|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|ARM.Build.0 = Release|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|Mixed Platforms.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|Mixed Platforms.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|Win32.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|Win32.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|x64.ActiveCfg = Release|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|x64.Build.0 = Release|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|x86.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Memento|x86.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|Any CPU.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|ARM.ActiveCfg = Release|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|ARM.Build.0 = Release|ARM
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|Win32.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|Win32.Build.0 = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x64.ActiveCfg = Release|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x64.Build.0 = Release|x64
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x86.ActiveCfg = Release|Win32
+ {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x86.Build.0 = Release|Win32
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.ActiveCfg = Debug|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.Build.0 = Debug|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.Deploy.0 = Debug|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.ActiveCfg = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.Build.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.Deploy.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.ActiveCfg = Debug|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.Build.0 = Debug|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.Deploy.0 = Debug|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.ActiveCfg = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.Build.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.Deploy.0 = Debug|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.ActiveCfg = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.Build.0 = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.Deploy.0 = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.ActiveCfg = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.Build.0 = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.Deploy.0 = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.Deploy.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.Deploy.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.ActiveCfg = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.Build.0 = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.Deploy.0 = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.Deploy.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.ActiveCfg = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.Build.0 = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.Deploy.0 = Release|ARM
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.Deploy.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.Deploy.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.ActiveCfg = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.Build.0 = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.Deploy.0 = Release|x64
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.ActiveCfg = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.Build.0 = Release|x86
+ {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.Deploy.0 = Release|x86
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|ARM.ActiveCfg = Debug|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|ARM.Build.0 = Debug|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|ARM.Deploy.0 = Debug|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Mixed Platforms.Deploy.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Win32.Build.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Win32.Deploy.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x64.ActiveCfg = Debug|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x64.Build.0 = Debug|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x64.Deploy.0 = Debug|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x86.ActiveCfg = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x86.Build.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|x86.Deploy.0 = Debug|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Any CPU.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|ARM.ActiveCfg = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|ARM.Build.0 = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|ARM.Deploy.0 = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Mixed Platforms.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Mixed Platforms.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Mixed Platforms.Deploy.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Win32.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Win32.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|Win32.Deploy.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x64.ActiveCfg = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x64.Build.0 = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x64.Deploy.0 = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x86.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x86.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Memento|x86.Deploy.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Any CPU.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|ARM.ActiveCfg = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|ARM.Build.0 = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|ARM.Deploy.0 = Release|ARM
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Mixed Platforms.Deploy.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Win32.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Win32.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|Win32.Deploy.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x64.ActiveCfg = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x64.Build.0 = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x64.Deploy.0 = Release|x64
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x86.ActiveCfg = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x86.Build.0 = Release|Win32
+ {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/winrt/mupdf_cpp/App.xaml b/winrt/mupdf_cpp/App.xaml
new file mode 100644
index 00000000..4dabc5cc
--- /dev/null
+++ b/winrt/mupdf_cpp/App.xaml
@@ -0,0 +1,20 @@
+<Application
+ x:Class="mupdf_cpp.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:mupdf_cpp">
+
+ <Application.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+
+ <!--
+ Styles that define common aspects of the platform look and feel
+ Required by Visual Studio project and item templates
+ -->
+ <ResourceDictionary Source="Common/StandardStyles.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ </ResourceDictionary>
+ </Application.Resources>
+</Application>
diff --git a/winrt/mupdf_cpp/App.xaml.cpp b/winrt/mupdf_cpp/App.xaml.cpp
new file mode 100644
index 00000000..1b84a1ab
--- /dev/null
+++ b/winrt/mupdf_cpp/App.xaml.cpp
@@ -0,0 +1,107 @@
+//
+// App.xaml.cpp
+// Implementation of the App class.
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+
+using namespace mupdf_cpp;
+
+using namespace Platform;
+using namespace Windows::ApplicationModel;
+using namespace Windows::ApplicationModel::Activation;
+using namespace Windows::Foundation;
+using namespace Windows::Foundation::Collections;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+using namespace Windows::UI::Xaml::Data;
+using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI::Xaml::Interop;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Navigation;
+
+// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
+
+/// <summary>
+/// Initializes the singleton application object. This is the first line of authored code
+/// executed, and as such is the logical equivalent of main() or WinMain().
+/// </summary>
+App::App()
+{
+ InitializeComponent();
+ Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
+}
+
+/// <summary>
+/// Invoked when the application is launched normally by the end user. Other entry points
+/// will be used when the application is launched to open a specific file, to display
+/// search results, and so forth.
+/// </summary>
+/// <param name="args">Details about the launch request and process.</param>
+void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args)
+{
+ auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == nullptr)
+ {
+ // Create a Frame to act as the navigation context and associate it with
+ // a SuspensionManager key
+ rootFrame = ref new Frame();
+
+ if (args->PreviousExecutionState == ApplicationExecutionState::Terminated)
+ {
+ // TODO: Restore the saved session state only when appropriate, scheduling the
+ // final launch steps after the restore is complete
+
+ }
+
+ if (rootFrame->Content == nullptr)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ if (!rootFrame->Navigate(TypeName(MainPage::typeid), args->Arguments))
+ {
+ throw ref new FailureException("Failed to create initial page");
+ }
+ }
+ // Place the frame in the current Window
+ Window::Current->Content = rootFrame;
+ // Ensure the current window is active
+ Window::Current->Activate();
+ }
+ else
+ {
+ if (rootFrame->Content == nullptr)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ if (!rootFrame->Navigate(TypeName(MainPage::typeid), args->Arguments))
+ {
+ throw ref new FailureException("Failed to create initial page");
+ }
+ }
+ // Ensure the current window is active
+ Window::Current->Activate();
+ }
+}
+
+/// <summary>
+/// Invoked when application execution is being suspended. Application state is saved
+/// without knowing whether the application will be terminated or resumed with the contents
+/// of memory still intact.
+/// </summary>
+/// <param name="sender">The source of the suspend request.</param>
+/// <param name="e">Details about the suspend request.</param>
+void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
+{
+ (void) sender; // Unused parameter
+ (void) e; // Unused parameter
+
+ //TODO: Save application state and stop any background activity
+}
diff --git a/winrt/mupdf_cpp/App.xaml.h b/winrt/mupdf_cpp/App.xaml.h
new file mode 100644
index 00000000..2ed35bd1
--- /dev/null
+++ b/winrt/mupdf_cpp/App.xaml.h
@@ -0,0 +1,24 @@
+//
+// App.xaml.h
+// Declaration of the App class.
+//
+
+#pragma once
+
+#include "App.g.h"
+
+namespace mupdf_cpp
+{
+ /// <summary>
+ /// Provides application-specific behavior to supplement the default Application class.
+ /// </summary>
+ ref class App sealed
+ {
+ public:
+ App();
+ virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) override;
+
+ private:
+ void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
+ };
+}
diff --git a/winrt/mupdf_cpp/Assets/mupdf_logo.png b/winrt/mupdf_cpp/Assets/mupdf_logo.png
new file mode 100644
index 00000000..ba6b005d
--- /dev/null
+++ b/winrt/mupdf_cpp/Assets/mupdf_logo.png
Binary files differ
diff --git a/winrt/mupdf_cpp/Assets/mupdf_smallogo.png b/winrt/mupdf_cpp/Assets/mupdf_smallogo.png
new file mode 100644
index 00000000..15997f5c
--- /dev/null
+++ b/winrt/mupdf_cpp/Assets/mupdf_smallogo.png
Binary files differ
diff --git a/winrt/mupdf_cpp/Assets/mupdf_splash.png b/winrt/mupdf_cpp/Assets/mupdf_splash.png
new file mode 100644
index 00000000..5f011d17
--- /dev/null
+++ b/winrt/mupdf_cpp/Assets/mupdf_splash.png
Binary files differ
diff --git a/winrt/mupdf_cpp/Assets/mupdf_storelogo.png b/winrt/mupdf_cpp/Assets/mupdf_storelogo.png
new file mode 100644
index 00000000..1b6473d4
--- /dev/null
+++ b/winrt/mupdf_cpp/Assets/mupdf_storelogo.png
Binary files differ
diff --git a/winrt/mupdf_cpp/Common/StandardStyles.xaml b/winrt/mupdf_cpp/Common/StandardStyles.xaml
new file mode 100644
index 00000000..414be872
--- /dev/null
+++ b/winrt/mupdf_cpp/Common/StandardStyles.xaml
@@ -0,0 +1,1879 @@
+<!--
+ This file contains XAML styles that simplify application development.
+
+ These are not merely convenient, but are required by most Visual Studio project and item templates.
+ Removing, renaming, or otherwise modifying the content of these files may result in a project that
+ does not build, or that will not build once additional pages are added. If variations on these
+ styles are desired it is recommended that you copy the content under a new name and modify your
+ private copy.
+-->
+
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+ <!-- Non-brush values that vary across themes -->
+
+ <ResourceDictionary.ThemeDictionaries>
+ <ResourceDictionary x:Key="Default">
+ <x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
+ <x:String x:Key="BackButtonSnappedGlyph">&#xE0BA;</x:String>
+ </ResourceDictionary>
+
+ <ResourceDictionary x:Key="HighContrast">
+ <x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
+ <x:String x:Key="BackButtonSnappedGlyph">&#xE0C4;</x:String>
+ </ResourceDictionary>
+ </ResourceDictionary.ThemeDictionaries>
+
+ <x:String x:Key="ChevronGlyph">&#xE26B;</x:String>
+
+ <!-- RichTextBlock styles -->
+
+ <Style x:Key="BasicRichTextStyle" TargetType="RichTextBlock">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
+ <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
+ <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
+ <Setter Property="TextTrimming" Value="WordEllipsis"/>
+ <Setter Property="TextWrapping" Value="Wrap"/>
+ <Setter Property="Typography.StylisticSet20" Value="True"/>
+ <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
+ <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
+ </Style>
+
+ <Style x:Key="BaselineRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BasicRichTextStyle}">
+ <Setter Property="LineHeight" Value="20"/>
+ <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
+ <!-- Properly align text along its baseline -->
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="4"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="ItemRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}"/>
+
+ <Style x:Key="BodyRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}">
+ <Setter Property="FontWeight" Value="SemiLight"/>
+ </Style>
+
+ <!-- TextBlock styles -->
+
+ <Style x:Key="BasicTextStyle" TargetType="TextBlock">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
+ <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
+ <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
+ <Setter Property="TextTrimming" Value="WordEllipsis"/>
+ <Setter Property="TextWrapping" Value="Wrap"/>
+ <Setter Property="Typography.StylisticSet20" Value="True"/>
+ <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
+ <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
+ </Style>
+
+ <Style x:Key="BaselineTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextStyle}">
+ <Setter Property="LineHeight" Value="20"/>
+ <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
+ <!-- Properly align text along its baseline -->
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="4"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="HeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="56"/>
+ <Setter Property="FontWeight" Value="Light"/>
+ <Setter Property="LineHeight" Value="40"/>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-2" Y="8"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="SubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="26.667"/>
+ <Setter Property="FontWeight" Value="Light"/>
+ <Setter Property="LineHeight" Value="30"/>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="6"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="TitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontWeight" Value="SemiBold"/>
+ </Style>
+
+ <Style x:Key="SubtitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontWeight" Value="Normal"/>
+ </Style>
+
+ <Style x:Key="ItemTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}"/>
+
+ <Style x:Key="BodyTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontWeight" Value="SemiLight"/>
+ </Style>
+
+ <Style x:Key="CaptionTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="12"/>
+ <Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
+ </Style>
+
+ <Style x:Key="GroupHeaderTextStyle" TargetType="TextBlock">
+ <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
+ <Setter Property="TextTrimming" Value="WordEllipsis"/>
+ <Setter Property="TextWrapping" Value="NoWrap"/>
+ <Setter Property="Typography.StylisticSet20" Value="True"/>
+ <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
+ <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
+ <Setter Property="FontSize" Value="26.667"/>
+ <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
+ <Setter Property="FontWeight" Value="Light"/>
+ <Setter Property="LineHeight" Value="30"/>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="6"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!-- Button styles -->
+
+ <!--
+ TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. There
+ are two styles that are based on TextButtonStyle (TextPrimaryButtonStyle and TextSecondaryButtonStyle)
+ which are used in the GroupedItemsPage as a group header and in the FileOpenPickerPage for triggering
+ commands.
+ -->
+ <Style x:Key="TextButtonStyle" TargetType="ButtonBase">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="MinHeight" Value="0"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ButtonBase">
+ <Grid Background="Transparent">
+ <ContentPresenter x:Name="Text" Content="{TemplateBinding Content}" />
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused"/>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="CheckStates">
+ <VisualState x:Name="Checked"/>
+ <VisualState x:Name="Unchecked">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Indeterminate"/>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="TextPrimaryButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource TextButtonStyle}">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationHeaderForegroundThemeBrush}"/>
+ </Style>
+
+ <Style x:Key="TextSecondaryButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource TextButtonStyle}">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
+ </Style>
+
+ <!--
+ TextRadioButtonStyle is used to style a RadioButton using subheader-styled text with no other adornment.
+ This style is used in the SearchResultsPage to allow selection among filters.
+ -->
+ <Style x:Key="TextRadioButtonStyle" TargetType="RadioButton" BasedOn="{StaticResource TextButtonStyle}">
+ <Setter Property="Margin" Value="0,0,30,0"/>
+ </Style>
+
+ <!--
+ AppBarButtonStyle is used to style a Button (or ToggleButton) for use in an App Bar. Content will be centered
+ and should fit within the 40 pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text
+ to simplify the use of glyphs from that font. AutomationProperties.Name is used for the text below the glyph.
+ -->
+ <Style x:Key="AppBarButtonStyle" TargetType="ButtonBase">
+ <Setter Property="Foreground" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ <Setter Property="VerticalAlignment" Value="Stretch"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="20"/>
+ <Setter Property="AutomationProperties.ItemType" Value="App Bar Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ButtonBase">
+ <Grid x:Name="RootGrid" Width="100" Background="Transparent">
+ <StackPanel VerticalAlignment="Top" Margin="0,12,0,11">
+ <Grid Width="40" Height="40" Margin="0,0,0,5" HorizontalAlignment="Center">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0A8;" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0" Foreground="{StaticResource AppBarItemBackgroundThemeBrush}"/>
+ <TextBlock x:Name="OutlineGlyph" Text="&#xE0A7;" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0"/>
+ <ContentPresenter x:Name="Content" HorizontalAlignment="Center" Margin="-1,-1,0,0" VerticalAlignment="Center"/>
+ </Grid>
+ <TextBlock
+ x:Name="TextLabel"
+ Text="{TemplateBinding AutomationProperties.Name}"
+ Foreground="{StaticResource AppBarItemForegroundThemeBrush}"
+ Margin="0,0,2,0"
+ FontSize="12"
+ TextAlignment="Center"
+ Width="88"
+ MaxHeight="32"
+ TextTrimming="WordEllipsis"
+ Style="{StaticResource BasicTextStyle}"/>
+ </StackPanel>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="ApplicationViewStates">
+ <VisualState x:Name="FullScreenLandscape"/>
+ <VisualState x:Name="Filled"/>
+ <VisualState x:Name="FullScreenPortrait">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Snapped">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="CheckStates">
+ <VisualState x:Name="Checked">
+ <Storyboard>
+ <DoubleAnimation Duration="0" To="0" Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Opacity"/>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundCheckedGlyph" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unchecked"/>
+ <VisualState x:Name="Indeterminate"/>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!--
+ Standard AppBarButton Styles for use with Button and ToggleButton
+
+ An AppBarButton Style is provided for each of the glyphs in the Segoe UI Symbol font.
+ Uncomment any style you reference (as not all may be required).
+ -->
+ <Style x:Key="HelpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HelpAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Help"/>
+ <Setter Property="Content" Value="&#xE11B;"/>
+ </Style>
+ <Style x:Key="SearchAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SearchAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Search"/>
+ <Setter Property="Content" Value="&#xE11A;"/>
+ </Style>
+ <Style x:Key="OpenFileAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OpenFileAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Open File"/>
+ <Setter Property="Content" Value="&#xE1A5;"/>
+ </Style>
+ <Style x:Key="NextAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NextAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Next"/>
+ <Setter Property="Content" Value="&#xE111;"/>
+ </Style>
+ <Style x:Key="PreviousAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PreviousAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Previous"/>
+ <Setter Property="Content" Value="&#xE112;"/>
+ </Style>
+ <Style x:Key="NoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="No"/>
+ <Setter Property="Content" Value="&#xE10A;"/>
+ </Style>
+ <Style x:Key="SettingsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SettingsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Settings"/>
+ <Setter Property="Content" Value="&#xE115;"/>
+ </Style>
+ <Style x:Key="LinksAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LinksAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Links"/>
+ <Setter Property="Content" Value="&#xE167;"/>
+ </Style>
+ <Style x:Key="ContentsBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AllAppsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Contents"/>
+ <Setter Property="Content" Value="&#xE179;"/>
+ </Style>
+ <Style x:Key="ReflowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ReflowAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Reflow"/>
+ <Setter Property="Content" Value="&#xE18B;"/>
+ </Style>
+
+ <!--
+
+ <Style x:Key="SkipBackAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SkipBackAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Skip Back"/>
+ <Setter Property="Content" Value="&#xE100;"/>
+ </Style>
+ <Style x:Key="SkipAheadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SkipAheadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Skip Ahead"/>
+ <Setter Property="Content" Value="&#xE101;"/>
+ </Style>
+ <Style x:Key="PlayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PlayAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Play"/>
+ <Setter Property="Content" Value="&#xE102;"/>
+ </Style>
+ <Style x:Key="PauseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PauseAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Pause"/>
+ <Setter Property="Content" Value="&#xE103;"/>
+ </Style>
+ <Style x:Key="EditAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="EditAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Edit"/>
+ <Setter Property="Content" Value="&#xE104;"/>
+ </Style>
+ <Style x:Key="SaveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SaveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Save"/>
+ <Setter Property="Content" Value="&#xE105;"/>
+ </Style>
+ <Style x:Key="DeleteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DeleteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Delete"/>
+ <Setter Property="Content" Value="&#xE106;"/>
+ </Style>
+ <Style x:Key="DiscardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DiscardAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Discard"/>
+ <Setter Property="Content" Value="&#xE107;"/>
+ </Style>
+ <Style x:Key="RemoveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RemoveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Remove"/>
+ <Setter Property="Content" Value="&#xE108;"/>
+ </Style>
+ <Style x:Key="AddAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AddAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Add"/>
+ <Setter Property="Content" Value="&#xE109;"/>
+ </Style>
+ <Style x:Key="NoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="No"/>
+ <Setter Property="Content" Value="&#xE10A;"/>
+ </Style>
+ <Style x:Key="YesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="YesAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Yes"/>
+ <Setter Property="Content" Value="&#xE10B;"/>
+ </Style>
+ <Style x:Key="MoreAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MoreAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="More"/>
+ <Setter Property="Content" Value="&#xE10C;"/>
+ </Style>
+ <Style x:Key="RedoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RedoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Redo"/>
+ <Setter Property="Content" Value="&#xE10D;"/>
+ </Style>
+ <Style x:Key="UndoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UndoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Undo"/>
+ <Setter Property="Content" Value="&#xE10E;"/>
+ </Style>
+ <Style x:Key="HomeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HomeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Home"/>
+ <Setter Property="Content" Value="&#xE10F;"/>
+ </Style>
+ <Style x:Key="OutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OutAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Out"/>
+ <Setter Property="Content" Value="&#xE110;"/>
+ </Style>
+ <Style x:Key="NextAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NextAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Next"/>
+ <Setter Property="Content" Value="&#xE111;"/>
+ </Style>
+ <Style x:Key="PreviousAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PreviousAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Previous"/>
+ <Setter Property="Content" Value="&#xE112;"/>
+ </Style>
+ <Style x:Key="FavoriteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FavoriteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Favorite"/>
+ <Setter Property="Content" Value="&#xE113;"/>
+ </Style>
+ <Style x:Key="PhotoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PhotoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Photo"/>
+ <Setter Property="Content" Value="&#xE114;"/>
+ </Style>
+ <Style x:Key="SettingsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SettingsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Settings"/>
+ <Setter Property="Content" Value="&#xE115;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="VideoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="VideoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Video"/>
+ <Setter Property="Content" Value="&#xE116;"/>
+ </Style>
+ <Style x:Key="RefreshAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RefreshAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Refresh"/>
+ <Setter Property="Content" Value="&#xE117;"/>
+ </Style>
+ <Style x:Key="DownloadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DownloadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Download"/>
+ <Setter Property="Content" Value="&#xE118;"/>
+ </Style>
+ <Style x:Key="MailAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MailAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Mail"/>
+ <Setter Property="Content" Value="&#xE119;"/>
+ </Style>
+ <Style x:Key="SearchAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SearchAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Search"/>
+ <Setter Property="Content" Value="&#xE11A;"/>
+ </Style>
+ <Style x:Key="HelpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HelpAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Help"/>
+ <Setter Property="Content" Value="&#xE11B;"/>
+ </Style>
+ <Style x:Key="UploadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UploadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Upload"/>
+ <Setter Property="Content" Value="&#xE11C;"/>
+ </Style>
+ <Style x:Key="EmojiAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="EmojiAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Emoji"/>
+ <Setter Property="Content" Value="&#xE11D;"/>
+ </Style>
+ <Style x:Key="TwoPageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TwoPageAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Two Page"/>
+ <Setter Property="Content" Value="&#xE11E;"/>
+ </Style>
+ <Style x:Key="LeaveChatAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LeaveChatAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Upload"/>
+ <Setter Property="Content" Value="&#xE11F;"/>
+ </Style>
+ <Style x:Key="MailForwardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MailForwardAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Forward Mail"/>
+ <Setter Property="Content" Value="&#xE120;"/>
+ </Style>
+ <Style x:Key="ClockAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ClockAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Clock"/>
+ <Setter Property="Content" Value="&#xE121;"/>
+ </Style>
+ <Style x:Key="SendAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SendAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Send"/>
+ <Setter Property="Content" Value="&#xE122;"/>
+ </Style>
+ <Style x:Key="CropAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CropAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Crop"/>
+ <Setter Property="Content" Value="&#xE123;"/>
+ </Style>
+ <Style x:Key="RotateCameraAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RotateCameraAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Rotate Camera"/>
+ <Setter Property="Content" Value="&#xE124;"/>
+ </Style>
+ <Style x:Key="PeopleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PeopleAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="People"/>
+ <Setter Property="Content" Value="&#xE125;"/>
+ </Style>
+ <Style x:Key="ClosePaneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ClosePaneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Close Pane"/>
+ <Setter Property="Content" Value="&#xE126;"/>
+ </Style>
+ <Style x:Key="OpenPaneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OpenPaneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Open Pane"/>
+ <Setter Property="Content" Value="&#xE127;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="WorldAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="WorldAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="World"/>
+ <Setter Property="Content" Value="&#xE128;"/>
+ </Style>
+ <Style x:Key="FlagAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FlagAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Flag"/>
+ <Setter Property="Content" Value="&#xE129;"/>
+ </Style>
+ <Style x:Key="PreviewLinkAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PreviewLinkAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Preview Link"/>
+ <Setter Property="Content" Value="&#xE12A;"/>
+ </Style>
+ <Style x:Key="GlobeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="GlobeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Globe"/>
+ <Setter Property="Content" Value="&#xE12B;"/>
+ </Style>
+ <Style x:Key="TrimAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TrimAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Trim"/>
+ <Setter Property="Content" Value="&#xE12C;"/>
+ </Style>
+ <Style x:Key="AttachCameraAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AttachCameraAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Attach Camera"/>
+ <Setter Property="Content" Value="&#xE12D;"/>
+ </Style>
+ <Style x:Key="ZoomInAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ZoomInAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Zoom In"/>
+ <Setter Property="Content" Value="&#xE12E;"/>
+ </Style>
+ <Style x:Key="BookmarksAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="BookmarksAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Bookmarks"/>
+ <Setter Property="Content" Value="&#xE12F;"/>
+ </Style>
+ <Style x:Key="DocumentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DocumentAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Document"/>
+ <Setter Property="Content" Value="&#xE130;"/>
+ </Style>
+ <Style x:Key="ProtectedDocumentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ProtectedDocumentAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Protected Document"/>
+ <Setter Property="Content" Value="&#xE131;"/>
+ </Style>
+ <Style x:Key="PageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PageAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Page"/>
+ <Setter Property="Content" Value="&#xE132;"/>
+ </Style>
+ <Style x:Key="BulletsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="BulletsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Bullets"/>
+ <Setter Property="Content" Value="&#xE133;"/>
+ </Style>
+ <Style x:Key="CommentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CommentAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Comment"/>
+ <Setter Property="Content" Value="&#xE134;"/>
+ </Style>
+ <Style x:Key="Mail2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="Mail2AppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Mail2"/>
+ <Setter Property="Content" Value="&#xE135;"/>
+ </Style>
+ <Style x:Key="ContactInfoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ContactInfoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Contact Info"/>
+ <Setter Property="Content" Value="&#xE136;"/>
+ </Style>
+ <Style x:Key="HangUpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HangUpAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Hang Up"/>
+ <Setter Property="Content" Value="&#xE137;"/>
+ </Style>
+ <Style x:Key="ViewAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ViewAllAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="View All"/>
+ <Setter Property="Content" Value="&#xE138;"/>
+ </Style>
+ <Style x:Key="MapPinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MapPinAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Map Pin"/>
+ <Setter Property="Content" Value="&#xE139;"/>
+ </Style>
+ <Style x:Key="PhoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PhoneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Phone"/>
+ <Setter Property="Content" Value="&#xE13A;"/>
+ </Style>
+ <Style x:Key="VideoChatAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="VideoChatAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Video Chat"/>
+ <Setter Property="Content" Value="&#xE13B;"/>
+ </Style>
+ <Style x:Key="SwitchAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SwitchAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Switch"/>
+ <Setter Property="Content" Value="&#xE13C;"/>
+ </Style>
+ <Style x:Key="ContactAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ContactAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Contact"/>
+ <Setter Property="Content" Value="&#xE13D;"/>
+ </Style>
+
+ -->
+
+ <!--
+
+ <Style x:Key="RenameAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RenameAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Rename"/>
+ <Setter Property="Content" Value="&#xE13E;"/>
+ </Style>
+ <Style x:Key="PinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PinAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Pin"/>
+ <Setter Property="Content" Value="&#xE141;"/>
+ </Style>
+ <Style x:Key="MusicInfoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MusicInfoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Music Info"/>
+ <Setter Property="Content" Value="&#xE142;"/>
+ </Style>
+ <Style x:Key="GoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="GoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Go"/>
+ <Setter Property="Content" Value="&#xE143;"/>
+ </Style>
+ <Style x:Key="KeyboardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="KeyboardAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Keyboard"/>
+ <Setter Property="Content" Value="&#xE144;"/>
+ </Style>
+ <Style x:Key="DockLeftAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DockLeftAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Dock Left"/>
+ <Setter Property="Content" Value="&#xE145;"/>
+ </Style>
+ <Style x:Key="DockRightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DockRightAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Dock Right"/>
+ <Setter Property="Content" Value="&#xE146;"/>
+ </Style>
+ <Style x:Key="DockBottomAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DockBottomAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Dock Bottom"/>
+ <Setter Property="Content" Value="&#xE147;"/>
+ </Style>
+ <Style x:Key="RemoteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RemoteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Remote"/>
+ <Setter Property="Content" Value="&#xE148;"/>
+ </Style>
+ <Style x:Key="SyncAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SyncAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Sync"/>
+ <Setter Property="Content" Value="&#xE149;"/>
+ </Style>
+ <Style x:Key="RotateAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RotateAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Rotate"/>
+ <Setter Property="Content" Value="&#xE14A;"/>
+ </Style>
+ <Style x:Key="ShuffleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ShuffleAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Shuffle"/>
+ <Setter Property="Content" Value="&#xE14B;"/>
+ </Style>
+ <Style x:Key="ListAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ListAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="List"/>
+ <Setter Property="Content" Value="&#xE14C;"/>
+ </Style>
+ <Style x:Key="ShopAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ShopAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Shop"/>
+ <Setter Property="Content" Value="&#xE14D;"/>
+ </Style>
+ <Style x:Key="SelectAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SelectAllAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Select All"/>
+ <Setter Property="Content" Value="&#xE14E;"/>
+ </Style>
+ <Style x:Key="OrientationAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OrientationAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Orientation"/>
+ <Setter Property="Content" Value="&#xE14F;"/>
+ </Style>
+ <Style x:Key="ImportAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ImportAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Import"/>
+ <Setter Property="Content" Value="&#xE150;"/>
+ </Style>
+ <Style x:Key="ImportAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ImportAllAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Import All"/>
+ <Setter Property="Content" Value="&#xE151;"/>
+ </Style>
+ <Style x:Key="BrowsePhotosAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="BrowsePhotosAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Browse Photos"/>
+ <Setter Property="Content" Value="&#xE155;"/>
+ </Style>
+ <Style x:Key="WebcamAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="WebcamAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Webcam"/>
+ <Setter Property="Content" Value="&#xE156;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="PicturesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PicturesAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Pictures"/>
+ <Setter Property="Content" Value="&#xE158;"/>
+ </Style>
+ <Style x:Key="SaveLocalAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SaveLocalAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Save Local"/>
+ <Setter Property="Content" Value="&#xE159;"/>
+ </Style>
+ <Style x:Key="CaptionAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CaptionAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Caption"/>
+ <Setter Property="Content" Value="&#xE15A;"/>
+ </Style>
+ <Style x:Key="StopAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="StopAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Stop"/>
+ <Setter Property="Content" Value="&#xE15B;"/>
+ </Style>
+ <Style x:Key="ShowResultsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ShowResultsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Show Results"/>
+ <Setter Property="Content" Value="&#xE15C;"/>
+ </Style>
+ <Style x:Key="VolumeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="VolumeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Volume"/>
+ <Setter Property="Content" Value="&#xE15D;"/>
+ </Style>
+ <Style x:Key="RepairAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RepairAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Repair"/>
+ <Setter Property="Content" Value="&#xE15E;"/>
+ </Style>
+ <Style x:Key="MessageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MessageAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Message"/>
+ <Setter Property="Content" Value="&#xE15F;"/>
+ </Style>
+ <Style x:Key="Page2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="Page2AppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Page2"/>
+ <Setter Property="Content" Value="&#xE160;"/>
+ </Style>
+ <Style x:Key="CalendarDayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CalendarDayAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Day"/>
+ <Setter Property="Content" Value="&#xE161;"/>
+ </Style>
+ <Style x:Key="CalendarWeekAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CalendarWeekAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Week"/>
+ <Setter Property="Content" Value="&#xE162;"/>
+ </Style>
+ <Style x:Key="CalendarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CalendarAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Calendar"/>
+ <Setter Property="Content" Value="&#xE163;"/>
+ </Style>
+ <Style x:Key="CharactersAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CharactersAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Characters"/>
+ <Setter Property="Content" Value="&#xE164;"/>
+ </Style>
+ <Style x:Key="MailReplyAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MailReplyAllAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Reply All"/>
+ <Setter Property="Content" Value="&#xE165;"/>
+ </Style>
+ <Style x:Key="ReadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ReadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Read"/>
+ <Setter Property="Content" Value="&#xE166;"/>
+ </Style>
+ <Style x:Key="LinkAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LinkAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Link"/>
+ <Setter Property="Content" Value="&#xE167;"/>
+ </Style>
+ <Style x:Key="AccountsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AccountsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Accounts"/>
+ <Setter Property="Content" Value="&#xE168;"/>
+ </Style>
+ <Style x:Key="ShowBccAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ShowBccAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Show Bcc"/>
+ <Setter Property="Content" Value="&#xE169;"/>
+ </Style>
+ <Style x:Key="HideBccAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HideBccAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Hide Bcc"/>
+ <Setter Property="Content" Value="&#xE16A;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="CutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CutAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Cut"/>
+ <Setter Property="Content" Value="&#xE16B;"/>
+ </Style>
+ <Style x:Key="AttachAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AttachAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Attach"/>
+ <Setter Property="Content" Value="&#xE16C;"/>
+ </Style>
+ <Style x:Key="PasteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PasteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Paste"/>
+ <Setter Property="Content" Value="&#xE16D;"/>
+ </Style>
+ <Style x:Key="FilterAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FilterAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Filter"/>
+ <Setter Property="Content" Value="&#xE16E;"/>
+ </Style>
+ <Style x:Key="CopyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CopyAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Copy"/>
+ <Setter Property="Content" Value="&#xE16F;"/>
+ </Style>
+ <Style x:Key="Emoji2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="Emoji2AppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Emoji2"/>
+ <Setter Property="Content" Value="&#xE170;"/>
+ </Style>
+ <Style x:Key="ImportantAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ImportantAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Important"/>
+ <Setter Property="Content" Value="&#xE171;"/>
+ </Style>
+ <Style x:Key="MailReplyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MailReplyAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Reply"/>
+ <Setter Property="Content" Value="&#xE172;"/>
+ </Style>
+ <Style x:Key="SlideShowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SlideShowAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Slideshow"/>
+ <Setter Property="Content" Value="&#xE173;"/>
+ </Style>
+ <Style x:Key="SortAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SortAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Sort"/>
+ <Setter Property="Content" Value="&#xE174;"/>
+ </Style>
+ <Style x:Key="ManageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ManageAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Manage"/>
+ <Setter Property="Content" Value="&#xE178;"/>
+ </Style>
+ <Style x:Key="AllAppsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AllAppsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="All Apps"/>
+ <Setter Property="Content" Value="&#xE179;"/>
+ </Style>
+ <Style x:Key="DisconnectDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DisconnectDriveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Disconnect Drive"/>
+ <Setter Property="Content" Value="&#xE17A;"/>
+ </Style>
+ <Style x:Key="MapDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MapDriveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Map Drive"/>
+ <Setter Property="Content" Value="&#xE17B;"/>
+ </Style>
+ <Style x:Key="NewWindowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NewWindowAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="New Window"/>
+ <Setter Property="Content" Value="&#xE17C;"/>
+ </Style>
+ <Style x:Key="OpenWithAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OpenWithAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Open With"/>
+ <Setter Property="Content" Value="&#xE17D;"/>
+ </Style>
+ <Style x:Key="ContactPresenceAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ContactPresenceAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Presence"/>
+ <Setter Property="Content" Value="&#xE181;"/>
+ </Style>
+ <Style x:Key="PriorityAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PriorityAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Priority"/>
+ <Setter Property="Content" Value="&#xE182;"/>
+ </Style>
+ <Style x:Key="UploadSkyDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UploadSkyDriveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Skydrive"/>
+ <Setter Property="Content" Value="&#xE183;"/>
+ </Style>
+ <Style x:Key="GoToTodayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="GoToTodayAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Today"/>
+ <Setter Property="Content" Value="&#xE184;"/>
+ </Style>
+ <Style x:Key="FontAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FontAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Font"/>
+ <Setter Property="Content" Value="&#xE185;"/>
+ </Style>
+
+ -->
+
+ <!--
+
+ <Style x:Key="FontColorAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FontColorAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Font Color"/>
+ <Setter Property="Content" Value="&#xE186;"/>
+ </Style>
+ <Style x:Key="Contact2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="Contact2AppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Contact"/>
+ <Setter Property="Content" Value="&#xE187;"/>
+ </Style>
+ <Style x:Key="FolderppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FolderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Folder"/>
+ <Setter Property="Content" Value="&#xE188;"/>
+ </Style>
+ <Style x:Key="AudioAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AudioAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Audio"/>
+ <Setter Property="Content" Value="&#xE189;"/>
+ </Style>
+ <Style x:Key="PlaceholderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PlaceholderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Placeholder"/>
+ <Setter Property="Content" Value="&#xE18A;"/>
+ </Style>
+ <Style x:Key="ViewAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ViewAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="View"/>
+ <Setter Property="Content" Value="&#xE18B;"/>
+ </Style>
+ <Style x:Key="SetLockScreenAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SetLockscreenAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Set Lockscreen"/>
+ <Setter Property="Content" Value="&#xE18C;"/>
+ </Style>
+ <Style x:Key="SetTitleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SetTitleAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Set Title"/>
+ <Setter Property="Content" Value="&#xE18D;"/>
+ </Style>
+ <Style x:Key="CcAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CcAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Cc"/>
+ <Setter Property="Content" Value="&#xE190;"/>
+ </Style>
+ <Style x:Key="StopSlideShowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="StopSlideshowAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Stop Slideshow"/>
+ <Setter Property="Content" Value="&#xE191;"/>
+ </Style>
+ <Style x:Key="PermissionsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PermissionsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Permisions"/>
+ <Setter Property="Content" Value="&#xE192;"/>
+ </Style>
+ <Style x:Key="HighlightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HighlightAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Highlight"/>
+ <Setter Property="Content" Value="&#xE193;"/>
+ </Style>
+ <Style x:Key="DisableUpdatesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DisableUpdatesAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Disable Updates"/>
+ <Setter Property="Content" Value="&#xE194;"/>
+ </Style>
+ <Style x:Key="UnfavoriteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UnfavoriteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Unfavorite"/>
+ <Setter Property="Content" Value="&#xE195;"/>
+ </Style>
+ <Style x:Key="UnPinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UnPinAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Unpin"/>
+ <Setter Property="Content" Value="&#xE196;"/>
+ </Style>
+ <Style x:Key="OpenLocalAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OpenLocalAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Open Loal"/>
+ <Setter Property="Content" Value="&#xE197;"/>
+ </Style>
+ <Style x:Key="MuteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MuteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Mute"/>
+ <Setter Property="Content" Value="&#xE198;"/>
+ </Style>
+ <Style x:Key="ItalicAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ItalicAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Italic"/>
+ <Setter Property="Content" Value="&#xE199;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="UnderlineAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UnderlineAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Underline"/>
+ <Setter Property="Content" Value="&#xE19A;"/>
+ </Style>
+ <Style x:Key="BoldAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="BoldAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Bold"/>
+ <Setter Property="Content" Value="&#xE19B;"/>
+ </Style>
+ <Style x:Key="MoveToFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MoveToFolderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Move to Folder"/>
+ <Setter Property="Content" Value="&#xE19C;"/>
+ </Style>
+ <Style x:Key="LikeDislikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LikeDislikeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Like/Dislike"/>
+ <Setter Property="Content" Value="&#xE19D;"/>
+ </Style>
+ <Style x:Key="DislikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DislikeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Dislike"/>
+ <Setter Property="Content" Value="&#xE19E;"/>
+ </Style>
+ <Style x:Key="LikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LikeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Like"/>
+ <Setter Property="Content" Value="&#xE19F;"/>
+ </Style>
+ <Style x:Key="AlignRightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AlignRightAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Align Right"/>
+ <Setter Property="Content" Value="&#xE1A0;"/>
+ </Style>
+ <Style x:Key="AlignCenterAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AlignCenterAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Align Center"/>
+ <Setter Property="Content" Value="&#xE1A1;"/>
+ </Style>
+ <Style x:Key="AlignLeftAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AlignLeftAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Align Left"/>
+ <Setter Property="Content" Value="&#xE1A2;"/>
+ </Style>
+ <Style x:Key="ZoomAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ZoomAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Zoom"/>
+ <Setter Property="Content" Value="&#xE1A3;"/>
+ </Style>
+ <Style x:Key="ZoomOutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ZoomOutAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Zoom Out"/>
+ <Setter Property="Content" Value="&#xE1A4;"/>
+ </Style>
+ <Style x:Key="OpenFileAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OpenFileAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Open File"/>
+ <Setter Property="Content" Value="&#xE1A5;"/>
+ </Style>
+ <Style x:Key="OtherUserAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OtherUserAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Other User"/>
+ <Setter Property="Content" Value="&#xE1A6;"/>
+ </Style>
+ <Style x:Key="AdminAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AdminAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Admin"/>
+ <Setter Property="Content" Value="&#xE1A7;"/>
+ </Style>
+ <Style x:Key="StreetAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="StreetAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Street"/>
+ <Setter Property="Content" Value="&#xE1C3;"/>
+ </Style>
+ <Style x:Key="MapAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MapAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Map"/>
+ <Setter Property="Content" Value="&#xE1C4;"/>
+ </Style>
+ <Style x:Key="ClearSelectionAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ClearSelectionAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Clear Selection"/>
+ <Setter Property="Content" Value="&#xE1C5;"/>
+ </Style>
+ <Style x:Key="FontDecreaseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FontDecreaseAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Decrease Font"/>
+ <Setter Property="Content" Value="&#xE1C6;"/>
+ </Style>
+ <Style x:Key="FontIncreaseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FontIncreaseAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Increase Font"/>
+ <Setter Property="Content" Value="&#xE1C7;"/>
+ </Style>
+ <Style x:Key="FontSizeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FontSizeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Font Size"/>
+ <Setter Property="Content" Value="&#xE1C8;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="CellphoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CellphoneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Cellphone"/>
+ <Setter Property="Content" Value="&#xE1C9;"/>
+ </Style>
+ <Style x:Key="ReshareAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ReshareAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Reshare"/>
+ <Setter Property="Content" Value="&#xE1CA;"/>
+ </Style>
+ <Style x:Key="TagAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TagAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Tag"/>
+ <Setter Property="Content" Value="&#xE1CB;"/>
+ </Style>
+ <Style x:Key="RepeatOneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RepeatOneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Repeat Once"/>
+ <Setter Property="Content" Value="&#xE1CC;"/>
+ </Style>
+ <Style x:Key="RepeatAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RepeatAllAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Repeat All"/>
+ <Setter Property="Content" Value="&#xE1CD;"/>
+ </Style>
+ <Style x:Key="OutlineStarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OutlineStarAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Outline Star"/>
+ <Setter Property="Content" Value="&#xE1CE;"/>
+ </Style>
+ <Style x:Key="SolidStarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SolidStarAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Solid Star"/>
+ <Setter Property="Content" Value="&#xE1CF;"/>
+ </Style>
+ <Style x:Key="CalculatorAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CalculatorAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Calculator"/>
+ <Setter Property="Content" Value="&#xE1D0;"/>
+ </Style>
+ <Style x:Key="DirectionsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DirectionsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Directions"/>
+ <Setter Property="Content" Value="&#xE1D1;"/>
+ </Style>
+ <Style x:Key="TargetAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TargetAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Target"/>
+ <Setter Property="Content" Value="&#xE1D2;"/>
+ </Style>
+ <Style x:Key="LibraryAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="LibraryAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Library"/>
+ <Setter Property="Content" Value="&#xE1D3;"/>
+ </Style>
+ <Style x:Key="PhonebookAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PhonebookAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Phonebook"/>
+ <Setter Property="Content" Value="&#xE1D4;"/>
+ </Style>
+ <Style x:Key="MemoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MemoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Memo"/>
+ <Setter Property="Content" Value="&#xE1D5;"/>
+ </Style>
+ <Style x:Key="MicrophoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MicrophoneAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Microphone"/>
+ <Setter Property="Content" Value="&#xE1D6;"/>
+ </Style>
+ <Style x:Key="PostUpdateAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PostUpdateAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Post Update"/>
+ <Setter Property="Content" Value="&#xE1D7;"/>
+ </Style>
+ <Style x:Key="BackToWindowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="BackToWindowAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Back to Window"/>
+ <Setter Property="Content" Value="&#xE1D8;"/>
+ </Style>
+ -->
+
+ <!--
+ <Style x:Key="FullScreenAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FullScreenAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Full Screen"/>
+ <Setter Property="Content" Value="&#xE1D9;"/>
+ </Style>
+ <Style x:Key="NewFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NewFolderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="New Folder"/>
+ <Setter Property="Content" Value="&#xE1DA;"/>
+ </Style>
+ <Style x:Key="CalendarReplyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="CalendarReplyAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Calendar Reply"/>
+ <Setter Property="Content" Value="&#xE1DB;"/>
+ </Style>
+ <Style x:Key="UnsyncFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UnsyncFolderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Unsync Folder"/>
+ <Setter Property="Content" Value="&#xE1DD;"/>
+ </Style>
+ <Style x:Key="ReportHackedAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ReportHackedAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Report Hacked"/>
+ <Setter Property="Content" Value="&#xE1DE;"/>
+ </Style>
+ <Style x:Key="SyncFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SyncFolderAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Sync Folder"/>
+ <Setter Property="Content" Value="&#xE1DF;"/>
+ </Style>
+ <Style x:Key="BlockContactAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="Block ContactAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="BlockContact"/>
+ <Setter Property="Content" Value="&#xE1E0;"/>
+ </Style>
+ <Style x:Key="SwitchAppsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SwitchAppsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Switch Apps"/>
+ <Setter Property="Content" Value="&#xE1E1;"/>
+ </Style>
+ <Style x:Key="AddFriendAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AddFriendAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Add Friend"/>
+ <Setter Property="Content" Value="&#xE1E2;"/>
+ </Style>
+ <Style x:Key="TouchPointerAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TouchPointerAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Touch Pointer"/>
+ <Setter Property="Content" Value="&#xE1E3;"/>
+ </Style>
+ <Style x:Key="GoToStartAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="GoToStartAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Go to Start"/>
+ <Setter Property="Content" Value="&#xE1E4;"/>
+ </Style>
+ <Style x:Key="ZeroBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ZeroBarsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Zero Bars"/>
+ <Setter Property="Content" Value="&#xE1E5;"/>
+ </Style>
+ <Style x:Key="OneBarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OneBarAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="One Bar"/>
+ <Setter Property="Content" Value="&#xE1E6;"/>
+ </Style>
+ <Style x:Key="TwoBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="TwoBarsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Two Bars"/>
+ <Setter Property="Content" Value="&#xE1E7;"/>
+ </Style>
+ <Style x:Key="ThreeBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="ThreeBarsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Three Bars"/>
+ <Setter Property="Content" Value="&#xE1E8;"/>
+ </Style>
+ <Style x:Key="FourBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FourBarsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Four Bars"/>
+ <Setter Property="Content" Value="&#xE1E9;"/>
+ </Style>
+
+ -->
+
+ <!-- Title area styles -->
+
+ <Style x:Key="PageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource HeaderTextStyle}">
+ <Setter Property="TextWrapping" Value="NoWrap"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="Margin" Value="0,0,30,40"/>
+ </Style>
+
+ <Style x:Key="PageSubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource SubheaderTextStyle}">
+ <Setter Property="TextWrapping" Value="NoWrap"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="Margin" Value="0,0,0,40"/>
+ </Style>
+
+ <Style x:Key="SnappedPageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource PageSubheaderTextStyle}">
+ <Setter Property="Margin" Value="0,0,18,40"/>
+ </Style>
+
+ <!--
+ BackButtonStyle is used to style a Button for use in the title area of a page. Margins appropriate for
+ the conventional page layout are included as part of the style.
+ -->
+ <Style x:Key="BackButtonStyle" TargetType="Button">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="Width" Value="48"/>
+ <Setter Property="Height" Value="48"/>
+ <Setter Property="Margin" Value="36,0,36,36"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="56"/>
+ <Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Back"/>
+ <Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="RootGrid">
+ <Grid Margin="-1,-16,0,0">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0A8;" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
+ <TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
+ <TextBlock x:Name="ArrowGlyph" Text="&#xE0A6;" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
+ </Grid>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimation
+ Storyboard.TargetName="ArrowGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="NormalGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!--
+ PortraitBackButtonStyle is used to style a Button for use in the title area of a portrait page. Margins appropriate
+ for the conventional page layout are included as part of the style.
+ -->
+ <Style x:Key="PortraitBackButtonStyle" TargetType="Button" BasedOn="{StaticResource BackButtonStyle}">
+ <Setter Property="Margin" Value="26,0,26,36"/>
+ </Style>
+
+ <!--
+ SnappedBackButtonStyle is used to style a Button for use in the title area of a snapped page. Margins appropriate
+ for the conventional page layout are included as part of the style.
+
+ The obvious duplication here is necessary as the glyphs used in snapped are not merely smaller versions of the same
+ glyph but are actually distinct.
+ -->
+ <Style x:Key="SnappedBackButtonStyle" TargetType="Button">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="Margin" Value="20,0,0,0"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="26.66667"/>
+ <Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Back"/>
+ <Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="RootGrid" Width="36" Height="36" Margin="-3,0,7,33">
+ <Grid Margin="-1,-1,0,0">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0D4;" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
+ <TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonSnappedGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
+ <TextBlock x:Name="ArrowGlyph" Text="&#xE0C4;" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
+ </Grid>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimation
+ Storyboard.TargetName="ArrowGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="NormalGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!-- Item templates -->
+
+ <!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage -->
+ <DataTemplate x:Key="Standard250x250ItemTemplate">
+ <Grid HorizontalAlignment="Left" Width="250" Height="250">
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
+ <Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
+ </Border>
+ <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
+ <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/>
+ <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- Grid-appropriate 500 by 130 pixel item template as seen in the GroupDetailPage -->
+ <DataTemplate x:Key="Standard500x130ItemTemplate">
+ <Grid Height="110" Width="480" Margin="10">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
+ <Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
+ </Border>
+ <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- List-appropriate 130 pixel high item template as seen in the SplitPage -->
+ <DataTemplate x:Key="Standard130ItemTemplate">
+ <Grid Height="110" Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
+ <Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
+ </Border>
+ <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!--
+ List-appropriate 80 pixel high item template as seen in the SplitPage when Filled, and
+ the following pages when snapped: GroupedItemsPage, GroupDetailPage, and ItemsPage
+ -->
+ <DataTemplate x:Key="Standard80ItemTemplate">
+ <Grid Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="60" Height="60">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- Grid-appropriate 300 by 70 pixel item template as seen in the SearchResultsPage -->
+ <DataTemplate x:Key="StandardSmallIcon300x70ItemTemplate">
+ <Grid Width="294" Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,-10,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- List-appropriate 70 pixel high item template as seen in the SearchResultsPage when Snapped -->
+ <DataTemplate x:Key="StandardSmallIcon70ItemTemplate">
+ <Grid Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,-10,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!--
+ 190x130 pixel item template for displaying file previews as seen in the FileOpenPickerPage
+ Includes an elaborate tooltip to display title and description text
+ -->
+ <DataTemplate x:Key="StandardFileWithTooltip190x130ItemTemplate">
+ <Grid>
+ <Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
+ <Image
+ Source="{Binding Image}"
+ Width="190"
+ Height="130"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Stretch="Uniform"/>
+ </Grid>
+ <ToolTipService.Placement>Mouse</ToolTipService.Placement>
+ <ToolTipService.ToolTip>
+ <ToolTip>
+ <ToolTip.Style>
+ <Style TargetType="ToolTip">
+ <Setter Property="BorderBrush" Value="{StaticResource ToolTipBackgroundThemeBrush}" />
+ <Setter Property="Padding" Value="0" />
+ </Style>
+ </ToolTip.Style>
+
+ <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+
+ <Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="20">
+ <Image
+ Source="{Binding Image}"
+ Width="160"
+ Height="160"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Stretch="Uniform"/>
+ </Grid>
+ <StackPanel Width="200" Grid.Column="1" Margin="0,20,20,20">
+ <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource BodyTextStyle}"/>
+ <TextBlock Text="{Binding Description}" MaxHeight="140" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" Style="{StaticResource BodyTextStyle}"/>
+ </StackPanel>
+ </Grid>
+ </ToolTip>
+ </ToolTipService.ToolTip>
+ </Grid>
+ </DataTemplate>
+
+ <!-- ScrollViewer styles -->
+
+ <Style x:Key="HorizontalScrollViewerStyle" TargetType="ScrollViewer">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
+ <Setter Property="VerticalScrollBarVisibility" Value="Disabled"/>
+ <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
+ <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
+ <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
+ </Style>
+
+ <Style x:Key="VerticalScrollViewerStyle" TargetType="ScrollViewer">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
+ <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
+ <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
+ <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
+ <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
+ </Style>
+
+ <!-- Page layout roots typically use entrance animations and a theme-appropriate background color -->
+
+ <Style x:Key="LayoutRootStyle" TargetType="Panel">
+ <Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}"/>
+ <Setter Property="ChildrenTransitions">
+ <Setter.Value>
+ <TransitionCollection>
+ <EntranceThemeTransition/>
+ </TransitionCollection>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
diff --git a/winrt/mupdf_cpp/DocumentPage.cpp b/winrt/mupdf_cpp/DocumentPage.cpp
new file mode 100644
index 00000000..c705c237
--- /dev/null
+++ b/winrt/mupdf_cpp/DocumentPage.cpp
@@ -0,0 +1,14 @@
+#include "pch.h"
+#include "DocumentPage.h"
+
+namespace mupdf_cpp
+{
+ DocumentPage::DocumentPage(void)
+ {
+ this->Image = nullptr;
+ this->Height = 0;
+ this->Width = 0;
+ this->Zoom = 1.0;
+ this->Content = NOTSET;
+ }
+}
diff --git a/winrt/mupdf_cpp/DocumentPage.h b/winrt/mupdf_cpp/DocumentPage.h
new file mode 100644
index 00000000..98bbeb0e
--- /dev/null
+++ b/winrt/mupdf_cpp/DocumentPage.h
@@ -0,0 +1,97 @@
+#pragma once
+
+#include "RectList.h"
+#include <collection.h>
+
+
+/* Used for binding to the xaml in the scroll view. */
+using namespace Windows::UI::Xaml::Media::Imaging;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::Foundation::Collections;
+
+typedef enum {
+ FULL_RESOLUTION = 0,
+ THUMBNAIL,
+ DUMMY,
+ NOTSET
+} Page_Content_t;
+
+
+namespace mupdf_cpp
+{
+ [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
+
+ public ref class DocumentPage sealed
+ {
+ private:
+ int height;
+ int width;
+ double zoom;
+ WriteableBitmap^ image;
+ Page_Content_t content;
+
+ public:
+ DocumentPage(void);
+
+ property int Content
+ {
+ int get() { return ((int) content); }
+ void set(int value)
+ {
+ if (value > NOTSET)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ content = (Page_Content_t) value;
+ }
+ }
+
+ property int Height
+ {
+ int get() { return height; }
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ height = value;
+ }
+ }
+
+ property int Width
+ {
+ int get() { return width; }
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ width = value;
+ }
+ }
+
+ property double Zoom
+ {
+ double get() { return zoom; }
+ void set(double value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ zoom = value;
+ }
+ }
+
+ property WriteableBitmap^ Image
+ {
+ WriteableBitmap^ get() { return image; }
+ void set(WriteableBitmap^ value)
+ {
+ image = value;
+ }
+ }
+ };
+}
diff --git a/winrt/mupdf_cpp/LVContents.cpp b/winrt/mupdf_cpp/LVContents.cpp
new file mode 100644
index 00000000..1905c10c
--- /dev/null
+++ b/winrt/mupdf_cpp/LVContents.cpp
@@ -0,0 +1,9 @@
+#include "pch.h"
+#include "LVContents.h"
+
+using namespace ListViewContents;
+LVContents::LVContents(void)
+{
+ ContentItem = "";
+ Page = -1;
+}
diff --git a/winrt/mupdf_cpp/LVContents.h b/winrt/mupdf_cpp/LVContents.h
new file mode 100644
index 00000000..1ca4179c
--- /dev/null
+++ b/winrt/mupdf_cpp/LVContents.h
@@ -0,0 +1,12 @@
+#pragma once
+namespace ListViewContents {
+ [Windows::UI::Xaml::Data::Bindable]
+ public ref class LVContents sealed
+ {
+ public:
+ LVContents(void);
+ property Platform::String^ ContentItem;
+ property int Page;
+
+ };
+}
diff --git a/winrt/mupdf_cpp/MainPage.xaml b/winrt/mupdf_cpp/MainPage.xaml
new file mode 100644
index 00000000..99ae0f3b
--- /dev/null
+++ b/winrt/mupdf_cpp/MainPage.xaml
@@ -0,0 +1,149 @@
+<Page
+ x:Class="mupdf_cpp.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:winapp"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d">
+
+ <Page.BottomAppBar>
+ <AppBar>
+ <Grid Margin="38,0,0,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <Slider x:Name="xaml_PageSlider" Minimum="0" Maximum="10" ValueChanged="Slider_ValueChanged" LostFocus="Slider_Released" Grid.Column="0" Margin="10,0" VerticalAlignment="Center" />
+ <Button x:Name="Find_File" Style="{StaticResource OpenFileAppBarButtonStyle}" Tag="OpenFile" HorizontalAlignment="Right" Grid.Column="1" Click="Picker"/>
+ </Grid>
+ </AppBar>
+ </Page.BottomAppBar>
+ <Page.TopAppBar>
+ <AppBar x:Name="TopAppBar1" AutomationProperties.Name="Top App Bar" Loaded="topAppBar_Loaded">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <StackPanel x:Name="LeftPanel" Orientation="Horizontal">
+ </StackPanel>
+ <StackPanel x:Name="RightPanel" Orientation="Horizontal" HorizontalAlignment="Right">
+ <Button x:Name="Search" Style="{StaticResource SearchAppBarButtonStyle}" Tag="Search" Click="Searcher"/>
+ <Button x:Name="Contents" Style="{StaticResource ContentsBarButtonStyle}" Tag="Contents" Click="ContentDisplay"/>
+ <Button x:Name="Links" Style="{StaticResource LinksAppBarButtonStyle}" Tag="Links" Click="Linker"/>
+ <Button x:Name="Reflow" Style="{StaticResource ReflowAppBarButtonStyle}" Tag="Reflow" Click="Reflower"/>
+ <Button x:Name="Help" Style="{StaticResource HelpAppBarButtonStyle}" Tag="Help"/>
+ </StackPanel>
+ </Grid>
+ </AppBar>
+ </Page.TopAppBar>
+
+ <Grid x:Name="xaml_OutsideGrid">
+ <Grid.Background>
+ <LinearGradientBrush EndPoint="-0.074,-0.068" StartPoint="1.027,1.024">
+ <GradientStop Color="Black"/>
+ <GradientStop Color="White"/>
+ <GradientStop Color="White" Offset="0.919"/>
+ <GradientStop Color="#FFCDCDCD" Offset="0.741"/>
+ <GradientStop Color="#FF909090" Offset="0.524"/>
+ <GradientStop Color="#FF737373" Offset="0.421"/>
+ <GradientStop Color="#FF2A2A2A" Offset="0.155"/>
+ <GradientStop Color="#FF1A1A1A" Offset="0.097"/>
+ <GradientStop Color="#FF040404" Offset="0.018"/>
+ <GradientStop Color="#FFB3B3B3" Offset="0.651"/>
+ <GradientStop Color="#FF989898" Offset="0.556"/>
+ <GradientStop Color="#FF666666" Offset="0.375"/>
+ <GradientStop Color="#FF4B4B4B" Offset="0.278"/>
+ <GradientStop Color="#FF3A3A3A" Offset="0.215"/>
+ </LinearGradientBrush>
+ </Grid.Background>
+
+ <ProgressBar x:Name="xaml_Progress" IsIndeterminate="False" Maximum="100" Value="0" Height="10" Width="400" IsEnabled="False" Opacity="0"/>
+
+ <Grid x:Name="xaml_MainGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SizeChanged="GridSizeChanged">
+ <Canvas x:Name="xaml_zoomCanvas" HorizontalAlignment="Center" VerticalAlignment="Center" ManipulationMode="All" >
+ <FlipView x:Name="xaml_horiz_flipView" SelectionChanged="FlipView_SelectionChanged" VerticalAlignment="Center"
+ HorizontalAlignment="Center">
+ <FlipView.ItemsPanel>
+ <ItemsPanelTemplate>
+ <VirtualizingStackPanel Orientation="Horizontal"/>
+ </ItemsPanelTemplate>
+ </FlipView.ItemsPanel>
+
+ <FlipView.ItemTemplate>
+ <DataTemplate>
+ <ScrollViewer
+ ZoomMode="Enabled"
+ ViewChanged="ScrollChanged"
+ HorizontalScrollMode="Auto"
+ VerticalScrollMode="Auto"
+ VerticalSnapPointsType="None"
+ HorizontalSnapPointsType="None"
+ HorizontalScrollBarVisibility="Auto"
+ VerticalScrollBarVisibility="Auto"
+ MinZoomFactor="1"
+ MaxZoomFactor="4">
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ Stretch="Uniform" HorizontalAlignment="Center" Margin="0"/>
+ </ScrollViewer>
+ </DataTemplate>
+ </FlipView.ItemTemplate>
+ </FlipView>
+
+ <FlipView x:Name="xaml_vert_flipView" SelectionChanged="FlipView_SelectionChanged" VerticalAlignment="Center"
+ HorizontalAlignment="Center" IsEnabled="False" Opacity="0">
+ <FlipView.ItemsPanel>
+ <ItemsPanelTemplate>
+ <VirtualizingStackPanel Orientation="Vertical"/>
+ </ItemsPanelTemplate>
+ </FlipView.ItemsPanel>
+ <DataTemplate>
+ <ScrollViewer
+ ZoomMode="Enabled"
+ ViewChanged="ScrollChanged"
+ HorizontalScrollMode="Auto"
+ VerticalScrollMode="Auto"
+ VerticalSnapPointsType="None"
+ HorizontalSnapPointsType="None"
+ HorizontalScrollBarVisibility="Auto"
+ VerticalScrollBarVisibility="Auto"
+ MinZoomFactor="1"
+ MaxZoomFactor="4">
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ Stretch="Uniform" HorizontalAlignment="Center" Margin="0"/>
+ </ScrollViewer>
+ </DataTemplate>
+ </FlipView>
+
+ </Canvas>
+ <ListView x:Name="xaml_ListView" Foreground="Black" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" Opacity="0" IsItemClickEnabled="True"
+ ItemClick="ContentSelected" SelectionMode="Single" IsEnabled="False">
+
+ <ListView.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Margin="5,5,0,0" HorizontalAlignment="Left">
+ <TextBlock TextWrapping="Wrap" Text="{Binding ContentItem}" FontFamily="Segoe UI" FontSize="20" />
+ </StackPanel>
+ </DataTemplate>
+ </ListView.ItemTemplate>
+
+ <ListView.Background>
+ <SolidColorBrush Color="LightGray"></SolidColorBrush>
+ </ListView.Background>
+ </ListView>
+ </Grid>
+ <StackPanel x:Name="xaml_RichGrid" Orientation="Vertical" Margin="5,5,5,50"
+ Width="Auto" Height="Auto" Visibility="Collapsed">
+ <TextBlock HorizontalAlignment="Center" Text="FontSize:" FontSize="18" Margin="0, 10, 0, -10"/>
+ <Slider x:Name="fontSizeSlider" Width="200" Value="20" Minimum="8" Maximum="40"
+ TickFrequency="4" Orientation="Horizontal" HorizontalAlignment="Center" />
+ <RichEditBox x:Name="xaml_RichText" FontSize="{Binding Value, ElementName=fontSizeSlider}"
+ Visibility="Collapsed" HorizontalAlignment="Center"
+ VerticalAlignment="Top">
+ </RichEditBox>
+ </StackPanel>
+ </Grid>
+</Page>
+
diff --git a/winrt/mupdf_cpp/MainPage.xaml.cpp b/winrt/mupdf_cpp/MainPage.xaml.cpp
new file mode 100644
index 00000000..2af4a552
--- /dev/null
+++ b/winrt/mupdf_cpp/MainPage.xaml.cpp
@@ -0,0 +1,1565 @@
+//
+// MainPage.xaml.cpp
+// Implementation of the MainPage class.
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+#include "LVContents.h"
+
+#define LOOK_AHEAD 1 /* A +/- count on the pages to pre-render */
+#define MIN_SCALE 0.5
+#define MAX_SCALE 4
+#define MARGIN_BUFF 400
+#define MAX_SEARCH 500
+#define SCALE_THUMB 0.1
+
+#define BLANK_WIDTH 17
+#define BLANK_HEIGHT 22
+
+static float screenScale = 1;
+
+int linkPage[MAX_SEARCH];
+char *linkUrl[MAX_SEARCH];
+
+using namespace mupdf_cpp;
+
+using namespace Windows::Foundation;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+using namespace Windows::UI::Xaml::Data;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Navigation;
+using namespace Windows::Graphics::Display;
+using namespace ListViewContents;
+
+//****************** Added *****************
+using namespace Windows::Storage::Pickers;
+using namespace Windows::Devices::Enumeration;
+using namespace concurrency;
+using namespace Windows::Graphics::Imaging;
+//****************** End Add ****************
+
+#ifndef NDEBUG
+unsigned int _mainThreadId = 0U;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // The IsMainThread function returns true if the current thread is the app's main thread and false otherwise.
+ bool IsMainThread()
+ {
+ return (_mainThreadId == GetCurrentThreadId());
+ }
+
+ // The IsBackgroundThread function returns false if the current thread is the app's main thread and true otherwise.
+ bool IsBackgroundThread()
+ {
+ return (_mainThreadId != GetCurrentThreadId());
+ }
+
+ // The RecordMainThread function registers the main thread ID for use by the IsMainThread and IsBackgroundThread functions.
+ void RecordMainThread()
+ {
+ _mainThreadId = GetCurrentThreadId();
+ }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not NDEBUG */
+
+MainPage::MainPage()
+{
+ InitializeComponent();
+
+ Windows::UI::Color color;
+ color.R = 0x00;
+ color.G = 0x00;
+ color.B = 0xFF;
+ color.A = 0x40;
+ m_textcolor_brush = ref new SolidColorBrush(color);
+
+ color.R = 0xAC;
+ color.G = 0x72;
+ color.B = 0x25;
+ color.A = 0x40;
+ m_linkcolor_brush = ref new SolidColorBrush(color);
+
+ // Create the image brush
+ m_renderedImage = ref new ImageBrush();
+ m_content.num = 0;
+ mu_doc = nullptr;
+ m_docPages = ref new Platform::Collections::Vector<DocumentPage^>();
+ CleanUp();
+ RecordMainThread();
+ mu_doc = ref new mudocument();
+ if (mu_doc == nullptr)
+ throw ref new FailureException("Document allocation failed!");
+}
+
+/// <summary>
+/// Invoked when this page is about to be displayed in a Frame.
+/// </summary>
+/// <param name="e">Event data that describes how this page was reached. The Parameter
+/// property is typically used to configure the page.</param>
+void MainPage::OnNavigatedTo(NavigationEventArgs^ e)
+{
+ (void) e; // Unused parameter
+}
+
+void mupdf_cpp::MainPage::ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command)
+{
+
+}
+
+void mupdf_cpp::MainPage::OKInvokedHandler(Windows::UI::Popups::IUICommand^ command)
+{
+
+}
+
+void mupdf_cpp::MainPage::NotifyUser(String^ strMessage, NotifyType_t type)
+{
+ MessageDialog^ msg = ref new MessageDialog(strMessage);
+ UICommand^ ExitCommand = nullptr;
+ UICommand^ OKCommand = nullptr;
+
+ switch (type)
+ {
+ case StatusMessage:
+ OKCommand = ref new UICommand("OK",
+ ref new UICommandInvokedHandler(this, &mupdf_cpp::MainPage::OKInvokedHandler));
+ msg->Commands->Append(OKCommand);
+ /// Set the command that will be invoked by default
+ msg->DefaultCommandIndex = 0;
+ // Set the command to be invoked when escape is pressed
+ msg->CancelCommandIndex = 1;
+ break;
+ case ErrorMessage:
+ ExitCommand = ref new UICommand("Exit",
+ ref new UICommandInvokedHandler(this, &mupdf_cpp::MainPage::ExitInvokedHandler));
+ msg->Commands->Append(ExitCommand);
+ /// Set the command that will be invoked by default
+ msg->DefaultCommandIndex = 0;
+ // Set the command to be invoked when escape is pressed
+ msg->CancelCommandIndex = 1;
+ break;
+ default:
+ break;
+ }
+ // Show the message dialog
+ msg->ShowAsync();
+}
+
+bool mupdf_cpp::MainPage::EnsureUnsnapped()
+{
+ // FilePicker APIs will not work if the application is in a snapped state.
+ // If an app wants to show a FilePicker while snapped, it must attempt to unsnap first
+
+ bool unsnapped = (ApplicationView::Value != ApplicationViewState::Snapped ||
+ ApplicationView::TryUnsnap());
+ if (!unsnapped)
+ {
+ NotifyUser("Cannot unsnap the application", StatusMessage);
+ }
+ return unsnapped;
+}
+
+void mupdf_cpp::MainPage::Picker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ if (!EnsureUnsnapped())
+ return;
+
+ FileOpenPicker^ openPicker = ref new FileOpenPicker();
+ openPicker->ViewMode = PickerViewMode::List;
+ openPicker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
+ openPicker->FileTypeFilter->Append(".pdf");
+ openPicker->FileTypeFilter->Append(".xps");
+ openPicker->FileTypeFilter->Append(".oxps");
+
+ create_task(openPicker->PickSingleFileAsync()).then([this](StorageFile^ file)
+ {
+ if (file)
+ {
+ this->OpenDocumentPrep(file);
+ }
+ else
+ {
+ /* Nothing selected */
+ }
+ });
+}
+
+/* Set the page with the new raster information */
+void MainPage::UpdatePage(int page_num, InMemoryRandomAccessStream^ ras,
+ Point ras_size, Page_Content_t content_type)
+{
+ assert(IsMainThread());
+
+ WriteableBitmap ^bmp = ref new WriteableBitmap(ras_size.X, ras_size.Y);
+ bmp->SetSource(ras);
+
+ DocumentPage^ doc_page = ref new DocumentPage();
+ doc_page->Image = bmp;
+
+ if (content_type == THUMBNAIL)
+ {
+ doc_page->Height = ras_size.Y / SCALE_THUMB;
+ doc_page->Width = ras_size.X / SCALE_THUMB;
+ }
+ else
+ {
+ doc_page->Height = ras_size.Y;
+ doc_page->Width = ras_size.X;
+ }
+ doc_page->Content = content_type;
+
+ /* We do not want flipview change notification to occur for ourselves */
+ m_page_update = true;
+ this->m_docPages->SetAt(page_num, doc_page);
+ m_page_update = false;
+
+}
+
+Point MainPage::ComputePageSize(spatial_info_t spatial_info, int page_num)
+{
+ Point screenSize;
+ Point pageSize;
+ Point size = mu_doc->GetPageSize(page_num);
+
+ screenSize = spatial_info.size;
+ screenSize.Y *= screenScale;
+ screenSize.X *= screenScale;
+
+ float hscale = screenSize.X / size.X;
+ float vscale = screenSize.Y / size.Y;
+ float scale = min(hscale, vscale);
+ pageSize.X = size.X * scale * spatial_info.scale_factor;
+ pageSize.Y = size.Y * scale * spatial_info.scale_factor;
+
+ return pageSize;
+}
+
+Point MainPage::currPageSize(int page)
+{
+ Point Size;
+
+ FlipViewItem ^flipview_temp = (FlipViewItem^) m_curr_flipView->Items->GetAt(page);
+
+ Size.Y = flipview_temp->ActualHeight;
+ Size.X = flipview_temp->ActualWidth;
+ return Size;
+}
+
+static Point fitPageToScreen(Point page, Point screen)
+{
+ Point pageSize;
+
+ float hscale = screen.X / page.X;
+ float vscale = screen.Y / page.Y;
+ float scale = fz_min(hscale, vscale);
+ pageSize.X = floorf(page.X * scale) / page.X;
+ pageSize.Y = floorf(page.Y * scale) / page.Y;
+ return pageSize;
+}
+
+spatial_info_t MainPage::InitSpatial(double scale)
+{
+ spatial_info_t value;
+
+ value.size.Y = this->ActualHeight;
+ value.size.X = this->ActualWidth;
+ value.scale_factor = scale;
+ return value;
+}
+
+void Prepare_bmp(int width, int height, DataWriter ^dw)
+{
+ int row_size = width * 4;
+ int bmp_size = row_size * height + 54;
+
+ dw->WriteString("BM");
+ dw->ByteOrder = ByteOrder::LittleEndian;
+ dw->WriteInt32(bmp_size);
+ dw->WriteInt16(0);
+ dw->WriteInt16(0);
+ dw->WriteInt32(54);
+ dw->WriteInt32(40);
+ dw->WriteInt32(width);
+ dw->WriteInt32(height);
+ dw->WriteInt16(1);
+ dw->WriteInt16(32);
+ dw->WriteInt32(0);
+ dw->WriteInt32(row_size * height);
+ dw->WriteInt32(2835);
+ dw->WriteInt32(2835);
+ dw->WriteInt32(0);
+ dw->WriteInt32(0);
+}
+
+void MainPage::ReleasePages(int old_page, int new_page)
+{
+ if (old_page == new_page) return;
+ /* To keep from having memory issue reset the page back to
+ the thumb if we are done rendering the thumbnails */
+ for (int k = old_page - LOOK_AHEAD; k <= old_page + LOOK_AHEAD; k++)
+ {
+ if (k < new_page - LOOK_AHEAD || k > new_page + LOOK_AHEAD)
+ {
+ if (k >= 0 && k < this->m_num_pages)
+ {
+ SetThumb(k, true);
+ }
+ }
+ }
+}
+
+void MainPage::InitThumbnails()
+{
+ this->m_thumbnails.raster = ref new Array<InMemoryRandomAccessStream^>(m_num_pages);
+ this->m_thumbnails.scale = ref new Array<double>(m_num_pages);
+ this->m_thumbnails.size = ref new Array<Point>(m_num_pages);
+}
+
+/* Return this page from a full res image to the thumb image or only set to thumb
+ if it has not already been set */
+void MainPage::SetThumb(int page_num, bool replace)
+{
+ /* See what is there now */
+ auto doc = this->m_docPages->GetAt(page_num);
+ if (doc->Content == THUMBNAIL) return;
+
+ if ((replace || doc->Content == DUMMY) && this->m_thumbnails.raster[page_num] != nullptr)
+ UpdatePage(page_num, this->m_thumbnails.raster[page_num],
+ this->m_thumbnails.size[page_num], THUMBNAIL);
+}
+
+/* Create white image for us to use as place holder in large document for flip
+ view filling instead of the thumbnail image */
+void MainPage::CreateBlank(int width, int height)
+{
+ Array<unsigned char>^ bmp_data = ref new Array<unsigned char>(height * 4 * width);
+ /* Set up the memory stream */
+ WriteableBitmap ^bmp = ref new WriteableBitmap(width, height);
+ InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+ DataWriter ^dw = ref new DataWriter(ras->GetOutputStreamAt(0));
+ /* Go ahead and write our header data into the memory stream */
+ Prepare_bmp(width, height, dw);
+
+ /* Set the data to all white */
+ memset(bmp_data->Data, 255, height * 4 * width);
+
+ /* Write the data */
+ dw->WriteBytes(bmp_data);
+
+ DataWriterStoreOperation^ result = dw->StoreAsync();
+ /* Block on the Async call */
+ while(result->Status != AsyncStatus::Completed) {
+ }
+ /* And store in a the image brush */
+ bmp->SetSource(ras);
+ m_BlankBmp = bmp;
+}
+
+void mupdf_cpp::MainPage::SetFlipView()
+{
+ int height = this->ActualHeight;
+ int width = this->ActualWidth;
+
+ CreateBlank(BLANK_WIDTH, BLANK_HEIGHT);
+ /* Set the current flip view mode */
+ if (height > width)
+ this->m_curr_flipView = xaml_vert_flipView;
+ else
+ this->m_curr_flipView = xaml_horiz_flipView;
+}
+
+/* Clean up everything as we are opening a new document after having another
+ one open */
+void mupdf_cpp::MainPage::CleanUp()
+{
+ /* Remove current pages in the flipviews */
+ if (xaml_vert_flipView->Items->Size)
+ xaml_vert_flipView->Items->Clear();
+
+ if (xaml_horiz_flipView->Items->Size)
+ xaml_horiz_flipView->Items->Clear();
+
+ this->m_curr_flipView = nullptr;
+ m_currpage = -1;
+ m_file_open = false;
+ m_slider_min = 0;
+ m_slider_max = 0;
+ m_init_done = false;
+ m_memory_use = 0;
+ m_from_doubleflip = false;
+ m_first_time = false;
+ m_insearch = false;
+ m_search_active = false;
+ m_sliderchange = false;
+ m_flip_from_searchlink = false;
+ m_num_pages = -1;
+ m_search_rect_count = 0;
+ ResetSearch();
+ m_ren_status = REN_AVAILABLE;
+ m_thumb_page_start = 0;
+ m_thumb_page_stop = 0;
+ m_links_on = false;
+
+ if (m_content.num)
+ {
+ //m_content.page->;
+ // m_content.string_margin->Dispose();
+ //m_content.string_orig->Dispose();
+ m_content.num = 0;
+ }
+
+ m_curr_zoom = 1.0;
+ m_canvas_translate.X = 0;
+ m_canvas_translate.Y = 0;
+
+ this->xaml_PageSlider->Minimum = m_slider_min;
+ this->xaml_PageSlider->Maximum = m_slider_max;
+ this->xaml_PageSlider->IsEnabled = false;
+}
+
+/* Create the thumbnail images */
+void mupdf_cpp::MainPage::RenderThumbs()
+{
+ spatial_info_t spatial_info = this->InitSpatial(1);
+ int num_pages = this->m_num_pages;
+ int thumb_pages = this->m_thumb_page_start;
+ cancellation_token_source cts;
+ auto token = cts.get_token();
+ m_ThumbCancel = cts;
+
+ this->m_ren_status = REN_THUMBS;
+ thumbs_t thumbnails = m_thumbnails;
+ DWORD thread0_id = GetCurrentThreadId();
+
+ create_task([spatial_info, num_pages, thumb_pages, thumbnails, this, thread0_id]()-> int
+ {
+ spatial_info_t spatial_info_local = spatial_info;
+ spatial_info_local.scale_factor = SCALE_THUMB;
+
+ InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+
+ for (int k = thumb_pages; k < num_pages; k++)
+ {
+ Point ras_size = ComputePageSize(spatial_info_local, k);
+ bool done = false;
+ DWORD thread1_id = GetCurrentThreadId();
+ auto task = create_task(mu_doc->RenderPage(k, ras_size.X, ras_size.Y)).then([this, k, ras_size, thumbnails, &done, thread1_id, thread0_id] (InMemoryRandomAccessStream^ ras)
+ {
+ DWORD thread2_id = GetCurrentThreadId();
+ thumbnails.raster[k] = ras;
+ thumbnails.scale[k] = SCALE_THUMB;
+ thumbnails.size[k] = ras_size;
+ done = true;
+ }, task_continuation_context::use_current());
+
+
+ try
+ {
+ task.get(); // get exception
+ }
+ catch (Exception^ exception)
+ {
+ }
+
+ /* Don't start new thumb until this one is finished, lest we launch a
+ thousand thumbnail renderings */
+ while (!done)
+ {
+ }
+
+ /* If cancelled then save the last one as the continuation will not
+ have occured. */
+ if (is_task_cancellation_requested())
+ {
+ thumbnails.raster[k] = ras;
+ thumbnails.scale[k] = SCALE_THUMB;
+ thumbnails.size[k] = ras_size;
+ this->m_thumb_page_stop = k + 1;
+
+ cancel_current_task();
+ }
+ }
+ return num_pages; /* all done with thumbnails! */
+ }, token).then([this](task<int> the_task)
+ {
+ int new_end;
+ try
+ {
+ new_end = the_task.get();
+ }
+ catch (const task_canceled& e)
+ {
+ new_end = this->m_thumb_page_stop;
+ }
+
+ int old_end = this->m_thumb_page_start;
+
+ /* Now go ahead and create the proper stuctures */
+ this->m_ren_status = REN_UPDATE_THUMB_CANVAS;
+ this->m_thumb_page_start = new_end;
+
+ for (int k = old_end; k < new_end; k++)
+ {
+ assert(IsMainThread());
+ SetThumb(k, false);
+ }
+ this->m_ren_status = REN_AVAILABLE;
+ }, task_continuation_context::use_current());
+}
+
+void mupdf_cpp::MainPage::OpenDocumentPrep(StorageFile^ file)
+{
+ if (this->m_num_pages != -1)
+ {
+ m_init_done = false;
+ /* If the thumbnail thread is running then we need to end that first */
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ /* Create a task to wait until the renderer is available, then clean up then open */
+ auto t = create_task([ren_status, ThumbCancel]()->int
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ return 0;
+ }).then([this](task<int> the_task)
+ {
+ CleanUp();
+ return 0;
+ }, task_continuation_context::use_current()).then([this, file](task<int> the_task)
+ {
+ OpenDocument(file);
+ }, task_continuation_context::use_current());
+ }
+ else
+ {
+ OpenDocument(file);
+ }
+}
+
+void mupdf_cpp::MainPage::OpenDocument(StorageFile^ file)
+{
+ String^ path = file->Path;
+ const wchar_t *w = path->Data();
+ int cb = WideCharToMultiByte(CP_UTF8, 0, w, -1, nullptr, 0, nullptr, nullptr);
+ char* name = new char[cb];
+
+ WideCharToMultiByte(CP_UTF8, 0, w ,-1 ,name ,cb ,nullptr, nullptr);
+ char *ext = strrchr(name, '.');
+
+ this->SetFlipView();
+
+ /* Open document and when open, push on */
+ auto open_task = create_task(mu_doc->OpenFile(file));
+
+ open_task.then([this]
+ {
+ assert(IsMainThread());
+
+ m_num_pages = mu_doc->GetNumPages();
+ if ((m_currpage) >= m_num_pages)
+ {
+ m_currpage = m_num_pages - 1;
+ }
+ else if (m_currpage < 0)
+ {
+ m_currpage = 0;
+ }
+
+ /* Initialize all the flipvew items with blanks */
+ for (int k = 0; k < m_num_pages; k++)
+ {
+ DocumentPage^ doc_page = ref new DocumentPage();
+ doc_page->Image = this->m_BlankBmp;
+ doc_page->Height = BLANK_HEIGHT;
+ doc_page->Width = BLANK_WIDTH;
+ doc_page->Content = DUMMY;
+ this->m_docPages->Append(doc_page);
+ }
+
+ this->xaml_horiz_flipView->ItemsSource = m_docPages;
+ this->xaml_vert_flipView->ItemsSource = m_docPages;
+
+ /* Do the first few pages, then start the thumbs */
+ spatial_info_t spatial_info = InitSpatial(1);
+
+ for (int k = 0; k < LOOK_AHEAD + 2; k++)
+ {
+ if (m_num_pages > k )
+ {
+ Point ras_size = ComputePageSize(spatial_info, k);
+
+ auto render_task =
+ create_task(mu_doc->RenderPage(k, ras_size.X, ras_size.Y));
+
+ render_task.then([this, k, ras_size] (InMemoryRandomAccessStream^ ras)
+ {
+ /* Set up the image brush when rendering is completed, must be on
+ UI thread */
+ UpdatePage(k, ras, ras_size, FULL_RESOLUTION);
+ }, task_continuation_context::use_current());
+ }
+ }
+
+ /* Update the slider settings, if more than one page */
+ if (m_num_pages > 1)
+ {
+ this->xaml_PageSlider->Maximum = m_num_pages;
+ this->xaml_PageSlider->Minimum = 1;
+ this->xaml_PageSlider->IsEnabled = true;
+ }
+ else
+ {
+ this->xaml_PageSlider->Maximum = 0;
+ this->xaml_PageSlider->Minimum = 0;
+ this->xaml_PageSlider->IsEnabled = false;
+ }
+ /* All done with initial pages */
+ this->m_init_done = true;
+ }).then([this]
+ {
+ InitThumbnails();
+ this->RenderThumbs();
+ }, task_continuation_context::use_current());
+}
+
+task<int> mupdf_cpp::MainPage::RenderRange(int curr_page)
+{
+ /* Render +/- the look ahead from where we are if blank page is present */
+ spatial_info_t spatial_info = InitSpatial(1);
+
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ /* Create a task to wait until the renderer is available */
+ auto t = create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ });
+
+ return t.then([this, curr_page, spatial_info]()
+ {
+ assert(IsMainThread());
+ int val = 0;
+ /* This runs on the main ui thread */
+ for (int k = curr_page - LOOK_AHEAD; k <= curr_page + LOOK_AHEAD; k++)
+ {
+ if (k >= 0 && k < m_num_pages)
+ {
+ /* Check if page is already rendered */
+ auto doc = this->m_docPages->GetAt(k);
+ if (doc->Content != FULL_RESOLUTION)
+ {
+ Point ras_size = ComputePageSize(spatial_info, k);
+ auto render_task =
+ create_task(mu_doc->RenderPage(k, ras_size.X, ras_size.Y));
+
+ render_task.then([this, k, ras_size] (InMemoryRandomAccessStream^ ras)
+ {
+ /* Set up the image brush when rendering is completed, must be on
+ UI thread */
+ UpdatePage(k, ras, ras_size, FULL_RESOLUTION);
+ this->m_ren_status = REN_AVAILABLE;
+ }, task_continuation_context::use_current());
+ }
+ }
+ }
+ Canvas^ link_canvas = (Canvas^) (this->FindName("linkCanvas"));
+ if (link_canvas != nullptr)
+ {
+ Canvas^ Parent_Canvas = (Canvas^) link_canvas->Parent;
+ if (Parent_Canvas != nullptr)
+ {
+ Parent_Canvas->Children->RemoveAtEnd();
+ delete link_canvas;
+ }
+ }
+ m_currpage = curr_page;
+ if (this->m_links_on)
+ {
+ AddLinkCanvas();
+ }
+ /* Check if thumb rendering is done. If not then restart */
+ if (this->m_num_pages != this->m_thumb_page_start)
+ this->RenderThumbs();
+ return val;
+ }, task_continuation_context::use_current());
+}
+
+void mupdf_cpp::MainPage::Slider_Released(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e)
+{
+ /* Check if thumb rendering is done. If not then restart */
+ if (this->m_num_pages != this->m_thumb_page_start)
+ this->RenderThumbs();
+}
+
+void mupdf_cpp::MainPage::Slider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e)
+{
+ int newValue = (int) this->xaml_PageSlider->Value - 1; /* zero based */
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ if (m_update_flip)
+ {
+ m_update_flip = false;
+ return;
+ }
+ if (m_init_done && this->xaml_PageSlider->IsEnabled)
+ {
+ auto doc = this->m_docPages->GetAt(newValue);
+ if (doc->Content != FULL_RESOLUTION)
+ {
+ create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ }).then([this, newValue]()
+ {
+ spatial_info_t spatial_info = InitSpatial(1);
+ Point ras_size = ComputePageSize(spatial_info, newValue);
+ auto render_task =
+ create_task(mu_doc->RenderPage(newValue, ras_size.X, ras_size.Y));
+
+ render_task.then([this, newValue, ras_size] (InMemoryRandomAccessStream^ ras)
+ {
+ UpdatePage(newValue, ras, ras_size, FULL_RESOLUTION);
+ this->m_ren_status = REN_AVAILABLE;
+ this->m_currpage = newValue;
+ m_sliderchange = true;
+ this->m_curr_flipView->SelectedIndex = newValue;
+ ResetSearch();
+ }, task_continuation_context::use_current());
+ }, task_continuation_context::use_current());
+ }
+ }
+}
+
+void mupdf_cpp::MainPage::FlipView_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
+{
+ if (m_init_done && !m_page_update)
+ {
+ int pos = this->m_curr_flipView->SelectedIndex;
+
+ m_update_flip = true;
+ if (xaml_PageSlider->IsEnabled)
+ {
+ xaml_PageSlider->Value = pos;
+ }
+ if (pos >= 0)
+ {
+ if (m_flip_from_searchlink)
+ {
+ m_flip_from_searchlink = false;
+ return;
+ }
+ else if (m_sliderchange)
+ {
+ m_sliderchange = false;
+ return;
+ }
+ else
+ {
+ ResetSearch();
+ }
+ /* Get the current page */
+ int curr_page = this->m_currpage;
+ task<int> task = this->RenderRange(pos);
+ task.then([this, curr_page, pos](int val)
+ {
+ this->ReleasePages(curr_page, pos);
+ }, task_continuation_context::use_current());
+ }
+ }
+}
+
+/* Search Related Code */
+
+void mupdf_cpp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ /* Update the app bar so that we can do the search */
+ StackPanel^ leftPanel = (StackPanel^) this->TopAppBar->FindName("LeftPanel");
+
+ if (leftPanel != nullptr && m_insearch)
+ {
+ m_insearch = false;
+ leftPanel->Children->RemoveAtEnd();
+ leftPanel->Children->RemoveAtEnd();
+ leftPanel->Children->RemoveAtEnd();
+ }
+ else if (leftPanel != nullptr && !m_insearch)
+ {
+ /* Search is not going to work in snapped view for now to simplify UI
+ in this cramped case. So see if we can get out of snapped mode. */
+
+ if (!EnsureUnsnapped())
+ return;
+
+ m_insearch = true;
+ Windows::UI::Xaml::Controls::Button^ PrevButton = ref new Button();
+ PrevButton->Style = safe_cast<Windows::UI::Xaml::Style^>(App::Current->Resources->Lookup("PreviousAppBarButtonStyle"));
+ PrevButton->Click += ref new RoutedEventHandler(this, &mupdf_cpp::MainPage::SearchPrev);
+
+ Windows::UI::Xaml::Controls::Button^ NextButton = ref new Button();
+ NextButton->Style = safe_cast<Windows::UI::Xaml::Style^>(App::Current->Resources->Lookup("NextAppBarButtonStyle"));
+ NextButton->Click += ref new RoutedEventHandler(this, &mupdf_cpp::MainPage::SearchNext);
+
+ Windows::UI::Xaml::Controls::TextBox^ SearchBox = ref new TextBox();
+ SearchBox->Name = "findBox";
+ SearchBox->Width = 200;
+ SearchBox->Height = 20;
+
+ leftPanel->Children->Append(SearchBox);
+ leftPanel->Children->Append(PrevButton);
+ leftPanel->Children->Append(NextButton);
+ }
+}
+
+void mupdf_cpp::MainPage::ShowSearchResults(SearchResult_t result)
+{
+ int height, width;
+ int old_page = this->m_currpage;
+ int new_page = result.page_num;
+ spatial_info_t spatial_info = InitSpatial(1);
+ return;
+
+ /* This will be fixed and turned on when I determine how best to show the
+ canvas and bind to the xmal content */
+#if 0
+ this->m_ren_status = REN_PAGE;
+ task<Canvas^> the_task = RenderPage_Task(m_doc, new_page, &width, &height,
+ spatial_info, &m_renderedImage);
+ the_task.then([this, old_page, new_page](task<Canvas^> the_task)
+ {
+ assert(IsMainThread());
+
+ try
+ {
+ this->m_renderedCanvas = the_task.get();
+ }
+ catch (const task_canceled& e)
+ {
+ this->m_renderedCanvas = nullptr;
+ }
+ ReplacePage(new_page);
+ this->m_ren_status = REN_AVAILABLE;
+ this->ReleasePages(old_page, new_page);
+ }, task_continuation_context::use_current()).then([this, result]()
+
+ {
+ /* Once the rendering is done launch this task to show the result */
+ Point screenSize;
+ Point pageSize;
+ Point scale;
+
+ if (this->m_links_on)
+ {
+ fz_drop_link(ctx, this->m_links);
+ AddLinkCanvas();
+ }
+ fz_page *page = fz_load_page(m_doc, result.page_num);
+ FlipViewItem ^flipview_temp = (FlipViewItem^) m_curr_flipView->Items->GetAt(result.page_num);
+ Canvas^ results_Canvas = (Canvas^) (flipview_temp->Content);
+
+ m_searchpage = result.page_num;
+
+ screenSize.Y = this->ActualHeight;
+ screenSize.X = this->ActualWidth;
+
+ screenSize.X *= screenScale;
+ screenSize.Y *= screenScale;
+
+ pageSize = measurePage(m_doc, page);
+ scale = fitPageToScreen(pageSize, screenSize);
+
+ /* Now add the rects */
+ for (int k = 0; k < result.box_count && k < MAX_SEARCH; k++)
+ {
+ /* Create a new ref counted Rectangle */
+ Rectangle^ a_rectangle = ref new Rectangle();
+ TranslateTransform ^trans_transform = ref new TranslateTransform();
+ a_rectangle->Width = hit_bbox[k].x1 - hit_bbox[k].x0;
+ a_rectangle->Height = hit_bbox[k].y1 - hit_bbox[k].y0;
+ trans_transform->X = hit_bbox[k].x0 * scale.X;
+ trans_transform->Y = hit_bbox[k].y0 * scale.Y;
+ a_rectangle->Width *= scale.X;
+ a_rectangle->Height *= scale.Y;
+ a_rectangle->RenderTransform = trans_transform;
+ a_rectangle->Fill = m_textcolor_brush;
+ results_Canvas->Children->Append(a_rectangle);
+ m_search_rect_count += 1;
+ }
+ if (result.box_count > 0)
+ {
+ m_flip_from_searchlink = true;
+ this->m_curr_flipView->SelectedIndex = result.page_num;
+ m_currpage = result.page_num;
+ }
+ }, task_continuation_context::use_current());
+#endif
+}
+
+void mupdf_cpp::MainPage::SearchNext(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ StackPanel^ leftPanel = (StackPanel^) this->TopAppBar->FindName("LeftPanel");
+ TextBox^ findBox = (TextBox^) leftPanel->FindName("findBox");
+ String^ textToFind = findBox->Text;
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ /* Create a task to wait until the renderer is available */
+ create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ }).then([this, textToFind]()
+ {
+ if (this->m_search_active == false)
+ SearchInDirection(1, textToFind);
+ }, task_continuation_context::use_current());
+}
+
+void mupdf_cpp::MainPage::SearchPrev(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ StackPanel^ leftPanel = (StackPanel^) this->TopAppBar->FindName("LeftPanel");
+ TextBox^ findBox = (TextBox^) leftPanel->FindName("findBox");
+ String^ textToFind = findBox->Text;
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ /* Create a task to wait until the renderer is available */
+ create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ }).then([this, textToFind]()
+ {
+ if (this->m_search_active == false)
+ SearchInDirection(-1, textToFind);
+ }, task_continuation_context::use_current());
+}
+
+void mupdf_cpp::MainPage::CancelSearch(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ m_searchcts.cancel();
+}
+
+void mupdf_cpp::MainPage::ResetSearch(void)
+{
+ m_searchpage = -1;
+#if 0
+ wchar_t buf[20];
+ String^ TempString = ref new String(buf);
+
+ /* Remove all the rects */
+ for (int k = 0; k < this->m_search_rect_count; k++)
+ {
+ unsigned int index;
+ int len = swprintf_s(buf, 20, L"%s_%d", L"Rect",k);
+ Rectangle^ curr_rect = (Rectangle^) (m_curr_flipView->FindName(TempString));
+ if (curr_rect != nullptr)
+ {
+ Canvas^ results_Canvas = (Canvas^) curr_rect->Parent;
+ results_Canvas->Children->IndexOf(curr_rect, &index);
+ results_Canvas->Children->RemoveAt(index);
+ }
+ }
+#endif
+}
+
+void mupdf_cpp::MainPage::SearchInDirection(int dir, String^ textToFind)
+{
+ cancellation_token_source cts;
+ auto token = cts.get_token();
+ m_searchcts = cts;
+ int pos = m_currpage;
+ int start;
+ SearchResult_t result;
+
+ result.box_count = 0;
+ result.page_num = -1;
+
+ if (m_searchpage == pos)
+ start = pos + dir;
+ else
+ start = pos;
+
+ /* ProgressBar^ my_xaml_Progress = (ProgressBar^) (this->FindName("xaml_Progress"));
+ my_xaml_Progress->Value = start;
+ my_xaml_Progress->IsEnabled = true;
+ my_xaml_Progress->Opacity = 1.0; */
+
+ /* ProgressBar^ my_bar = (ProgressBar^) (xaml_MainGrid->FindName("search_progress"));
+
+ if (my_bar == nullptr)
+ {
+ my_bar = ref new ProgressBar();
+ my_bar->Name = "search_progress";
+ my_bar->Maximum = this->m_num_pages;
+ my_bar->Value = start;
+ my_bar->IsIndeterminate = false;
+ my_bar->Height = 10;
+ my_bar->Width = 400;
+ xaml_MainGrid->Children->Append(my_bar);
+ }
+ else
+ {
+ my_bar->Value = start;
+ } */
+ this->m_search_active = true;
+
+ /* Do task lambdas here to avoid UI blocking issues */
+ auto search_task = create_task([this, textToFind, dir, start, &result]()->SearchResult_t
+ {
+ for (int i = start; i >= 0 && i < this->m_num_pages; i += dir)
+ {
+ result.box_count = this->mu_doc->ComputeTextSearch(textToFind, i);
+ result.page_num = i;
+
+ //my_xaml_Progress->Value = i;
+ if (result.box_count > 0)
+ {
+ return result;
+ }
+ if (is_task_cancellation_requested())
+ {
+ }
+ }
+ /* Todo no matches found alert */
+ return result;
+ }, token);
+ /* Do the continuation on the ui thread */
+ search_task.then([this](task<SearchResult_t> the_task)
+ {
+ SearchResult_t the_result = the_task.get();
+ if (the_result.box_count > 0)
+ {
+ // ProgressBar^ xaml_Progress = (ProgressBar^) (this->FindName("xaml_Progress"));
+ // xaml_Progress->IsEnabled = false;
+ // xaml_Progress->Opacity = 0.0;
+ this->ShowSearchResults(the_result);
+ }
+ this->m_search_active = false;
+ }, task_continuation_context::use_current());
+}
+
+/* This is here to handle when we rotate or go into the snapview mode
+ ToDo add in data binding to change the scroll direction */
+void mupdf_cpp::MainPage::GridSizeChanged()
+{
+ int height = this->ActualHeight;
+ int width = this->ActualWidth;
+ FlipView^ old_flip = m_curr_flipView;
+
+
+ if (TopAppBar1->IsOpen)
+ {
+ UpdateAppBarButtonViewState();
+ }
+
+ if (height > width)
+ {
+ m_curr_flipView = this->xaml_vert_flipView;
+ if (!m_zoom_mode)
+ {
+ this->xaml_zoomCanvas->Height = height;
+ this->xaml_zoomCanvas->Width = width;
+ this->m_curr_flipView->Height = height;
+ this->m_curr_flipView->Width = width;
+ }
+ xaml_vert_flipView->IsEnabled = true;
+ xaml_vert_flipView->Opacity = 1;
+ xaml_horiz_flipView->IsEnabled = false;
+ xaml_horiz_flipView->Opacity = 0; }
+ else
+ {
+ m_curr_flipView = this->xaml_horiz_flipView;
+ if (!m_zoom_mode)
+ {
+ this->xaml_zoomCanvas->Height = height;
+ this->xaml_zoomCanvas->Width = width;
+ this->m_curr_flipView->Height = height;
+ this->m_curr_flipView->Width = width;
+ }
+ xaml_horiz_flipView->IsEnabled = true;
+ xaml_horiz_flipView->Opacity = 1;
+ xaml_vert_flipView->IsEnabled = false;
+ xaml_vert_flipView->Opacity = 0;
+ }
+
+ if (xaml_RichText->Visibility == Windows::UI::Xaml::Visibility::Visible)
+ {
+ int height = xaml_OutsideGrid->ActualHeight;
+ int height_app = TopAppBar1->ActualHeight;
+
+ xaml_RichText->Height = height - height_app;
+ }
+
+ UpDatePageSizes();
+
+ if (m_num_pages > 0 && old_flip != m_curr_flipView && old_flip != nullptr)
+ {
+ if ((this->m_curr_flipView->SelectedIndex == this->m_currpage) && this->m_links_on)
+ FlipView_SelectionChanged(nullptr, nullptr);
+ else
+ this->m_curr_flipView->SelectedIndex = this->m_currpage;
+ }
+}
+
+void mupdf_cpp::MainPage::UpDatePageSizes()
+{
+ /* Render our current pages at the new resolution and rescale the thumbnail
+ canvas if needed */
+ if (m_num_pages > 0)
+ {
+ for (int i = 0; i < m_num_pages; i++)
+ {
+ FlipViewItem ^flipview_temp = (FlipViewItem^) m_curr_flipView->Items->GetAt(i);
+ if (flipview_temp != nullptr && flipview_temp->Content != nullptr)
+ {
+ Canvas^ curr_canvas = (Canvas^) flipview_temp->Content;
+ int curr_canvas_height = curr_canvas->Height;
+ int curr_canvas_width = curr_canvas->Width;
+
+ double scale_x = (double) curr_canvas_height / (double) this->xaml_zoomCanvas->Height;
+ double scale_y = (double) curr_canvas_width / (double) this->xaml_zoomCanvas->Width;
+
+ double min_scale = max(scale_x, scale_y);
+ curr_canvas->Height = curr_canvas_height / min_scale;
+ curr_canvas->Width = curr_canvas_width / min_scale;
+ }
+ }
+ }
+};
+
+void mupdf_cpp::MainPage::ClearLinksCanvas()
+{
+ Canvas^ link_canvas = (Canvas^) (this->FindName("linkCanvas"));
+ if (link_canvas != nullptr)
+ {
+ Canvas^ Parent_Canvas = (Canvas^) link_canvas->Parent;
+ if (Parent_Canvas != nullptr)
+ {
+ Parent_Canvas->Children->RemoveAtEnd();
+ delete link_canvas;
+ }
+ }
+}
+
+/* Link related code */
+void mupdf_cpp::MainPage::Linker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ m_links_on = !m_links_on;
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+
+ if (m_links_on)
+ {
+ auto t = create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ });
+
+ t.then([this]()
+ {
+ AddLinkCanvas();
+ }, task_continuation_context::use_current());
+ }
+ else
+ ClearLinksCanvas();
+}
+
+void mupdf_cpp::MainPage::AddLinkCanvas()
+{
+ return;
+ /* This is disabled for now until I figure out how to add the canvas
+ with rects into the data template for the scroll view object */
+ if (m_links_on)
+ {
+ ClearLinksCanvas();
+
+ int num_links = mu_doc->ComputeLinks(m_currpage);
+ if (num_links == 0) return;
+
+ Point screenSize;
+ Point pageSize;
+ Point scale;
+
+ screenSize.Y = this->ActualHeight;
+ screenSize.X = this->ActualWidth;
+ screenSize.X *= screenScale;
+ screenSize.Y *= screenScale;
+ pageSize = mu_doc->GetPageSize(m_currpage);
+ scale = fitPageToScreen(pageSize, screenSize);
+
+ /* A new canvas */
+ Canvas^ link_canvas = ref new Canvas();
+ link_canvas->Name = "linkCanvas";
+
+ /* Get current scrollview item */
+ auto currItem = m_curr_flipView->ItemContainerGenerator->ContainerFromItem(m_curr_flipView->SelectedItem);
+ if (currItem == nullptr)
+ {
+ return;
+ }
+
+ FlipViewItem ^flipview_temp = (FlipViewItem^) m_curr_flipView->Items->GetAt(m_currpage);
+ Canvas^ curr_canvas = (Canvas^) flipview_temp->Content;
+
+ link_canvas->Height = curr_canvas->Height;
+ link_canvas->Width = curr_canvas->Width;
+ curr_canvas->Children->Append(link_canvas);
+
+ /* Now add the rects */
+ for (int k = 0; k < num_links; k++)
+ {
+ auto curr_link = mu_doc->GetLink(k);
+ if (curr_link->Type != NOT_SET)
+ {
+ Rectangle^ a_rectangle = ref new Rectangle();
+ TranslateTransform ^trans_transform = ref new TranslateTransform();
+
+ a_rectangle->IsTapEnabled = true;
+ a_rectangle->Width = curr_link->LowerRight.X - curr_link->UpperLeft.X;
+ a_rectangle->Height = curr_link->UpperLeft.Y - curr_link->LowerRight.Y;
+ trans_transform->X = curr_link->UpperLeft.X * scale.X;
+ trans_transform->Y = curr_link->UpperLeft.Y * scale.Y;
+ a_rectangle->Width *= scale.X;
+ a_rectangle->Height *= scale.Y;
+ a_rectangle->RenderTransform = trans_transform;
+ a_rectangle->Fill = m_linkcolor_brush;
+ link_canvas->Children->Append(a_rectangle);
+ }
+ }
+ }
+}
+
+bool mupdf_cpp::MainPage::CheckRect(Rectangle^ curr_rect, Point pt)
+{
+ TranslateTransform ^trans_transform = (TranslateTransform^) curr_rect->RenderTransform;
+ Point rect_start;
+ Point rect_end;
+
+ rect_start.X = trans_transform->X;
+ rect_start.Y = trans_transform->Y;
+ rect_end.X = rect_start.X + curr_rect->Width;
+ rect_end.Y = rect_start.Y + curr_rect->Height;
+ if ((rect_start.X < pt.X) && (pt.X < rect_end.X) && (rect_start.Y < pt.Y) && (pt.Y < rect_end.Y))
+ return true;
+ return false;
+}
+
+void mupdf_cpp::MainPage::Canvas_Single_Tap(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
+{
+ /* See if we are currently viewing any links */
+ if (m_links_on)
+ {
+ Point pt;
+ Canvas^ link_canvas = (Canvas^) (m_curr_flipView->FindName("linkCanvas"));
+ if (link_canvas != nullptr)
+ {
+ pt = e->GetPosition(link_canvas);
+ IIterator<UIElement^> ^it = link_canvas->Children->First();
+ int count = 0;
+ while (it->HasCurrent)
+ {
+ Rectangle^ curr_rect = (Rectangle^) (it->Current);
+ if (CheckRect(curr_rect, pt))
+ {
+ int page = JumpToLink(count);
+ if (page >= 0)
+ this->m_curr_flipView->SelectedIndex = page;
+ return;
+ }
+ it->MoveNext();
+ count += 1;
+ }
+ }
+ }
+}
+
+/* Window string hurdles.... */
+static String^ char_to_String(char *char_in)
+{
+ size_t size = MultiByteToWideChar(CP_UTF8, 0, char_in, -1, NULL, 0);
+ wchar_t *pw;
+ pw = new wchar_t[size];
+ if (!pw)
+ {
+ delete []pw;
+ return nullptr;
+ }
+ MultiByteToWideChar (CP_UTF8, 0, char_in, -1, pw, size );
+ String^ str_out = ref new String(pw);
+ delete []pw;
+ return str_out;
+}
+
+int mupdf_cpp::MainPage::JumpToLink(int index)
+{
+ auto link = mu_doc->GetLink(index);
+
+ if (link->Type == LINK_GOTO)
+ {
+ return link->PageNum;
+ }
+ else if (link->Type == LINK_URI)
+ {
+ // Set the option to show a warning
+ auto launchOptions = ref new Windows::System::LauncherOptions();
+ launchOptions->TreatAsUntrusted = true;
+
+ // Launch the URI with a warning prompt
+ concurrency::task<bool> launchUriOperation(Windows::System::Launcher::LaunchUriAsync(link->Uri, launchOptions));
+ launchUriOperation.then([](bool success)
+ {
+ if (success)
+ {
+ // URI launched
+ }
+ else
+ {
+ // URI launch failed
+ }
+ });
+ return -1;
+ }
+ return 0;
+}
+
+void mupdf_cpp::MainPage::FlattenOutline(fz_outline *outline, int level)
+{
+#if 0
+ char indent[8*4+1];
+ if (level > 8)
+ level = 8;
+ memset(indent, ' ', level * 4);
+ indent[level * 4] = 0;
+
+ String^ indent_str = char_to_String(indent);
+ String^ str_indent;
+
+ while (outline)
+ {
+ if (outline->dest.kind == FZ_LINK_GOTO)
+ {
+ int page = outline->dest.ld.gotor.page;
+ if (page >= 0 && outline->title)
+ {
+ /* Add to the contents */
+ m_content.page->Append(page);
+ String^ str = char_to_String(outline->title);
+ m_content.string_orig->Append(str);
+ str_indent = str_indent->Concat(indent_str, str);
+ m_content.string_margin->Append(str_indent);
+ m_content.num += 1;
+ }
+ }
+ FlattenOutline(outline->down, level + 1);
+ outline = outline->next;
+ }
+#endif
+}
+
+/* Bring up the contents */
+void mupdf_cpp::MainPage::ContentDisplay(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+#if 0
+ if (this->m_num_pages < 0 || m_zoom_mode) return;
+
+ if (this->xaml_ListView->IsEnabled)
+ {
+ this->xaml_ListView->Opacity = 0.0;
+ this->xaml_ListView->IsEnabled = false;
+ this->m_curr_flipView->Opacity = 1.0;
+ this->m_curr_flipView->IsEnabled = true;
+ }
+ else
+ {
+ if (!m_content.num)
+ {
+ /* Make sure we are good to go */
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+ fz_outline *root = NULL;
+
+ /* Create a task to wait until the renderer is available */
+ auto t = create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ }).then([this, &root]()
+ {
+ root = fz_load_outline(m_doc);
+ if (root)
+ {
+ /* Flatten here if needed */
+ m_content.page = ref new Vector<int>;
+ m_content.string_margin = ref new Vector<String^>;
+ m_content.string_orig = ref new Vector<String^>;
+
+
+ FlattenOutline(root, 0);
+ fz_free_outline(ctx, root);
+
+ /* Bring up the content now */
+ for (int k = 0; k < m_content.num; k++)
+ {
+ auto content_val = ref new LVContents;
+ content_val->Page = m_content.page->GetAt(k);
+ content_val->ContentItem = m_content.string_margin->GetAt(k);
+ this->xaml_ListView->Items->Append(content_val);
+ }
+ }
+ if (m_content.num)
+ {
+ this->xaml_ListView->Opacity = 1.0;
+ this->xaml_ListView->IsEnabled = true;
+ this->m_curr_flipView->Opacity = 0.0;
+ this->m_curr_flipView->IsEnabled = false;
+ }
+ /* Check if thumb rendering is done. If not then restart */
+ if (this->m_num_pages != this->m_thumb_page_start)
+ this->RenderThumbs();
+ }, task_continuation_context::use_current());
+ }
+ else
+ {
+ this->xaml_ListView->Opacity = 1.0;
+ this->xaml_ListView->IsEnabled = true;
+ this->m_curr_flipView->Opacity = 0.0;
+ this->m_curr_flipView->IsEnabled = false;
+ }
+ }
+#endif
+}
+
+void mupdf_cpp::MainPage::ContentSelected(Platform::Object^ sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^ e)
+{
+
+ LVContents^ b = safe_cast<LVContents^>(e->ClickedItem);
+ int newpage = b->Page;
+
+ if (newpage > -1 && newpage < this->m_num_pages)
+ {
+ this->xaml_ListView->Opacity = 0.0;
+ this->xaml_ListView->IsEnabled = false;
+ this->m_curr_flipView->Opacity = 1.0;
+ this->m_curr_flipView->IsEnabled = true;
+
+ int old_page = this->m_currpage;
+ this->m_curr_flipView->SelectedIndex = newpage;
+ this->m_currpage = newpage;
+ }
+}
+
+void mupdf_cpp::MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+#if 0
+ if (this->m_num_pages < 0) return;
+
+ if (xaml_RichText->Visibility == Windows::UI::Xaml::Visibility::Visible)
+ {
+ /* Go back to flip view */
+ xaml_RichText->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ this->xaml_MainGrid->Opacity = 1.0;
+ this->m_curr_flipView->IsEnabled = true;
+ xaml_RichGrid->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ xaml_RichGrid->Opacity = 0.0;
+
+ }
+ else if (this->m_curr_flipView->IsEnabled)
+ {
+ /* Only go from flip view to reflow */
+ RenderingStatus_t *ren_status = &m_ren_status;
+ cancellation_token_source *ThumbCancel = &m_ThumbCancel;
+ /* Create a task to wait until the renderer is available */
+ auto t = create_task([ren_status, ThumbCancel]()
+ {
+ if (*ren_status == REN_THUMBS)
+ ThumbCancel->cancel();
+ while (*ren_status != REN_AVAILABLE) {
+ }
+ }).then([this]()
+ {
+ fz_rect bounds;
+ fz_output *out;
+ fz_page *page = fz_load_page(m_doc, this->m_currpage);
+ fz_text_sheet *sheet = fz_new_text_sheet(ctx);
+ fz_text_page *text = fz_new_text_page(ctx, &fz_empty_rect);
+ fz_device *dev = fz_new_text_device(ctx, sheet, text);
+
+ fz_run_page(m_doc, page, dev, &fz_identity, NULL);
+ fz_free_device(dev);
+ dev = NULL;
+ fz_text_analysis(ctx, sheet, text);
+ fz_buffer *buf = fz_new_buffer(ctx, 256);
+ out = fz_new_output_buffer(ctx, buf);
+ fz_print_text_page(ctx, out, text);
+ xaml_RichText->Visibility = Windows::UI::Xaml::Visibility::Visible;
+ this->xaml_MainGrid->Opacity = 0.0;
+ this->m_curr_flipView->IsEnabled = false;
+ String^ html_string = char_to_String((char*) buf->data);
+
+ xaml_RichGrid->Visibility = Windows::UI::Xaml::Visibility::Visible;
+ xaml_RichGrid->Opacity = 1.0;
+ int height = xaml_OutsideGrid->ActualHeight;
+ int height_app = TopAppBar1->ActualHeight;
+
+ xaml_RichText->Height = height - height_app;
+ this->xaml_RichText->Document->SetText(Windows::UI::Text::TextSetOptions::FormatRtf, html_string);
+
+ /* Check if thumb rendering is done. If not then restart */
+ if (this->m_num_pages != this->m_thumb_page_start)
+ this->RenderThumbs();
+ }, task_continuation_context::use_current());
+ }
+#endif
+}
+
+/* Need to handle resizing of app bar to make sure everything fits */
+
+void mupdf_cpp::MainPage::topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ UpdateAppBarButtonViewState();
+}
+
+void mupdf_cpp::MainPage::UpdateAppBarButtonViewState()
+{
+ String ^viewState = Windows::UI::ViewManagement::ApplicationView::Value.ToString();
+ VisualStateManager::GoToState(Search, viewState, true);
+ VisualStateManager::GoToState(Contents, viewState, true);
+ VisualStateManager::GoToState(Links, viewState, true);
+ VisualStateManager::GoToState(Reflow, viewState, true);
+ VisualStateManager::GoToState(Help, viewState, true);
+}
+
+void mupdf_cpp::MainPage::ScrollChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e)
+{
+
+ int zz = 1;
+}
diff --git a/winrt/mupdf_cpp/MainPage.xaml.h b/winrt/mupdf_cpp/MainPage.xaml.h
new file mode 100644
index 00000000..6d8bbe79
--- /dev/null
+++ b/winrt/mupdf_cpp/MainPage.xaml.h
@@ -0,0 +1,198 @@
+//
+// MainPage.xaml.h
+// Declaration of the MainPage class.
+//
+
+#pragma once
+
+#include "MainPage.g.h"
+#include "ppl.h"
+#include "ppltasks.h"
+#include <collection.h>
+#include <algorithm>
+#include "LVContents.h"
+#include "mudocument.h"
+#include "DocumentPage.h"
+
+using namespace Platform;
+using namespace Concurrency;
+using namespace Windows::Storage;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Media::Imaging;
+using namespace Windows::Storage::Streams;
+using namespace Windows::Foundation;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI::Xaml::Shapes;
+using namespace Windows::Foundation::Collections;
+using namespace Platform::Collections;
+using namespace ListViewContents;
+using namespace Windows::UI::ViewManagement;
+using namespace Windows::UI::Popups;
+using namespace Windows::UI::Xaml::Navigation;
+using namespace mupdfwinrt;
+
+typedef enum
+{
+ StatusMessage,
+ ErrorMessage
+} NotifyType_t;
+
+typedef enum {
+ REN_AVAILABLE = 0,
+ REN_THUMBS,
+ REN_UPDATE_THUMB_CANVAS,
+ REN_PAGE /* Used to ignore value when source based setting */
+} RenderingStatus_t;
+
+typedef struct SearchResult_s
+{
+ int box_count;
+ int page_num;
+} SearchResult_t;
+
+typedef struct spatial_info_s
+{
+ Point size;
+ double scale_factor;
+} spatial_info_t;
+
+typedef struct thumbs_s
+{
+ Array<InMemoryRandomAccessStream^>^ raster;
+ Array<double>^ scale;
+ Array<Point>^ size;
+} thumbs_t;
+
+typedef struct content_s
+{
+ int num;
+ Vector<int>^ page;
+ Vector<String^>^ string_orig;
+ Vector<String^>^ string_margin;
+} content_t;
+
+namespace mupdf_cpp
+{
+ /// <summary>
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ /// </summary>
+ public ref class MainPage sealed
+ {
+ public:
+ MainPage();
+
+ protected:
+ virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
+
+ /* added */
+ private:
+ Vector<DocumentPage^>^ m_docPages;
+ mudocument^ mu_doc;
+ LVContents temp;
+ bool m_file_open;
+ int m_currpage;
+ int m_searchpage;
+ int m_num_pages;
+ int m_slider_min;
+ int m_slider_max;
+ bool m_init_done;
+ bool m_first_time;
+ bool m_flip_from_searchlink;
+ bool m_links_on;
+ int m_search_rect_count;
+ Point m_display_size;
+ cancellation_token_source m_searchcts;
+ cancellation_token_source m_thumbcts;
+ bool m_page_update;
+ long long m_memory_use;
+ double m_curr_zoom;
+ Point m_zoom_size;
+ Point m_touchpoint;
+ Point m_canvas_translate;
+ Windows::UI::Input::ManipulationDelta m_changes;
+ ImageBrush^ m_renderedImage;
+ ImageBrush^ m_blankPage;
+ WriteableBitmap ^m_BlankBmp;
+ Canvas^ m_renderedCanvas;
+ ImageBrush^ m_zoomedImage;
+ SolidColorBrush^ m_textcolor_brush;
+ SolidColorBrush^ m_linkcolor_brush;
+ FlipView^ m_curr_flipView;
+ thumbs_t m_thumbnails;
+ RenderingStatus_t m_ren_status;
+ int m_thumb_page_start;
+ int m_thumb_page_stop;
+ cancellation_token_source m_ThumbCancel;
+ content_t m_content;
+ TextBlock^ m_StatusBlock;
+ bool m_zoom_mode;
+ bool m_from_doubleflip;
+ bool m_scaling_occured;
+ bool m_insearch; /* Used for UI display */
+ bool m_search_active; /* Used to avoid multiple UI clicks */
+ bool m_sliderchange;
+ bool m_update_flip;
+ void Picker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void Searcher(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void OpenDocumentPrep(StorageFile^ file);
+ void OpenDocument(StorageFile^ file);
+ task<int> RenderRange(int curr_page);
+ void CleanUp();
+ void UpdatePage(int page_num, InMemoryRandomAccessStream^ ras, Point ras_size, Page_Content_t content_type);
+ void CreateBlank(int width, int height);
+ void HandleFileNotFoundException(Platform::COMException^ e);
+ void NotifyUserFileNotExist();
+ void SetFlipView();
+ Point currPageSize(int page);
+ void Slider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
+ void Slider_Released(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
+ void FlipView_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e);
+ void SearchNext(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void SearchPrev(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void ResetSearch(void);
+ void CancelSearch(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void SearchInDirection(int dir, String^ textToFind);
+ void ShowSearchResults(SearchResult_t result);
+ void GridSizeChanged();
+ void UpDatePageSizes();
+ void ShowThumbnail();
+ void Canvas_ManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
+ void AddThumbNail(int page_num, FlipView^ flip_view);
+ spatial_info_t InitSpatial(double scale);
+ void InitThumbnails();
+ void RenderThumbs();
+ void SetThumb(int page_num, bool replace);
+ void ReleasePages(int old_page, int new_page);
+ void Linker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void AddLinkCanvas();
+ void Canvas_Single_Tap(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
+ bool CheckRect(Rectangle^ curr_rect, Point pt);
+ int JumpToLink(int index);
+ void ClearLinksCanvas();
+ void ContentDisplay(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void FlattenOutline(fz_outline *outline, int level);
+ void ListView_Single_Tap(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
+ void ContentSelected(Platform::Object^ sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^ e);
+ void ContentChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
+ void Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void WebViewDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
+ void WebViewStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartingRoutedEventArgs^ e);
+ void WebViewCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
+ void TempViewStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartingRoutedEventArgs^ e);
+ void RichGridSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
+ void RichGridManipulationStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartingRoutedEventArgs^ e);
+ void RichGridManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
+ void RichGridManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
+ void RichGridManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
+ void topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void UpdateAppBarButtonViewState();
+ bool EnsureUnsnapped();
+ void NotifyUser(String^ strMessage, NotifyType_t type);
+ void ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command);
+ void OKInvokedHandler(Windows::UI::Popups::IUICommand^ command);
+ Point ComputePageSize(spatial_info_t spatial_info, int page_num);
+ void ScrollChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e);
+};
+}
diff --git a/winrt/mupdf_cpp/Package.appxmanifest b/winrt/mupdf_cpp/Package.appxmanifest
new file mode 100644
index 00000000..a071179b
--- /dev/null
+++ b/winrt/mupdf_cpp/Package.appxmanifest
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
+ <Identity Name="faab8eca-be5e-4e0d-b782-213ccbbc5f34" Publisher="CN=michaelv" Version="1.0.0.0" />
+ <Properties>
+ <DisplayName>mupdf_cpp</DisplayName>
+ <PublisherDisplayName>michaelv</PublisherDisplayName>
+ <Logo>Assets\mupdf_storelogo.png</Logo>
+ </Properties>
+ <Prerequisites>
+ <OSMinVersion>6.2.1</OSMinVersion>
+ <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
+ </Prerequisites>
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+ <Applications>
+ <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="mupdf_cpp.App">
+ <VisualElements DisplayName="mupdf_cpp" Logo="Assets\mupdf_logo.png" SmallLogo="Assets\mupdf_smallogo.png" Description="mupdf_cpp" ForegroundText="light" BackgroundColor="#464646">
+ <DefaultTile ShowName="allLogos" />
+ <SplashScreen Image="Assets\mupdf_splash.png" />
+ </VisualElements>
+ <Extensions>
+ <Extension Category="windows.fileOpenPicker">
+ <FileOpenPicker>
+ <SupportedFileTypes>
+ <FileType>.pdf</FileType>
+ <FileType>.xps</FileType>
+ <FileType>.oxps</FileType>
+ </SupportedFileTypes>
+ </FileOpenPicker>
+ </Extension>
+ <Extension Category="windows.fileTypeAssociation">
+ <FileTypeAssociation Name=".pdf">
+ <SupportedFileTypes>
+ <FileType>.pdf</FileType>
+ <FileType>.xps</FileType>
+ <FileType>.oxps</FileType>
+ </SupportedFileTypes>
+ </FileTypeAssociation>
+ </Extension>
+ </Extensions>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="documentsLibrary" />
+ <Capability Name="internetClient" />
+ </Capabilities>
+</Package> \ No newline at end of file
diff --git a/winrt/mupdf_cpp/RectList.cpp b/winrt/mupdf_cpp/RectList.cpp
new file mode 100644
index 00000000..0095af3b
--- /dev/null
+++ b/winrt/mupdf_cpp/RectList.cpp
@@ -0,0 +1,16 @@
+#include "pch.h"
+#include "RectList.h"
+
+namespace mupdf_cpp
+{
+ RectList::RectList(void)
+ {
+
+
+
+
+ }
+
+}
+
+
diff --git a/winrt/mupdf_cpp/RectList.h b/winrt/mupdf_cpp/RectList.h
new file mode 100644
index 00000000..eb4532aa
--- /dev/null
+++ b/winrt/mupdf_cpp/RectList.h
@@ -0,0 +1,68 @@
+#pragma once
+
+
+/* Used for binding to the xaml in the scroll view. */
+using namespace Windows::UI::Xaml::Media::Imaging;
+using namespace Windows::UI::Xaml::Controls;
+
+
+
+namespace mupdf_cpp
+{
+ [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
+
+ public ref class RectList sealed
+ {
+ private:
+ int heightr;
+ int widthr;
+ int x;
+ int y;
+ public:
+ RectList(void);
+
+ property int HeightR
+ {
+ int get() { return ((int) heightr); }
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ heightr = value;
+ }
+ }
+
+ property int WidthR
+ {
+ int get() { return widthr; }
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ widthr = value;
+ }
+ }
+
+ property int X
+ {
+ int get() { return x; }
+ void set(int value)
+ {
+ x = value;
+ }
+ }
+
+ property int Y
+ {
+ int get() { return y; }
+ void set(int value)
+ {
+ y = value;
+ }
+ }
+ };
+}
diff --git a/winrt/mupdf_cpp/mupdf_cpp.vcxproj b/winrt/mupdf_cpp/mupdf_cpp.vcxproj
new file mode 100644
index 00000000..bb616403
--- /dev/null
+++ b/winrt/mupdf_cpp/mupdf_cpp.vcxproj
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{0204a4e7-f1b8-4268-a67c-a2c674b4742d}</ProjectGuid>
+ <RootNamespace>mupdf_cpp</RootNamespace>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <AppContainerApplication>true</AppContainerApplication>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <PackageCertificateKeyFile>mupdf_cpp_TemporaryKey.pfx</PackageCertificateKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>../../fitz/;../../pdf/;../../xps/;../mupdfwinrt/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;../$(Platform)/$(Configuration)/mupdfwinrt.lib</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>../../fitz/;../../pdf/;../../xps/;mupdfwinrt/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;../$(Platform)/$(Configuration)/mupdfwinrt.lib</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <DisableSpecificWarnings>4453</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="DocumentPage.h" />
+ <ClInclude Include="LVContents.h" />
+ <ClInclude Include="pch.h" />
+ <ClInclude Include="App.xaml.h">
+ <DependentUpon>App.xaml</DependentUpon>
+ </ClInclude>
+ <ClInclude Include="MainPage.xaml.h">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </ClInclude>
+ <ClInclude Include="RectList.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Page Include="Common\StandardStyles.xaml">
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <AppxManifest Include="Package.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <None Include="mupdf_cpp_TemporaryKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="App.xaml.cpp">
+ <DependentUpon>App.xaml</DependentUpon>
+ </ClCompile>
+ <ClCompile Include="DocumentPage.cpp" />
+ <ClCompile Include="LVContents.cpp" />
+ <ClCompile Include="MainPage.xaml.cpp">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </ClCompile>
+ <ClCompile Include="pch.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="RectList.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="Assets\mupdf_logo.png" />
+ <Image Include="Assets\mupdf_smallogo.png" />
+ <Image Include="Assets\mupdf_splash.png" />
+ <Image Include="Assets\mupdf_storelogo.png" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters b/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters
new file mode 100644
index 00000000..732b68c7
--- /dev/null
+++ b/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Common">
+ <UniqueIdentifier>0204a4e7-f1b8-4268-a67c-a2c674b4742d</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Assets">
+ <UniqueIdentifier>a297f943-f0d7-4847-867e-a7aa1ef7f484</UniqueIdentifier>
+ </Filter>
+ <Page Include="Common\StandardStyles.xaml">
+ <Filter>Common</Filter>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="App.xaml.cpp" />
+ <ClCompile Include="MainPage.xaml.cpp" />
+ <ClCompile Include="pch.cpp" />
+ <ClCompile Include="LVContents.cpp" />
+ <ClCompile Include="DocumentPage.cpp" />
+ <ClCompile Include="RectList.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="pch.h" />
+ <ClInclude Include="App.xaml.h" />
+ <ClInclude Include="MainPage.xaml.h" />
+ <ClInclude Include="LVContents.h" />
+ <ClInclude Include="DocumentPage.h" />
+ <ClInclude Include="RectList.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <AppxManifest Include="Package.appxmanifest" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="mupdf_cpp_TemporaryKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="MainPage.xaml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="Assets\mupdf_logo.png">
+ <Filter>Assets</Filter>
+ </Image>
+ <Image Include="Assets\mupdf_smallogo.png">
+ <Filter>Assets</Filter>
+ </Image>
+ <Image Include="Assets\mupdf_splash.png">
+ <Filter>Assets</Filter>
+ </Image>
+ <Image Include="Assets\mupdf_storelogo.png">
+ <Filter>Assets</Filter>
+ </Image>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/winrt/mupdf_cpp/pch.cpp b/winrt/mupdf_cpp/pch.cpp
new file mode 100644
index 00000000..01484ff5
--- /dev/null
+++ b/winrt/mupdf_cpp/pch.cpp
@@ -0,0 +1,6 @@
+//
+// pch.cpp
+// Include the standard header and generate the precompiled header.
+//
+
+#include "pch.h"
diff --git a/winrt/mupdf_cpp/pch.h b/winrt/mupdf_cpp/pch.h
new file mode 100644
index 00000000..fadf910d
--- /dev/null
+++ b/winrt/mupdf_cpp/pch.h
@@ -0,0 +1,9 @@
+//
+// pch.h
+// Header for standard system include files.
+//
+
+#pragma once
+
+#include <collection.h>
+#include "App.xaml.h"
diff --git a/winrt/mupdfwinrt/Links.cpp b/winrt/mupdfwinrt/Links.cpp
new file mode 100644
index 00000000..eb8dfac7
--- /dev/null
+++ b/winrt/mupdfwinrt/Links.cpp
@@ -0,0 +1,11 @@
+#include "pch.h"
+#include "Links.h"
+
+using namespace mupdfwinrt;
+
+Links::Links(void)
+{
+ this->uri = nullptr;
+ this->page_num = -1;
+ this->type = NOT_SET;
+}
diff --git a/winrt/mupdfwinrt/Links.h b/winrt/mupdfwinrt/Links.h
new file mode 100644
index 00000000..64072e35
--- /dev/null
+++ b/winrt/mupdfwinrt/Links.h
@@ -0,0 +1,72 @@
+#pragma once
+
+#include "utils.h"
+
+using namespace Windows::Foundation;
+
+namespace mupdfwinrt
+{
+ public ref class Links sealed
+ {
+ private:
+ int type;
+ Point upper_left;
+ Point lower_right;
+ Windows::Foundation::Uri ^uri;
+ int page_num;
+ public:
+ Links(void);
+
+ property int Type
+ {
+ int get() { return (type); }
+ void set(int value)
+ {
+ if (value > NOT_SET)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ type = value;
+ }
+ }
+
+ property Point UpperLeft
+ {
+ Point get() { return upper_left; }
+ void set(Point value)
+ {
+ upper_left = value;
+ }
+ }
+
+ property Point LowerRight
+ {
+ Point get() { return lower_right; }
+ void set(Point value)
+ {
+ lower_right = value;
+ }
+ }
+
+ property int PageNum
+ {
+ int get() { return page_num; }
+ void set(int value)
+ {
+ page_num = value;
+ }
+ }
+
+ property Windows::Foundation::Uri^ Uri
+ {
+ Windows::Foundation::Uri^ get() { return uri; }
+ void set(Windows::Foundation::Uri^ value)
+ {
+ uri = value;
+ }
+ }
+ };
+}
+
+
+
diff --git a/winrt/mupdfwinrt/muctx.cpp b/winrt/mupdfwinrt/muctx.cpp
new file mode 100644
index 00000000..fcdac960
--- /dev/null
+++ b/winrt/mupdfwinrt/muctx.cpp
@@ -0,0 +1,404 @@
+#pragma once
+
+#include "pch.h"
+#include "muctx.h"
+#include "Links.h"
+
+/* This class interfaces to mupdf API with minimal windows objects (other than
+ the file streaming stuff) */
+
+/* File streaming set up for mupdf */
+
+/* win_read_file etc. Reading of windows managed stream. This is not ideal as I have
+ to read into a managed buffer and then transfer to the actual buffer I want. I
+ would like a more direct approach. Alternate approach is to push this off
+ outside the winrt and read from a memory buffer. */
+static int win_read_file(fz_stream *stm, unsigned char *buf, int len)
+{
+ void *temp = stm->state;
+ win_stream_struct *stream = reinterpret_cast <win_stream_struct*> (temp);
+ IRandomAccessStream^ Stream = stream->stream;
+ unsigned long long curr_pos = Stream->Position;
+ unsigned long long length = Stream->Size;
+ DataReader^ local_reader = ref new DataReader(Stream);
+ DataReaderLoadOperation^ result = local_reader->LoadAsync(len);
+
+ /* Block on the Async call */
+ while(result->Status != AsyncStatus::Completed) {
+
+ }
+
+ result->GetResults();
+ int curr_len2 = local_reader->UnconsumedBufferLength;
+ if (curr_len2 < len)
+ len = curr_len2;
+
+ Platform::Array<unsigned char>^ arrByte = ref new Platform::Array<unsigned char>(len);
+ local_reader->ReadBytes(arrByte);
+
+ memcpy(buf, arrByte->Data, len);
+ local_reader->DetachStream();
+
+ return len;
+}
+
+static void win_seek_file(fz_stream *stm, int offset, int whence)
+{
+ void *temp = stm->state;
+ win_stream_struct *stream = reinterpret_cast <win_stream_struct*> (temp);
+ IRandomAccessStream^ Stream = stream->stream;
+ unsigned long long curr_pos = Stream->Position;
+ unsigned long long length = Stream->Size;
+ unsigned long long n;
+
+ if (whence == SEEK_END)
+ {
+ n = length + offset;
+ }
+ else if (whence == SEEK_CUR)
+ {
+ n = curr_pos + offset;
+ }
+ else if (whence == SEEK_SET)
+ {
+ n = offset;
+ }
+ Stream->Seek(n);
+ curr_pos = Stream->Position;
+ stm->pos = n;
+ stm->rp = stm->bp;
+ stm->wp = stm->bp;
+}
+
+static void win_close_file(fz_context *ctx, void *state)
+{
+ DataReader^ dataReader = reinterpret_cast <DataReader^> (state);
+
+ delete dataReader;
+}
+
+/* mutext functions see mupdf readme for details */
+static void lock_mutex(void *user, int lock)
+{
+ EnterCriticalSection((LPCRITICAL_SECTION)user);
+}
+
+static void unlock_mutex(void *user, int lock)
+{
+ LeaveCriticalSection((LPCRITICAL_SECTION)user);
+}
+
+/* Set up the context, mutex and cookie */
+HRESULT muctx::InitializeContext()
+{
+ /* Get the mutex set up */
+ InitializeCriticalSectionEx(&mu_criticalsec, 0, 0);
+ mu_locks.user = &mu_criticalsec;
+ mu_locks.lock = lock_mutex;
+ mu_locks.unlock = unlock_mutex;
+
+ /* Allocate the context */
+ this->mu_ctx = fz_new_context(NULL, &mu_locks, FZ_STORE_DEFAULT);
+ if (this->mu_ctx == NULL)
+ {
+ return E_OUTOFMEMORY;
+ }
+ else
+ {
+ /* If we are fine, allocate the cookie for progress etc. */
+ this->mu_cookie = (fz_cookie*)malloc(sizeof(fz_cookie));
+ if (this->mu_cookie == NULL) {
+ fz_free_context(this->mu_ctx);
+ return E_OUTOFMEMORY;
+ }
+ else
+ return S_OK;
+ }
+}
+
+/* Initializer */
+muctx::muctx(void)
+{
+ this->mu_cookie = NULL;
+ this->mu_ctx = NULL;
+ this->mu_doc = NULL;
+ this->mu_outline = NULL;
+ this->mu_stream = NULL;
+}
+
+/* Destructor */
+muctx::~muctx(void)
+{
+ free(this->mu_cookie);
+ if (mu_outline != NULL)
+ fz_free_outline(mu_ctx, mu_outline);
+ if (mu_doc != NULL)
+ fz_close_document(mu_doc);
+ if (mu_ctx != NULL)
+ fz_free_context(mu_ctx);
+
+ this->mu_cookie = NULL;
+ this->mu_ctx = NULL;
+ this->mu_doc = NULL;
+ this->mu_outline = NULL;
+ this->mu_stream = NULL;
+}
+
+/* Set up the stream access */
+HRESULT muctx::InitializeStream(IRandomAccessStream^ readStream, char *ext)
+{
+ win_stream.stream = readStream;
+ this->mu_stream = fz_new_stream(mu_ctx, 0, win_read_file, win_close_file);
+ this->mu_stream->seek = win_seek_file;
+ this->mu_stream->state = reinterpret_cast <void*> (&win_stream);
+
+ /* Now lets see if we can open the file */
+ mu_doc = fz_open_document_with_stream(mu_ctx, ext, this->mu_stream);
+
+ if (mu_doc == NULL)
+ return E_FAIL;
+ else
+ return S_OK;
+}
+
+/* Return the documents page count */
+int muctx::GetPageCount()
+{
+ if (this->mu_doc == NULL)
+ return -1;
+ else
+ return this->mu_doc->count_pages(this->mu_doc);
+}
+
+/* Get page size */
+Point muctx::MeasurePage(int page_num)
+{
+ Point pageSize;
+ fz_rect rect;
+ fz_page *page;
+ fz_rect *bounds;
+
+ page = fz_load_page(mu_doc, page_num);
+ bounds = fz_bound_page(mu_doc, page, &rect);
+ pageSize.X = bounds->x1 - bounds->x0;
+ pageSize.Y = bounds->y1 - bounds->y0;
+
+ return pageSize;
+}
+
+/* Get page size */
+Point muctx::MeasurePage(fz_page *page)
+{
+ Point pageSize;
+ fz_rect rect;
+ fz_rect *bounds;
+
+ bounds = fz_bound_page(mu_doc, page, &rect);
+ pageSize.X = bounds->x1 - bounds->x0;
+ pageSize.Y = bounds->y1 - bounds->y0;
+
+ return pageSize;
+}
+
+int muctx::GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec)
+{
+ fz_page *page;
+ fz_text_sheet *sheet;
+ fz_device *dev;
+ fz_context *ctx_clone;
+ fz_text_page *text;
+ int k;
+ int hit_count = 0;
+
+ if (mu_cookie->abort == 1)
+ return hit_count;
+
+ ctx_clone = fz_clone_context(mu_ctx);
+
+ fz_var(page);
+ fz_var(sheet);
+ fz_var(dev);
+ fz_try(ctx_clone)
+ {
+ page = fz_load_page(mu_doc, page_num);
+ sheet = fz_new_text_sheet(ctx_clone);
+ text = fz_new_text_page(ctx_clone, &fz_empty_rect);
+ dev = fz_new_text_device(ctx_clone, sheet, text);
+ fz_run_page(mu_doc, page, dev, &fz_identity, NULL);
+ fz_free_device(dev); /* Why does this need to be done here? Seems odd */
+ dev = NULL;
+ hit_count = fz_search_text_page(ctx_clone, text, needle, mu_hit_bbox, nelem(mu_hit_bbox));
+
+ for (k = 0; k < hit_count; k++)
+ {
+ sh_text text_search(new text_search_t());
+ text_search->upper_left.X = mu_hit_bbox[k].x0;
+ text_search->upper_left.Y = mu_hit_bbox[k].y0;
+ text_search->lower_right.X = mu_hit_bbox[k].x1;
+ text_search->lower_right.Y = mu_hit_bbox[k].x1;
+ texts_vec->push_back(text_search);
+ }
+ }
+ fz_always(ctx_clone)
+ {
+ if (page != NULL)
+ {
+ fz_free_page(mu_doc, page);
+ }
+ if (dev != NULL)
+ {
+ fz_free_device(dev);
+ }
+ if (sheet != NULL)
+ {
+ fz_free_text_sheet(ctx_clone, sheet);
+ }
+ }
+ fz_catch(ctx_clone)
+ {
+ return E_FAIL;
+ }
+ return hit_count;
+}
+
+
+
+/* Get the links and pack into a smart pointer structure */
+int muctx::GetLinks(int page_num, sh_vector_link links_vec)
+{
+ fz_page *page;
+ fz_link *links;
+ fz_context *ctx_clone;
+ int k = 0;
+ int num_links = 0;
+
+ if (mu_cookie->abort == 1)
+ return num_links;
+
+ ctx_clone = fz_clone_context(mu_ctx);
+
+ fz_var(page);
+ fz_var(links);
+ fz_try(ctx_clone)
+ {
+ page = fz_load_page(mu_doc, page_num);
+ links = fz_load_links(mu_doc, page);
+
+ fz_link *curr_link = links;
+ if (curr_link == NULL)
+ return num_links;
+
+ /* Get our smart pointer structure filled */
+ while (curr_link != NULL)
+ {
+ fz_rect curr_rect = curr_link->rect;
+ sh_link link(new document_link_t());
+
+ link->upper_left.X = curr_rect.x0;
+ link->upper_left.Y = curr_rect.y0;
+ link->lower_right.X = curr_rect.x1;
+ link->lower_right.Y = curr_rect.x1;
+
+ switch (curr_link->dest.kind)
+ {
+ case FZ_LINK_GOTO:
+
+ link->type = LINK_GOTO;
+ link->page_num = curr_link->dest.ld.gotor.page;
+ break;
+
+ case FZ_LINK_URI:
+ {
+ int lenstr = strlen(curr_link->dest.ld.uri.uri);
+ std::unique_ptr<char[]> uri(new char[lenstr + 1]);
+ strcpy_s(uri.get(), lenstr + 1, curr_link->dest.ld.uri.uri);
+ link->uri.swap(uri);
+ link->type = LINK_URI;
+ break;
+ }
+
+ default:
+ link->type = NOT_SET;
+
+ }
+ links_vec->push_back(link);
+ curr_link = curr_link->next;
+ num_links += 1;
+ }
+ }
+ fz_always(ctx_clone)
+ {
+ if (page != NULL)
+ {
+ fz_free_page(mu_doc, page);
+ }
+ if (links != NULL)
+ {
+ fz_drop_link(ctx_clone, links);
+ }
+ }
+ fz_catch(ctx_clone)
+ {
+ return E_FAIL;
+ }
+ return num_links;
+}
+
+/* Render page_num to size width by height into bmp_data buffer */
+HRESULT muctx::RenderPage(int page_num, int width, int height,
+ unsigned char *bmp_data)
+{
+ fz_device *dev;
+ fz_pixmap *pix;
+ fz_page *page;
+ fz_matrix ctm, *pctm = &ctm;
+ Point page_size;
+ fz_context *ctx_clone;
+
+ if (mu_cookie->abort == 1)
+ return S_OK;
+
+ ctx_clone = fz_clone_context(mu_ctx);
+
+ fz_var(dev);
+ fz_var(pix);
+ fz_var(page);
+ fz_try(ctx_clone)
+ {
+ page = fz_load_page(mu_doc, page_num);
+ page_size = MeasurePage(page);
+
+ /* Figure out scale factors so that we get the desired size */
+ pctm = fz_scale(pctm, (float) width / page_size.X, (float) height / page_size.Y);
+ /* Flip on Y */
+ ctm.f = height;
+ ctm.d = -ctm.d;
+ pix = fz_new_pixmap_with_data(ctx_clone, fz_device_bgr, width, height, bmp_data);
+ fz_clear_pixmap_with_value(ctx_clone, pix, 255);
+ dev = fz_new_draw_device(ctx_clone, pix);
+ fz_run_page(mu_doc, page, dev, pctm, NULL);
+ }
+ fz_always(ctx_clone)
+ {
+ if (dev != NULL)
+ {
+ fz_free_device(dev);
+ }
+ if (pix != NULL)
+ {
+ fz_drop_pixmap(ctx_clone, pix);
+ }
+ if (page != NULL)
+ {
+ fz_free_page(mu_doc, page);
+ }
+ }
+ fz_catch(ctx_clone)
+ {
+ return E_FAIL;
+ }
+
+ fz_free_context(ctx_clone);
+
+ return S_OK;
+}
diff --git a/winrt/mupdfwinrt/muctx.h b/winrt/mupdfwinrt/muctx.h
new file mode 100644
index 00000000..61aec5a4
--- /dev/null
+++ b/winrt/mupdfwinrt/muctx.h
@@ -0,0 +1,81 @@
+#pragma once
+
+#include <memory>
+#include <functional>
+#include <vector>
+#include "utils.h"
+
+#include <windows.h>
+#include <Winerror.h>
+#include <mutex>
+
+extern "C" {
+ #include "fitz.h"
+ #include "fitz-internal.h"
+ #include "muxps.h"
+ #include "mupdf.h"
+}
+
+#define MAX_SEARCH 500
+
+using namespace Windows::Foundation; /* For Point */
+
+typedef struct document_link_s
+{
+ link_t type;
+ Point upper_left;
+ Point lower_right;
+ std::unique_ptr<char[]> uri;
+ int page_num;
+} document_link_t;
+
+#define sh_link std::shared_ptr<document_link_t>
+#define sh_vector_link std::shared_ptr<std::vector<sh_link>>
+
+typedef struct text_search_s
+{
+ Point upper_left;
+ Point lower_right;
+} text_search_t;
+
+#define sh_text std::shared_ptr<text_search_t>
+#define sh_vector_text std::shared_ptr<std::vector<sh_text>>
+
+/* Needed for file handling */
+using namespace Windows::Storage::Streams;
+using namespace Windows::Foundation;
+
+typedef struct win_stream_struct_s
+{
+ IRandomAccessStream^ stream;
+} win_stream_struct;
+
+class muctx
+{
+private:
+ CRITICAL_SECTION mu_criticalsec;
+ win_stream_struct win_stream;
+ fz_locks_context mu_locks;
+ fz_context *mu_ctx;
+ fz_document *mu_doc;
+ fz_outline *mu_outline;
+ fz_rect mu_hit_bbox[MAX_SEARCH];
+ fz_cookie *mu_cookie;
+ fz_stream *mu_stream;
+
+public:
+ muctx(void);
+ ~muctx(void);
+ HRESULT InitializeStream(IRandomAccessStream^ readStream, char *ext);
+ int GetPageCount();
+ HRESULT InitializeContext();
+ HRESULT RenderPage(int page_num, int width, int height, unsigned char *bmp_data);
+ Point MeasurePage(int page_num);
+ Point MeasurePage(fz_page *page);
+ int GetLinks(int page_num, sh_vector_link links_vec);
+ int GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec);
+};
+
+
+
+
diff --git a/winrt/mupdfwinrt/mudocument.cpp b/winrt/mupdfwinrt/mudocument.cpp
new file mode 100644
index 00000000..cf02083d
--- /dev/null
+++ b/winrt/mupdfwinrt/mudocument.cpp
@@ -0,0 +1,212 @@
+// mudocument.cpp
+#include "pch.h"
+#include "mudocument.h"
+
+using namespace mupdfwinrt;
+using namespace concurrency;
+using namespace Platform::Collections;
+
+/* Window string hurdles.... */
+static String^ char_to_String(char *char_in)
+{
+ size_t size = MultiByteToWideChar(CP_UTF8, 0, char_in, -1, NULL, 0);
+ wchar_t *pw;
+ pw = new wchar_t[size];
+ if (!pw)
+ {
+ delete []pw;
+ return nullptr;
+ }
+ MultiByteToWideChar(CP_UTF8, 0, char_in, -1, pw, size );
+ String^ str_out = ref new String(pw);
+ delete []pw;
+ return str_out;
+}
+
+static char* String_to_char(String^ text)
+{
+ const wchar_t *w = text->Data();
+ int cb = WideCharToMultiByte(CP_UTF8, 0, text->Data(), -1, nullptr, 0, nullptr, nullptr);
+ char* charout = new char[cb];
+ WideCharToMultiByte(CP_UTF8, 0, text->Data() ,-1 ,charout ,cb ,nullptr, nullptr);
+ return charout;
+}
+
+mudocument::mudocument()
+{
+ this->mu_object.InitializeContext();
+ this->links = nullptr;
+}
+
+int mudocument::GetNumPages()
+{
+ return this->mu_object.GetPageCount();
+}
+
+Point mudocument::GetPageSize(int page_num)
+{
+ std::lock_guard<std::mutex> lock(mutex_lock);
+ return this->mu_object.MeasurePage(page_num);
+}
+
+Windows::Foundation::IAsyncAction^ mudocument::OpenFile(StorageFile^ file)
+{
+ return create_async([this, file]()
+ {
+ String^ path = file->Path;
+ const wchar_t *w = path->Data();
+ int cb = WideCharToMultiByte(CP_UTF8, 0, w, -1, nullptr, 0, nullptr, nullptr);
+ char* name = new char[cb];
+
+ WideCharToMultiByte(CP_UTF8, 0, w ,-1 ,name ,cb ,nullptr, nullptr);
+ char *ext = strrchr(name, '.');
+
+ auto t = create_task(file->OpenAsync(FileAccessMode::Read));
+
+ return t.then([this, file, ext](task<IRandomAccessStream^> task)
+ {
+ try
+ {
+ IRandomAccessStream^ readStream = task.get();
+ UINT64 const size = readStream->Size;
+
+ if (size <= MAXUINT32)
+ {
+ HRESULT code = this->mu_object.InitializeStream(readStream, ext);
+ return;
+ }
+ else
+ {
+ delete readStream;
+ return;
+ }
+ }
+ catch(COMException^ ex) {
+ /* Need to do something useful here */
+ throw ex;
+ }
+ });
+ });
+}
+
+/* Header info for bmp stream so that we can use the image brush */
+static void Prepare_bmp(int width, int height, DataWriter ^dw)
+{
+ int row_size = width * 4;
+ int bmp_size = row_size * height + 54;
+
+ dw->WriteString("BM");
+ dw->ByteOrder = ByteOrder::LittleEndian;
+ dw->WriteInt32(bmp_size);
+ dw->WriteInt16(0);
+ dw->WriteInt16(0);
+ dw->WriteInt32(54);
+ dw->WriteInt32(40);
+ dw->WriteInt32(width);
+ dw->WriteInt32(height);
+ dw->WriteInt16(1);
+ dw->WriteInt16(32);
+ dw->WriteInt32(0);
+ dw->WriteInt32(row_size * height);
+ dw->WriteInt32(2835);
+ dw->WriteInt32(2835);
+ dw->WriteInt32(0);
+ dw->WriteInt32(0);
+}
+
+/* Pack the page into a bmp stream so that we can use it with an image brush */
+Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
+ mudocument::RenderPage(int page_num, int width, int height)
+{
+ return create_async([this, width, height, page_num]() -> InMemoryRandomAccessStream^
+ {
+ /* Allocate space for bmp */
+ Array<unsigned char>^ bmp_data = ref new Array<unsigned char>(height * 4 * width);
+ /* Set up the memory stream */
+ InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+ DataWriter ^dw = ref new DataWriter(ras->GetOutputStreamAt(0));
+
+ /* Go ahead and write our header data into the memory stream */
+ Prepare_bmp(width, height, dw);
+
+ std::lock_guard<std::mutex> lock(mutex_lock);
+
+ /* Get raster bitmap stream */
+ HRESULT code = mu_object.RenderPage(page_num, width, height, &(bmp_data[0]));
+ if (code != S_OK)
+ {
+ throw ref new FailureException("Page Rendering Failed");
+ }
+ /* Now the data into the memory stream */
+ dw->WriteBytes(bmp_data);
+ DataWriterStoreOperation^ result = dw->StoreAsync();
+ /* Block on this Async call? */
+ while(result->Status != AsyncStatus::Completed) {
+ }
+ /* Return raster stream */
+ return ras;
+ });
+}
+
+int mudocument::ComputeLinks(int page_num)
+{
+ std::lock_guard<std::mutex> lock(mutex_lock);
+ /* We get back a standard smart pointer from muctx interface and go to WinRT
+ type here */
+ sh_vector_link link_smart_ptr_vec(new std::vector<sh_link>());
+ int num_items = mu_object.GetLinks(page_num, link_smart_ptr_vec);
+ if (num_items == 0)
+ return 0;
+ /* Pack into winRT type*/
+ this->links = ref new Platform::Collections::Vector<Links^>();
+ for (int k = 0; k < num_items; k++)
+ {
+ auto new_link = ref new Links();
+ sh_link muctx_link = link_smart_ptr_vec->at(k);
+ new_link->LowerRight = muctx_link->lower_right;
+ new_link->UpperLeft = muctx_link->upper_left;
+ new_link->PageNum = muctx_link->page_num;
+ new_link->Type = muctx_link->type;
+ if (new_link->Type == LINK_URI)
+ {
+ String^ str = char_to_String(muctx_link->uri.get());
+ // The URI to launch
+ new_link->Uri = ref new Windows::Foundation::Uri(str);
+ }
+ this->links->Append(new_link);
+ }
+ return num_items;
+}
+
+Links^ mudocument::GetLink(int k)
+{
+ if (k >= this->links->Size)
+ return nullptr;
+ return this->links->GetAt(k);
+}
+
+int mudocument::ComputeTextSearch(String^ text, int page_num)
+{
+ std::lock_guard<std::mutex> lock(mutex_lock);
+ /* We get back a standard smart pointer from muctx interface and go to WinRT
+ type here */
+ char* text_char = String_to_char(text);
+ sh_vector_text text_smart_ptr_vec(new std::vector<sh_text>());
+
+ int num_items = mu_object.GetTextSearch(page_num, text_char, text_smart_ptr_vec);
+ if (num_items == 0)
+ return 0;
+ /* Pack into winRT type*/
+ this->textsearch = ref new Platform::Collections::Vector<Links^>();
+ for (int k = 0; k < num_items; k++)
+ {
+ auto new_link = ref new Links();
+ sh_text muctx_text = text_smart_ptr_vec->at(k);
+ new_link->LowerRight = muctx_text->lower_right;
+ new_link->UpperLeft = muctx_text->upper_left;
+ new_link->Type = TEXTBOX;
+ this->textsearch->Append(new_link);
+ }
+ return num_items;
+}
+
diff --git a/winrt/mupdfwinrt/mudocument.h b/winrt/mupdfwinrt/mudocument.h
new file mode 100644
index 00000000..b315a18f
--- /dev/null
+++ b/winrt/mupdfwinrt/mudocument.h
@@ -0,0 +1,40 @@
+#pragma once
+
+/* This file contains the WinRT API interface between the muctx class which
+ implements the mupdf calls and the WinRT objects enabling calling from
+ C#, C++, Visual Basic, JavaScript applications */
+
+#include "muctx.h"
+#include "Links.h"
+#include "ppltasks.h"
+#include <winnt.h>
+#include <collection.h>
+
+using namespace Windows::Storage;
+using namespace Platform;
+using namespace Concurrency;
+using namespace Platform::Collections;
+
+namespace mupdfwinrt
+{
+ public ref class mudocument sealed
+ {
+
+ private:
+ muctx mu_object;
+ std::mutex mutex_lock;
+ Platform::Collections::Vector<Links^>^ links;
+ Platform::Collections::Vector<Links^>^ textsearch;
+ public:
+ mudocument();
+ Windows::Foundation::IAsyncAction^ OpenFile(StorageFile^ file);
+ int GetNumPages();
+ Point GetPageSize(int page_num);
+ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
+ RenderPage(int page_num, int width, int height);
+ int ComputeLinks(int page_num);
+ Links^ GetLink(int k);
+ int ComputeTextSearch(String^ text, int page_num);
+
+ };
+} \ No newline at end of file
diff --git a/winrt/mupdfwinrt/mupdfwinrt.vcxproj b/winrt/mupdfwinrt/mupdfwinrt.vcxproj
new file mode 100644
index 00000000..5e8892be
--- /dev/null
+++ b/winrt/mupdfwinrt/mupdfwinrt.vcxproj
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9e6ab41d-09a7-45a6-a53b-1e4bf3ac5b33}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <ProjectName>mupdfwinrt</ProjectName>
+ <RootNamespace>mupdfwinrt</RootNamespace>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <AppContainerApplication>true</AppContainerApplication>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <GenerateManifest>false</GenerateManifest>
+ <OutDir>..\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>..\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <GenerateManifest>false</GenerateManifest>
+ <OutDir>$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalIncludeDirectories>../../xps/;../../pdf/;../../fitz/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalIncludeDirectories>../../xps/;../../pdf/;../../fitz/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;../../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="Links.h" />
+ <ClInclude Include="muctx.h" />
+ <ClInclude Include="pch.h" />
+ <ClInclude Include="mudocument.h" />
+ <ClInclude Include="utils.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Links.cpp" />
+ <ClCompile Include="muctx.cpp" />
+ <ClCompile Include="pch.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="mudocument.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters b/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters
new file mode 100644
index 00000000..c00d9539
--- /dev/null
+++ b/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Resources">
+ <UniqueIdentifier>16ec6626-1276-4cf1-b7af-8d28de2c8f75</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="pch.cpp" />
+ <ClCompile Include="mudocument.cpp" />
+ <ClCompile Include="muctx.cpp" />
+ <ClCompile Include="Links.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="pch.h" />
+ <ClInclude Include="mudocument.h" />
+ <ClInclude Include="muctx.h" />
+ <ClInclude Include="Links.h" />
+ <ClInclude Include="utils.h" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/winrt/mupdfwinrt/pch.cpp b/winrt/mupdfwinrt/pch.cpp
new file mode 100644
index 00000000..01484ff5
--- /dev/null
+++ b/winrt/mupdfwinrt/pch.cpp
@@ -0,0 +1,6 @@
+//
+// pch.cpp
+// Include the standard header and generate the precompiled header.
+//
+
+#include "pch.h"
diff --git a/winrt/mupdfwinrt/pch.h b/winrt/mupdfwinrt/pch.h
new file mode 100644
index 00000000..f815ac97
--- /dev/null
+++ b/winrt/mupdfwinrt/pch.h
@@ -0,0 +1,6 @@
+//
+// pch.h
+// Header for standard system include files.
+//
+
+#pragma once
diff --git a/winrt/mupdfwinrt/utils.h b/winrt/mupdfwinrt/utils.h
new file mode 100644
index 00000000..7485ee47
--- /dev/null
+++ b/winrt/mupdfwinrt/utils.h
@@ -0,0 +1,8 @@
+#pragma once
+
+typedef enum {
+ LINK_GOTO = 0,
+ LINK_URI,
+ TEXTBOX, /* Do double duty with this class */
+ NOT_SET,
+} link_t; \ No newline at end of file
diff --git a/winrt/winapp/MainPage.xaml b/winrt/winapp/MainPage.xaml
index d7feaeac..011bd8d7 100644
--- a/winrt/winapp/MainPage.xaml
+++ b/winrt/winapp/MainPage.xaml
@@ -6,7 +6,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
- <Page.BottomAppBar>
+
+ <Page.BottomAppBar>
<AppBar>
<Grid Margin="38,0,0,0">
<Grid.ColumnDefinitions>
@@ -19,14 +20,13 @@
</AppBar>
</Page.BottomAppBar>
<Page.TopAppBar>
- <AppBar x:Name="TopAppBar1" AutomationProperties.Name="Top App Bar">
+ <AppBar x:Name="TopAppBar1" AutomationProperties.Name="Top App Bar" Loaded="topAppBar_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel x:Name="LeftPanel" Orientation="Horizontal">
-
</StackPanel>
<StackPanel x:Name="RightPanel" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="Search" Style="{StaticResource SearchAppBarButtonStyle}" Tag="Search" Click="Searcher"/>
@@ -38,6 +38,7 @@
</Grid>
</AppBar>
</Page.TopAppBar>
+
<Grid x:Name="xaml_OutsideGrid">
<Grid.Background>
<LinearGradientBrush EndPoint="-0.074,-0.068" StartPoint="1.027,1.024">
@@ -112,4 +113,4 @@
</RichEditBox>
</StackPanel>
</Grid>
- </Page>
+</Page>
diff --git a/winrt/winapp/MainPage.xaml.cpp b/winrt/winapp/MainPage.xaml.cpp
index e93682f7..a649d1e5 100644
--- a/winrt/winapp/MainPage.xaml.cpp
+++ b/winrt/winapp/MainPage.xaml.cpp
@@ -105,19 +105,6 @@ MainPage::MainPage()
ctx = fz_new_context(NULL, NULL, 128<<20);
}
-void run_async_non_interactive(std::function<void ()>&& action)
-{
- Windows::UI::Core::CoreWindow^ wnd = Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow;
- assert(wnd != nullptr);
-
- wnd->Dispatcher->RunAsync(
- Windows::UI::Core::CoreDispatcherPriority::Low,
- ref new Windows::UI::Core::DispatchedHandler([action]()
- {
- action();
- }));
-}
-
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
@@ -128,9 +115,69 @@ void MainPage::OnNavigatedTo(NavigationEventArgs^ e)
(void) e; // Unused parameter
}
+void winapp::MainPage::ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command)
+{
+
+}
+
+void winapp::MainPage::OKInvokedHandler(Windows::UI::Popups::IUICommand^ command)
+{
+
+}
+
+void winapp::MainPage::NotifyUser(String^ strMessage, NotifyType_t type)
+{
+ MessageDialog^ msg = ref new MessageDialog(strMessage);
+ UICommand^ ExitCommand = nullptr;
+ UICommand^ OKCommand = nullptr;
+
+ switch (type)
+ {
+ case StatusMessage:
+ OKCommand = ref new UICommand("OK",
+ ref new UICommandInvokedHandler(this, &winapp::MainPage::OKInvokedHandler));
+ msg->Commands->Append(OKCommand);
+ /// Set the command that will be invoked by default
+ msg->DefaultCommandIndex = 0;
+ // Set the command to be invoked when escape is pressed
+ msg->CancelCommandIndex = 1;
+ break;
+ case ErrorMessage:
+ ExitCommand = ref new UICommand("Exit",
+ ref new UICommandInvokedHandler(this, &winapp::MainPage::ExitInvokedHandler));
+ msg->Commands->Append(ExitCommand);
+ /// Set the command that will be invoked by default
+ msg->DefaultCommandIndex = 0;
+ // Set the command to be invoked when escape is pressed
+ msg->CancelCommandIndex = 1;
+ break;
+ default:
+ break;
+ }
+ // Show the message dialog
+ msg->ShowAsync();
+}
+
+bool winapp::MainPage::EnsureUnsnapped()
+{
+ // FilePicker APIs will not work if the application is in a snapped state.
+ // If an app wants to show a FilePicker while snapped, it must attempt to unsnap first
+
+ bool unsnapped = (ApplicationView::Value != ApplicationViewState::Snapped ||
+ ApplicationView::TryUnsnap());
+ if (!unsnapped)
+ {
+ NotifyUser("Cannot unsnap the application", StatusMessage);
+ }
+ return unsnapped;
+}
+
void winapp::MainPage::Picker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
- FileOpenPicker^ openPicker = ref new FileOpenPicker();
+ if (!EnsureUnsnapped())
+ return;
+
+ FileOpenPicker^ openPicker = ref new FileOpenPicker();
openPicker->ViewMode = PickerViewMode::List;
openPicker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
openPicker->FileTypeFilter->Append(".pdf");
@@ -414,12 +461,8 @@ static void win_close_file(fz_context *ctx, void *state)
delete dataReader;
}
-void PixToMemStream(fz_pixmap *pix, DataWriter ^dw, Platform::Array<unsigned char> ^arr)
+void PixToMemStream(DataWriter ^dw, Platform::Array<unsigned char> ^arr)
{
- unsigned char *samples = fz_pixmap_samples(ctx, pix);
- int w = fz_pixmap_width(ctx, pix);
- int h = fz_pixmap_height(ctx, pix);
-
/* Write the data */
dw->WriteBytes(arr);
@@ -492,7 +535,7 @@ InMemoryRandomAccessStream^ RenderBitMap(fz_document *doc, fz_page *page, int *w
fz_run_page(doc, page, dev, pctm, NULL);
fz_free_device(dev);
/* Now the data into the memory stream */
- PixToMemStream(pix, dw, bmp_data);
+ PixToMemStream(dw, bmp_data);
/* Return raster stream */
return ras;
}
@@ -599,7 +642,7 @@ void winapp::MainPage::CleanUp()
fz_close_document(m_doc);
this->m_curr_flipView = nullptr;
- m_currpage = 0;
+ m_currpage = -1;
m_file_open = false;
m_doc = NULL;
m_slider_min = 0;
@@ -1233,6 +1276,12 @@ void winapp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::Rou
}
else if (leftPanel != nullptr && !m_insearch)
{
+ /* Search is not going to work in snapped view for now to simplify UI
+ in this cramped case. So see if we can get out of snapped mode. */
+
+ if (!EnsureUnsnapped())
+ return;
+
m_insearch = true;
Windows::UI::Xaml::Controls::Button^ PrevButton = ref new Button();
PrevButton->Style = safe_cast<Windows::UI::Xaml::Style^>(App::Current->Resources->Lookup("PreviousAppBarButtonStyle"));
@@ -1499,6 +1548,12 @@ void winapp::MainPage::GridSizeChanged()
int width = this->ActualWidth;
FlipView^ old_flip = m_curr_flipView;
+
+ if (TopAppBar1->IsOpen)
+ {
+ UpdateAppBarButtonViewState();
+ }
+
if (m_zoom_mode)
{
Canvas_Double(nullptr, nullptr);
@@ -1969,3 +2024,20 @@ void winapp::MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::Rou
}, task_continuation_context::use_current());
}
}
+
+/* Need to handle resizing of app bar to make sure everything fits */
+
+void winapp::MainPage::topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ UpdateAppBarButtonViewState();
+}
+
+void winapp::MainPage::UpdateAppBarButtonViewState()
+{
+ String ^viewState = Windows::UI::ViewManagement::ApplicationView::Value.ToString();
+ VisualStateManager::GoToState(Search, viewState, true);
+ VisualStateManager::GoToState(Contents, viewState, true);
+ VisualStateManager::GoToState(Links, viewState, true);
+ VisualStateManager::GoToState(Reflow, viewState, true);
+ VisualStateManager::GoToState(Help, viewState, true);
+} \ No newline at end of file
diff --git a/winrt/winapp/MainPage.xaml.h b/winrt/winapp/MainPage.xaml.h
index 3b1b1530..47e1bfab 100644
--- a/winrt/winapp/MainPage.xaml.h
+++ b/winrt/winapp/MainPage.xaml.h
@@ -30,6 +30,15 @@ using namespace Windows::UI::Xaml::Shapes;
using namespace Windows::Foundation::Collections;
using namespace Platform::Collections;
using namespace ListViewContents;
+using namespace Windows::UI::ViewManagement;
+using namespace Windows::UI::Popups;
+using namespace Windows::UI::Xaml::Navigation;
+
+typedef enum
+{
+ StatusMessage,
+ ErrorMessage
+} NotifyType_t;
typedef enum {
REN_AVAILABLE = 0,
@@ -126,6 +135,7 @@ namespace winapp
cancellation_token_source m_ThumbCancel;
fz_link *m_links;
content_t m_content;
+ TextBlock^ m_StatusBlock;
bool m_zoom_mode;
bool m_from_doubleflip;
bool m_scaling_occured;
@@ -193,5 +203,11 @@ namespace winapp
void RichGridManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
void RichGridManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
void RichGridManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
+ void topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void UpdateAppBarButtonViewState();
+ bool EnsureUnsnapped();
+ void NotifyUser(String^ strMessage, NotifyType_t type);
+ void ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command);
+ void OKInvokedHandler(Windows::UI::Popups::IUICommand^ command);
};
}
diff --git a/winrt/winapp/winapp.vcxproj b/winrt/winapp/winapp.vcxproj
index 49bf0062..27030488 100644
--- a/winrt/winapp/winapp.vcxproj
+++ b/winrt/winapp/winapp.vcxproj
@@ -222,7 +222,7 @@
<ClCompile>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
- <AdditionalIncludeDirectories>../../xps/;../../fitz/;../../pdf/;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../fitz/;../../pdf/;../../xps/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib</AdditionalDependencies>