summaryrefslogtreecommitdiff
path: root/platform/winrt
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2013-12-12 09:49:06 -0800
committerRobin Watts <robin.watts@artifex.com>2013-12-14 10:55:49 +0000
commit2380744fddfe7d47d07a175fb3a55d0b22af1eb2 (patch)
tree51a0cf207282cec5fe0b201b2d5171025f4b6f75 /platform/winrt
parent18913a6c295fc3de9f8e1da1faf79cd60a878152 (diff)
downloadmupdf-2380744fddfe7d47d07a175fb3a55d0b22af1eb2.tar.xz
Add in error trapping. Fix warnings. Remove Win8 deprecated calls. Fix issues with surface thumb rendering.
Also, make updates for changes made to font names and 3rd party file structures.
Diffstat (limited to 'platform/winrt')
-rw-r--r--platform/winrt/generate.bat2
-rw-r--r--platform/winrt/generated.vcxproj.filters6
-rw-r--r--platform/winrt/libmupdf-nov8_winRT.vcxproj18
-rw-r--r--platform/winrt/libmupdf_winRT.vcxproj18
-rw-r--r--platform/winrt/libthirdparty_winRT.vcxproj136
-rw-r--r--platform/winrt/libthirdparty_winRT.vcxproj.filters327
-rw-r--r--platform/winrt/mupdf_cpp/Common/StandardStyles.xaml2
-rw-r--r--platform/winrt/mupdf_cpp/MainPage.xaml33
-rw-r--r--platform/winrt/mupdf_cpp/MainPage.xaml.cpp669
-rw-r--r--platform/winrt/mupdf_cpp/MainPage.xaml.h39
-rw-r--r--platform/winrt/mupdf_cpp/PrintPage.cpp2
-rw-r--r--platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj1
-rw-r--r--platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters1
-rw-r--r--platform/winrt/mupdfwinrt/muctx.cpp33
-rw-r--r--platform/winrt/mupdfwinrt/muctx.h4
-rw-r--r--platform/winrt/mupdfwinrt/mudocument.cpp103
-rw-r--r--platform/winrt/mupdfwinrt/mudocument.h12
-rw-r--r--platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj1
-rw-r--r--platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters1
-rw-r--r--platform/winrt/mupdfwinrt/status.h6
20 files changed, 860 insertions, 554 deletions
diff --git a/platform/winrt/generate.bat b/platform/winrt/generate.bat
index 681eaf66..0615a5fb 100644
--- a/platform/winrt/generate.bat
+++ b/platform/winrt/generate.bat
@@ -14,7 +14,7 @@ if not exist cmapdump.exe goto usage
if not exist cquote.exe goto usage
if not exist bin2hex.exe goto usage
-if not exist generated/gen_font_base14.h fontdump.exe generated/gen_font_base14.h resources/fonts/*.cff
+if not exist generated/gen_font_base14.h fontdump.exe generated/gen_font_base14.h resources/fonts/urw/*.cff
if not exist generated/gen_font_droid.h fontdump.exe generated/gen_font_droid.h resources/fonts/droid/DroidSans.ttf resources/fonts/droid/DroidSansMono.ttf
if not exist generated/gen_font_cjk.h fontdump.exe generated/gen_font_cjk.h resources/fonts/droid/DroidSansFallback.ttf
if not exist generated/gen_font_cjk_full.h fontdump.exe generated/gen_font_cjk_full.h resources/fonts/droid/DroidSansFallbackFull.ttf
diff --git a/platform/winrt/generated.vcxproj.filters b/platform/winrt/generated.vcxproj.filters
index 79c6c9d3..94e3a8e0 100644
--- a/platform/winrt/generated.vcxproj.filters
+++ b/platform/winrt/generated.vcxproj.filters
@@ -38,9 +38,6 @@
<ClInclude Include="..\..\generated\gen_cmap_korea.h">
<Filter>generated</Filter>
</ClInclude>
- <ClInclude Include="..\..\generated\gen_font_base14.h">
- <Filter>generated</Filter>
- </ClInclude>
<ClInclude Include="..\..\generated\gen_font_cjk.h">
<Filter>generated</Filter>
</ClInclude>
@@ -53,6 +50,9 @@
<ClInclude Include="..\..\generated\gen_js_util.h">
<Filter>generated</Filter>
</ClInclude>
+ <ClInclude Include="..\..\generated\gen_font_base14.h">
+ <Filter>generated</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="generate.bat" />
diff --git a/platform/winrt/libmupdf-nov8_winRT.vcxproj b/platform/winrt/libmupdf-nov8_winRT.vcxproj
index 6cb6b4d6..373999a6 100644
--- a/platform/winrt/libmupdf-nov8_winRT.vcxproj
+++ b/platform/winrt/libmupdf-nov8_winRT.vcxproj
@@ -181,7 +181,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -194,7 +194,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -207,7 +207,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -220,7 +220,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -233,7 +233,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -246,7 +246,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -259,7 +259,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -272,7 +272,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -285,7 +285,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\include;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
diff --git a/platform/winrt/libmupdf_winRT.vcxproj b/platform/winrt/libmupdf_winRT.vcxproj
index 76fa65a7..78fae974 100644
--- a/platform/winrt/libmupdf_winRT.vcxproj
+++ b/platform/winrt/libmupdf_winRT.vcxproj
@@ -366,7 +366,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -380,7 +380,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MEMENTO=1;DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -394,7 +394,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -409,7 +409,7 @@
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -423,7 +423,7 @@
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MEMENTO=1;DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -436,7 +436,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -450,7 +450,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -464,7 +464,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MEMENTO=1;DEBUG=1;_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -478,7 +478,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\src\lib\openjp2;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
diff --git a/platform/winrt/libthirdparty_winRT.vcxproj b/platform/winrt/libthirdparty_winRT.vcxproj
index 1def5f1b..9d3a762a 100644
--- a/platform/winrt/libthirdparty_winRT.vcxproj
+++ b/platform/winrt/libthirdparty_winRT.vcxproj
@@ -106,31 +106,31 @@
<ClCompile Include="..\..\thirdparty\jpeg\jquant1.c" />
<ClCompile Include="..\..\thirdparty\jpeg\jquant2.c" />
<ClCompile Include="..\..\thirdparty\jpeg\jutils.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\bio.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cidx_manager.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cio.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\dwt.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\event.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\function_list.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\image.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\invert.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\j2k.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\jp2.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mct.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mqc.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\openjpeg.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_clock.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\phix_manager.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\pi.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\ppix_manager.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\raw.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1_generate_luts.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t2.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tcd.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tgt.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\thix_manager.c" />
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tpix_manager.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\bio.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\cidx_manager.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\cio.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\dwt.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\event.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\function_list.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\image.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\invert.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k_lib.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\jp2.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\mct.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\mqc.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\openjpeg.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\phix_manager.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\pi.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\ppix_manager.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\raw.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t1.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t1_generate_luts.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t2.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tcd.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tgt.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\thix_manager.c" />
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tpix_manager.c" />
<ClCompile Include="..\..\thirdparty\zlib\adler32.c" />
<ClCompile Include="..\..\thirdparty\zlib\compress.c" />
<ClCompile Include="..\..\thirdparty\zlib\crc32.c" />
@@ -229,33 +229,37 @@
<ClInclude Include="..\..\thirdparty\freetype\include\freetype\tttags.h" />
<ClInclude Include="..\..\thirdparty\freetype\include\freetype\ttunpat.h" />
<ClInclude Include="..\..\thirdparty\freetype\include\ft2build.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\bio.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cidx_manager.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cio.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\dwt.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\event.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\function_list.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\image.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\indexbox_manager.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\invert.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\j2k.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\jp2.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mct.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mqc.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\openjpeg.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_clock.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_includes.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_intmath.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_inttypes.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_malloc.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_stdint.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\pi.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\raw.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1_luts.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t2.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tcd.h" />
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tgt.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\bio.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\cidx_manager.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\cio.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\dwt.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\event.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\fix.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\function_list.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\image.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\indexbox_manager.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\int.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\invert.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k_lib.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\jp2.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\mct.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\mqc.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\openjpeg.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_config.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_config_private.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_includes.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_intmath.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_inttypes.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_malloc.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_stdint.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\pi.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\raw.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t1.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t1_luts.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t2.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\tcd.h" />
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\tgt.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{c0d1c355-1bee-40e1-9ef4-fd9fffdbf396}</ProjectGuid>
@@ -397,8 +401,8 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -411,7 +415,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -425,8 +429,8 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -441,8 +445,8 @@
<SDLCheck>false</SDLCheck>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -457,7 +461,7 @@
<SDLCheck>false</SDLCheck>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -471,8 +475,8 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -485,7 +489,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -499,7 +503,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@@ -513,8 +517,8 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<SDLCheck>false</SDLCheck>
- <AdditionalIncludeDirectories>..\..\scripts;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NO_GETENV;_WINRT;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;OPJ_STATIC;FT_CONFIG_MODULES_H="slimftmodules.h";FT_CONFIG_OPTIONS_H="slimftoptions.h";DEBUG=1;verbose=-1;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
diff --git a/platform/winrt/libthirdparty_winRT.vcxproj.filters b/platform/winrt/libthirdparty_winRT.vcxproj.filters
index 77a768da..4817befe 100644
--- a/platform/winrt/libthirdparty_winRT.vcxproj.filters
+++ b/platform/winrt/libthirdparty_winRT.vcxproj.filters
@@ -25,9 +25,6 @@
<Filter Include="libz">
<UniqueIdentifier>{5e55ef18-6449-49c1-99aa-1cd88b6f4453}</UniqueIdentifier>
</Filter>
- <Filter Include="libopenjpeg\openjp2">
- <UniqueIdentifier>{3a31ee2f-bdac-4091-a83f-7a6236269aaf}</UniqueIdentifier>
- </Filter>
<Filter Include="libfreetype\include\freetype\config">
<UniqueIdentifier>{289ce62d-7110-4e8b-8045-72a557f8e6c0}</UniqueIdentifier>
</Filter>
@@ -39,81 +36,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\bio.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cidx_manager.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cio.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\dwt.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\event.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\function_list.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\image.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\invert.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\j2k.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\jp2.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mct.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mqc.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\openjpeg.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_clock.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\phix_manager.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\pi.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\ppix_manager.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\raw.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1_generate_luts.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t2.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tcd.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tgt.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\thix_manager.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
- <ClCompile Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tpix_manager.c">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClCompile>
<ClCompile Include="..\..\thirdparty\freetype\src\base\ftstroke.c">
<Filter>libfreetype\base</Filter>
</ClCompile>
@@ -345,89 +267,83 @@
<ClCompile Include="..\..\thirdparty\zlib\uncompr.c">
<Filter>libz</Filter>
</ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\bio.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\cidx_manager.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\cio.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\dwt.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\event.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\function_list.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\image.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\invert.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k_lib.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\jp2.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\mct.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\mqc.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\openjpeg.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\phix_manager.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\pi.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\ppix_manager.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\raw.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t1.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t1_generate_luts.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\t2.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tcd.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tgt.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\thix_manager.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\thirdparty\openjpeg\libopenjpeg\tpix_manager.c">
+ <Filter>libopenjpeg</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\bio.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cidx_manager.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\cio.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\dwt.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\event.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\function_list.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\image.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\indexbox_manager.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\invert.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\j2k.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\jp2.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mct.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\mqc.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\openjpeg.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_clock.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_includes.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_intmath.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_inttypes.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_malloc.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\opj_stdint.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\pi.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\raw.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t1_luts.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\t2.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tcd.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
- <ClInclude Include="..\..\thirdparty\openjpeg\src\lib\openjp2\tgt.h">
- <Filter>libopenjpeg\openjp2</Filter>
- </ClInclude>
<ClInclude Include="..\..\thirdparty\freetype\include\ft2build.h">
<Filter>libfreetype\include</Filter>
</ClInclude>
@@ -686,5 +602,98 @@
<ClInclude Include="..\..\thirdparty\freetype\include\freetype\internal\ftpic.h">
<Filter>libfreetype\include\freetype\internal</Filter>
</ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\bio.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\cidx_manager.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\cio.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\dwt.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\event.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\fix.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\function_list.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\image.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\indexbox_manager.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\int.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\invert.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\j2k_lib.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\jp2.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\mct.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\mqc.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\openjpeg.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_config.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_config_private.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_includes.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_intmath.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_inttypes.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_malloc.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\opj_stdint.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\pi.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\raw.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t1.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t1_luts.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\t2.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\tcd.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\thirdparty\openjpeg\libopenjpeg\tgt.h">
+ <Filter>libopenjpeg</Filter>
+ </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/platform/winrt/mupdf_cpp/Common/StandardStyles.xaml b/platform/winrt/mupdf_cpp/Common/StandardStyles.xaml
index 771d773c..ed4b0ec2 100644
--- a/platform/winrt/mupdf_cpp/Common/StandardStyles.xaml
+++ b/platform/winrt/mupdf_cpp/Common/StandardStyles.xaml
@@ -452,7 +452,7 @@
</Style>
<Style x:Key="ReflowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ReflowAppBarButton"/>
- <Setter Property="AutomationProperties.Name" Value="Reflow"/>
+ <Setter Property="AutomationProperties.Name" Value="TextExtract"/>
<Setter Property="Content" Value="&#xE18B;"/>
</Style>
<Style x:Key="ZoomInAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml b/platform/winrt/mupdf_cpp/MainPage.xaml
index 30403229..42296f6a 100644
--- a/platform/winrt/mupdf_cpp/MainPage.xaml
+++ b/platform/winrt/mupdf_cpp/MainPage.xaml
@@ -27,9 +27,9 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel x:Name="LeftPanel" Orientation="Horizontal" HorizontalAlignment="Left" >
- <TextBox x:Name="FindBox" Width="200" Height="20" Visibility="Collapsed"/>
- <Button x:Name="PrevSearch" Style="{StaticResource PreviousAppBarButtonStyle}" Visibility="Collapsed" Click="SearchPrev"/>
- <Button x:Name="NextSearch" Style="{StaticResource NextAppBarButtonStyle}" Visibility="Collapsed" Click="SearchNext"/>
+ <TextBox x:Name="FindBox" Width="200" Height="20" Margin="2"/>
+ <Button x:Name="PrevSearch" Style="{StaticResource PreviousAppBarButtonStyle}" Click="SearchPrev"/>
+ <Button x:Name="NextSearch" Style="{StaticResource NextAppBarButtonStyle}" Click="SearchNext"/>
</StackPanel>
<StackPanel x:Name="RightPanel" Orientation="Horizontal" HorizontalAlignment="Right">
@@ -184,7 +184,7 @@
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}" IsTapEnabled="True" Tapped="LinkTapped">
+ <Rectangle Tag="{Binding Path=Index}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}" IsTapEnabled="True" Tapped="LinkTapped">
<Rectangle.RenderTransform>
<TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
</Rectangle.RenderTransform>
@@ -207,7 +207,7 @@
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}">
+ <Rectangle Tag="{Binding Path=Index}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}" IsTapEnabled="True" Tapped="LinkTapped">
<Rectangle.RenderTransform>
<TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
</Rectangle.RenderTransform>
@@ -238,6 +238,15 @@
</ListView.Background>
</ListView>
</Grid>
+
+ <!-- Note that windows webview does not reflow when we scale. It
+ will only do this with a size change. Unfortunately, the webview
+ object is special in that it intercepts all actions and passes
+ nothing to the application for these manipulations. I tried
+ various things including the use of a webview brush to
+ capture the current webview but that is a complex issue since
+ it is a static image in that case. The other option would
+ be to go to a Rich Text type of view. -->
<WebView x:Name="xaml_WebView" HorizontalAlignment="Stretch" Width="Auto" Height="Auto"
VerticalAlignment="Stretch" Visibility="Collapsed"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
@@ -260,6 +269,20 @@
</Border>
</StackPanel>
+ <StackPanel x:Name="xaml_PrintStack" Opacity="1" VerticalAlignment="Center" Margin="0,15" HorizontalAlignment="Center" Visibility="Collapsed">
+ <Border BorderThickness="5" BorderBrush="Black" >
+ <StackPanel Background="LightGray" HorizontalAlignment="Left" Width="756" >
+ <TextBlock HorizontalAlignment="Center" Margin="10"
+ Text="Print Progress" FontSize="20"/>
+ <ProgressBar x:Name="xaml_PrintProgress" Margin="5" Height="15"
+ IsIndeterminate="False" Maximum="100" VerticalAlignment="Stretch" />
+ <Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10" Click="HideProgress" Height="39">
+ <TextBlock HorizontalAlignment="Center" Text="Hide"/>
+ </Button>
+ </StackPanel>
+ </Border>
+ </StackPanel>
+
<StackPanel x:Name="xaml_PasswordStack" Opacity="1" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed">
<Border BorderThickness="5" BorderBrush="Black" >
<StackPanel Background="LightGray" >
diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp
index 3a2fbdc3..c3c8c576 100644
--- a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp
+++ b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp
@@ -27,7 +27,9 @@
#define ZOOM_IN 0
#define ZOOM_OUT 1
-#define PRINTPREVIEWDPI 96;
+#define SEARCH_FIT 672
+#define VS_LARGE 1366
+#define VS_SMALL 500
static float screenScale = 1;
@@ -41,6 +43,7 @@ using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::Graphics::Display;
using namespace Windows::Graphics::Printing;
+using namespace Windows::UI::Core;
//****************** Added *****************
using namespace Windows::Storage::Pickers;
@@ -95,6 +98,10 @@ MainPage::MainPage()
m_page_link_list = ref new Platform::Collections::Vector<IVector<RectList^>^>();
m_text_list = ref new Platform::Collections::Vector<RectList^>();
m_linkset = ref new Platform::Collections::Vector<int>();
+ if (m_docPages == nullptr || m_thumbnails == nullptr ||
+ m_page_link_list == nullptr || m_text_list == nullptr ||
+ m_linkset == nullptr)
+ throw ref new FailureException("Document allocation failed!");
SetUpDirectX();
RegisterForPrinting();
@@ -174,9 +181,9 @@ void MainPage::ExceptionHandler(Object^ sender, UnhandledExceptionEventArgs^ e)
if (!this->m_init_done)
{
/* Windows 8.1 has some weird issues that occur before we have even tried
- to open a document. For example rolling the mouse wheel throws an
- exception in 8.1 but not 8.0. This is clearly a windows issue. For
- now mark as handled and move on which seems to be fine */
+ to open a document. For example rolling the mouse wheel throws an
+ exception in 8.1 but not 8.0. This is clearly a windows issue. For
+ now mark as handled and move on which seems to be fine */
e->Handled = true;
}
else
@@ -234,28 +241,11 @@ void MainPage::NotifyUser(String^ strMessage, int type)
msg->ShowAsync();
}
-bool 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 MainPage::Picker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
- if (!EnsureUnsnapped())
- return;
-
/* If we are actively rendering a document to the print thread then notify the
- user that they will need to wait */
- if (m_print_active)
+ user that they will need to wait */
+ if (m_print_active == PRINT_ACTIVE)
{
int total_pages = GetPrintPageCount();
auto str1 = "Cannot open new file. Currently rendering page " +
@@ -291,21 +281,35 @@ void MainPage::UpdatePage(int page_num, InMemoryRandomAccessStream^ ras,
{
assert(IsMainThread());
- WriteableBitmap ^bmp = ref new WriteableBitmap(ras_size.X, ras_size.Y);
+ WriteableBitmap ^bmp = ref new WriteableBitmap((int)ras_size.X, (int) ras_size.Y);
+ if (bmp == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("BMP UpdatePage Failed Page " + page_num, ErrorMessage);
+#endif
+ return;
+ }
bmp->SetSource(ras);
DocumentPage^ doc_page = ref new DocumentPage();
+ if (doc_page == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("doc_page UpdatePage Failed Page " + page_num, ErrorMessage);
+#endif
+ return;
+ }
doc_page->Image = bmp;
if (content_type == THUMBNAIL)
{
- doc_page->Height = ras_size.Y / SCALE_THUMB;
- doc_page->Width = ras_size.X / SCALE_THUMB;
+ doc_page->Height = (int) (ras_size.Y / SCALE_THUMB);
+ doc_page->Width = (int) (ras_size.X / SCALE_THUMB);
}
else
{
- doc_page->Height = ras_size.Y;
- doc_page->Width = ras_size.X;
+ doc_page->Height = (int) ras_size.Y;
+ doc_page->Width = (int) ras_size.X;
}
doc_page->Content = content_type;
doc_page->PageZoom = zoom_in;
@@ -322,22 +326,48 @@ void MainPage::ReplaceImage(int page_num, InMemoryRandomAccessStream^ ras,
{
assert(IsMainThread());
- WriteableBitmap ^bmp = ref new WriteableBitmap(ras_size.X, ras_size.Y);
- bmp->SetSource(ras);
+ WriteableBitmap ^bmp = ref new WriteableBitmap((int) ras_size.X, (int) ras_size.Y);
+ if (bmp == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("BMP ReplaceImage Failed Page " + page_num, ErrorMessage);
+#endif
+ return;
+ }
+ bmp->SetSource(ras);
DocumentPage^ doc_page = this->m_docPages->GetAt(page_num);
+ if (doc_page == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("doc_page ReplaceImage Failed Page " + page_num, ErrorMessage);
+#endif
+ return;
+ }
doc_page->Image = bmp;
-
- doc_page->Height = ras_size.Y;
- doc_page->Width = ras_size.X;
+ doc_page->Height = (int) ras_size.Y;
+ doc_page->Width = (int) ras_size.X;
doc_page->PageZoom = page_zoom;
}
-Point MainPage::ComputePageSize(spatial_info_t spatial_info, int page_num)
+int MainPage::ComputePageSize(spatial_info_t spatial_info, int page_num,
+ Point *point)
{
Point screenSize;
Point pageSize;
- Point size = mu_doc->GetPageSize(page_num);
+ Point size;
+
+ try
+ {
+ size = mu_doc->GetPageSize(page_num);
+ }
+ catch (Exception ^except)
+ {
+#ifdef _DEBUG
+ NotifyUser(except->Message, ErrorMessage);
+#endif
+ return E_FAILURE;
+ }
screenSize = spatial_info.size;
screenSize.Y *= screenScale;
@@ -346,10 +376,11 @@ Point MainPage::ComputePageSize(spatial_info_t spatial_info, int page_num)
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;
+ pageSize.X = (float) (size.X * scale * spatial_info.scale_factor);
+ pageSize.Y = (float) (size.Y * scale * spatial_info.scale_factor);
- return pageSize;
+ *point = pageSize;
+ return S_ISOK;
}
static Point fitPageToScreen(Point page, Point screen)
@@ -369,8 +400,8 @@ spatial_info_t MainPage::InitSpatial(double scale)
{
spatial_info_t value;
- value.size.Y = this->ActualHeight;
- value.size.X = this->ActualWidth;
+ value.size.Y = (float) (this->ActualHeight);
+ value.size.X = (float) (this->ActualWidth);
value.scale_factor = scale;
return value;
@@ -411,7 +442,7 @@ void MainPage::ReleasePages(int old_page, int new_page)
{
if (k >= 0 && k < this->m_num_pages)
{
- SetThumb(k, true);
+ SetThumb(k);
}
}
}
@@ -419,34 +450,75 @@ void MainPage::ReleasePages(int old_page, int new_page)
/* 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)
+void MainPage::SetThumb(unsigned int page_num)
{
/* See what is there now */
auto doc = this->m_docPages->GetAt(page_num);
- if (doc->Content == THUMBNAIL) return;
- if (doc->Content == FULL_RESOLUTION && replace == false) return;
+ if (doc->Content == THUMBNAIL && doc->PageZoom == m_doczoom) return;
if (this->m_thumbnails->Size > page_num)
{
m_page_update = true;
auto thumb_page = this->m_thumbnails->GetAt(page_num);
- thumb_page->Height = thumb_page->NativeHeight * m_doczoom;
- thumb_page->Width = thumb_page->NativeWidth * m_doczoom;
+ thumb_page->Height = (int)(thumb_page->NativeHeight * m_doczoom);
+ thumb_page->Width = (int)(thumb_page->NativeWidth * m_doczoom);
+ thumb_page->PageZoom = 1.0;
this->m_docPages->SetAt(page_num, thumb_page);
m_page_update = false;
}
}
+/* Initializes the flipview items with the thumb pages as they become
+ available */
+void MainPage::SetThumbInit(unsigned int page_num)
+{
+ /* See what is there now */
+ auto doc = this->m_docPages->GetAt(page_num);
+ if (doc->Content == THUMBNAIL || doc->Content == FULL_RESOLUTION) return;
+
+ if (this->m_thumbnails->Size > page_num)
+ {
+ doc->Content = THUMBNAIL;
+ auto thumb_page = this->m_thumbnails->GetAt(page_num);
+ thumb_page->Height = (int)(thumb_page->NativeHeight);
+ thumb_page->Width = (int)(thumb_page->NativeWidth);
+ doc->Image = thumb_page->Image;
+ doc->Height = thumb_page->Height;
+ doc->Width = thumb_page->Width;
+ doc->PageZoom = 1.0;
+ }
+}
+
/* Create white image for us to use as place holder in large document for flip
- view filling instead of the thumbnail image */
+ 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);
+ if (bmp_data == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("CreateBlank failed", ErrorMessage);
+#endif
+ return;
+ }
/* Set up the memory stream */
WriteableBitmap ^bmp = ref new WriteableBitmap(width, height);
InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+ if (bmp == nullptr || ras == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("CreateBlank failed", ErrorMessage);
+#endif
+ return;
+ }
DataWriter ^dw = ref new DataWriter(ras->GetOutputStreamAt(0));
- /* Go ahead and write our header data into the memory stream */
+ if (dw == nullptr)
+ {
+#ifdef _DEBUG
+ NotifyUser("CreateBlank failed", ErrorMessage);
+#endif
+ return;
+ } /* Go ahead and write our header data into the memory stream */
Prepare_bmp(width, height, dw);
/* Set the data to all white */
@@ -466,8 +538,8 @@ void MainPage::CreateBlank(int width, int height)
void MainPage::SetFlipView()
{
- int height = this->ActualHeight;
- int width = this->ActualWidth;
+ int height = (int) (this->ActualHeight);
+ int width = (int) (this->ActualWidth);
CreateBlank(BLANK_WIDTH, BLANK_HEIGHT);
/* Set the current flip view mode */
@@ -478,7 +550,7 @@ void MainPage::SetFlipView()
}
/* Clean up everything as we are opening a new document after having another
- one open */
+ one open */
void MainPage::CleanUp()
{
m_init_done = false;
@@ -521,7 +593,7 @@ void MainPage::CleanUp()
m_rectlist_page = -1;
m_Progress = 0.0;
m_doczoom = 1.0;
- m_print_active = false;
+ m_print_active = PRINT_INACTIVE;
m_curr_print_count = 1;
this->xaml_PageSlider->Minimum = m_slider_min;
@@ -540,60 +612,61 @@ void MainPage::RenderThumbs()
auto ui = task_continuation_context::use_current();
this->m_ren_status = REN_THUMBS;
- Vector<DocumentPage^>^ thumbnails = m_thumbnails;
- auto task_thumb = create_task([spatial_info, num_pages, thumbnails, this, ui, token]()-> int
+ auto task_thumb = create_task([spatial_info, num_pages, this, ui, token]()-> int
{
spatial_info_t spatial_info_local = spatial_info;
+ Point ras_size;
+ Array<unsigned char>^ bmp_data;
+ int code;
+
+ /* The renderings run on a background thread */
+ assert(IsBackgroundThread());
spatial_info_local.scale_factor = SCALE_THUMB;
for (int k = 0; k < num_pages; k++)
{
- Point ras_size = ComputePageSize(spatial_info_local, k);
- auto task2 = create_task(mu_doc->RenderPageAsync(k, ras_size.X, ras_size.Y, false));
-
- task2.then([this, k, thumbnails, ras_size](InMemoryRandomAccessStream^ ras)
+ if (ComputePageSize(spatial_info_local, k, &ras_size) == S_ISOK)
{
- assert(IsMainThread());
- WriteableBitmap ^bmp = ref new WriteableBitmap(ras_size.X, ras_size.Y);
- bmp->SetSource(ras);
+ code = mu_doc->RenderPageBitmapSync(k, (int)ras_size.X,
+ (int)ras_size.Y, false, true, &bmp_data);
+
DocumentPage^ doc_page = ref new DocumentPage();
- doc_page->Image = bmp;
- doc_page->Height = ras_size.Y / SCALE_THUMB;
- doc_page->Width = ras_size.X / SCALE_THUMB;
- doc_page->NativeHeight = ras_size.Y / SCALE_THUMB;
- doc_page->NativeWidth = ras_size.X / SCALE_THUMB;
- doc_page->Content = THUMBNAIL;
+ doc_page->Height = (int)(ras_size.Y / SCALE_THUMB);
+ doc_page->Width = (int)(ras_size.X / SCALE_THUMB);
+ doc_page->NativeHeight = (int)(ras_size.Y / SCALE_THUMB);
+ doc_page->NativeWidth = (int)(ras_size.X / SCALE_THUMB);
doc_page->TextBox = nullptr;
doc_page->LinkBox = nullptr;
- if (m_init_done)
- {
- m_thumbnails->SetAt(k, doc_page); /* This avoids out of order returns from task */
- if (k < THUMB_PREADD) /* Flip view gets overwhelmed if I don't do this */
- SetThumb(k, false);
- }
- }, ui).then([this] (task<void> t)
- {
- try
- {
- t.get();
- }
- catch(Platform::InvalidArgumentException^ e)
- {
- //TODO handle error.
- }
- }, token); //end task chain */
+ doc_page->Content = THUMBNAIL;
- /* If cancelled then save the last one as the continuation will not
- have occured. */
- if (is_task_cancellation_requested())
- {
- cancel_current_task();
+ InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+ DataWriter ^dw = ref new DataWriter(ras->GetOutputStreamAt(0));
+ Prepare_bmp((int)ras_size.X, (int)ras_size.Y, dw);
+ dw->WriteBytes(bmp_data);
+ auto t = create_task(dw->StoreAsync());
+ t.wait();
+
+ /* The update with the WriteableBitmap has to take place in the
+ UI thread. The fact that you cannot create a WriteableBitmap
+ object execept in the UI thread is a poor design in WinRT.
+ We will do the callback but with a low priority */
+ this->Dispatcher->RunAsync(CoreDispatcherPriority::Low,
+ ref new DispatchedHandler([this, ras_size, k, ras, doc_page]()
+ {
+ assert(IsMainThread());
+ WriteableBitmap ^bmp = ref new WriteableBitmap((int)ras_size.X, (int)ras_size.Y);
+ bmp->SetSource(ras);
+ doc_page->Image = bmp;
+ m_thumbnails->SetAt(k, doc_page);
+ SetThumbInit((unsigned int) k);
+ }));
}
}
return num_pages; /* all done with thumbnails! */
}, token).then([this](task<int> the_task)
{
/* Finish adding them, but not if we were cancelled. */
+ this->m_ren_status = REN_AVAILABLE;
bool is_cancelled = false;
try
{
@@ -601,17 +674,10 @@ void MainPage::RenderThumbs()
}
catch (const task_canceled& e)
{
- (void) e; // Unused parameter
+ (void)e; // Unused parameter
is_cancelled = true;
}
- if (!is_cancelled)
- {
- for (int k = THUMB_PREADD; k < m_num_pages; k++)
- SetThumb(k, false);
- }
- this->m_ren_status = REN_AVAILABLE;
}, task_continuation_context::use_current());
-
}
void MainPage::OpenDocumentPrep(StorageFile^ file)
@@ -709,12 +775,14 @@ void MainPage::InitialRender()
{
m_currpage = 0;
}
-
/* Initialize all the flipvew items with blanks and the thumbnails. */
for (int k = 0; k < m_num_pages; k++)
{
/* Blank pages */
DocumentPage^ doc_page = ref new DocumentPage();
+ Vector<RectList^>^ temp_link = ref new Vector<RectList^>();
+ if (doc_page == nullptr || temp_link == nullptr)
+ throw ref new FailureException("Document allocation failed!");
doc_page->Image = m_BlankBmp;
doc_page->Height = BLANK_HEIGHT;
doc_page->Width = BLANK_WIDTH;
@@ -727,7 +795,6 @@ void MainPage::InitialRender()
m_thumbnails->Append(doc_page);
/* Create empty lists for our links and specify that they have
not been computed for these pages */
- Vector<RectList^>^ temp_link = ref new Vector<RectList^>();
m_page_link_list->Append(temp_link);
m_linkset->Append(false);
}
@@ -741,18 +808,18 @@ void MainPage::InitialRender()
{
if (m_num_pages > k )
{
- Point ras_size = ComputePageSize(spatial_info, k);
-
- auto render_task =
- create_task(mu_doc->RenderPageAsync(k, ras_size.X, ras_size.Y, true));
-
- render_task.then([this, k, ras_size] (InMemoryRandomAccessStream^ ras)
+ Point ras_size;
+ if (ComputePageSize(spatial_info, k, &ras_size) == S_ISOK)
{
- UpdatePage(k, ras, ras_size, FULL_RESOLUTION, 1.0);
- }, task_continuation_context::use_current());
+ auto render_task = create_task(mu_doc->RenderPageAsync(k, (int) ras_size.X, (int) ras_size.Y, true));
+ render_task.then([this, k, ras_size](InMemoryRandomAccessStream^ ras)
+ {
+ if (ras != nullptr)
+ UpdatePage(k, ras, ras_size, FULL_RESOLUTION, 1.0);
+ }, task_continuation_context::use_current());
+ }
}
}
-
/* Update the slider settings, if more than one page */
if (m_num_pages > 1)
{
@@ -766,7 +833,6 @@ void MainPage::InitialRender()
this->xaml_PageSlider->Minimum = 0;
this->xaml_PageSlider->IsEnabled = false;
}
-
/* All done with initial pages */
this->m_init_done = true;
}
@@ -790,39 +856,46 @@ void MainPage::RenderRange(int curr_page)
if (doc->Content != FULL_RESOLUTION ||
doc->PageZoom != m_doczoom)
{
- Point ras_size = ComputePageSize(spatial_info, k);
- double zoom = m_doczoom;
- auto render_task =
- create_task(mu_doc->RenderPageAsync(k, ras_size.X, ras_size.Y, true));
-
- render_task.then([this, k, ras_size, zoom, curr_page](InMemoryRandomAccessStream^ ras)
- {
- Point new_ras_size = ras_size;
-
- /* This is so that the scroll update will apply the zoom keeping us in-sync. And
- making sure that we can't exceed our limits with keyboard vs touch. I.e. any
- resolution changes must go through the scroll viewer. It make the upcoming
- page appear to come in at its zoom level of 1.0 but it is smoothly scaled to
- the current scale resolution. */
- new_ras_size.X = new_ras_size.X / zoom;
- new_ras_size.Y = new_ras_size.Y / zoom;
- UpdatePage(k, ras, new_ras_size, FULL_RESOLUTION, zoom);
- }, task_continuation_context::use_current()).then([this, k, curr_page]()
+ Point ras_size;
+ if (ComputePageSize(spatial_info, k, &ras_size) == S_ISOK)
{
- if (k == curr_page && this->m_links_on)
- AddLinkCanvas();
- if (k == curr_page && this->m_text_list->Size > 0 &&
- m_flip_from_searchlink)
+ double zoom = m_doczoom;
+ auto render_task = create_task(mu_doc->RenderPageAsync(k, (int) ras_size.X, (int) ras_size.Y, true));
+ render_task.then([this, k, ras_size, zoom, curr_page](InMemoryRandomAccessStream^ ras)
{
- AddTextCanvas();
- m_flip_from_searchlink = false;
- }
- if (k == curr_page)
+ if (ras != nullptr)
+ {
+ Point new_ras_size = ras_size;
+
+ /* This is so that the scroll update will apply the zoom
+ keeping us in-sync. And making sure that we can't
+ exceed our limits with keyboard vs touch. I.e. any
+ resolution changes must go through the scrollviewer.
+ It makes the upcoming page appear to come in at its
+ zoom level of 1.0 but it is smoothly scaled to the
+ current scale resolution. */
+ new_ras_size.X = (float) (new_ras_size.X / zoom);
+ new_ras_size.Y = (float)(new_ras_size.Y / zoom);
+ UpdatePage(k, ras, new_ras_size, FULL_RESOLUTION, zoom);
+ }
+ }, task_continuation_context::use_current()).then([this, k, curr_page]()
{
- m_curr_flipView->UpdateLayout();
- UpdateZoom();
- }
- },task_continuation_context::use_current());
+ if (k == curr_page && this->m_links_on)
+ AddLinkCanvas();
+ if (k == curr_page && this->m_text_list->Size > 0 &&
+ m_flip_from_searchlink)
+ {
+ AddTextCanvas();
+ m_flip_from_searchlink = false;
+ }
+ if (k == curr_page)
+ {
+ m_curr_flipView->UpdateLayout();
+ UpdateZoom();
+ }
+ }, task_continuation_context::use_current());
+
+ }
}
else
{
@@ -900,7 +973,7 @@ void MainPage::Slider_Common()
if (m_init_done && this->xaml_PageSlider->IsEnabled)
{
- this->m_curr_flipView->SelectedIndex = this->xaml_PageSlider->Value - 1;
+ this->m_curr_flipView->SelectedIndex = (int) (this->xaml_PageSlider->Value - 1);
}
return;
}
@@ -926,11 +999,12 @@ void MainPage::ShowSearchBox()
}
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())
+ /* Search is not going to work in the squashed view */
+ if (this->ActualWidth < SEARCH_FIT)
+ {
+ NotifyUser("Please enlarge application to use search", StatusMessage);
return;
-
+ }
m_insearch = true;
FindBox->Visibility = Windows::UI::Xaml::Visibility::Visible;
PrevSearch->Visibility = Windows::UI::Xaml::Visibility::Visible;
@@ -945,7 +1019,7 @@ void MainPage::ClearTextSearch()
m_text_list->Clear();
}
-void MainPage::ShowSearchResults(int page_num, int box_count)
+void MainPage::ShowSearchResults(int page_num, unsigned int box_count)
{
int old_page = this->m_currpage;
int new_page = page_num;
@@ -957,27 +1031,42 @@ void MainPage::ShowSearchResults(int page_num, int box_count)
Point pageSize;
Point scale;
- screenSize.Y = this->ActualHeight;
- screenSize.X = this->ActualWidth;
+ screenSize.Y = (float) (this->ActualHeight);
+ screenSize.X = (float) (this->ActualWidth);
screenSize.X *= screenScale;
screenSize.Y *= screenScale;
- pageSize = mu_doc->GetPageSize(m_currpage);
+
+ try
+ {
+ pageSize = mu_doc->GetPageSize(m_currpage);
+ }
+ catch (Exception ^except)
+ {
+#ifdef _DEBUG
+ NotifyUser(except->Message, ErrorMessage);
+#endif
+ return;
+ }
scale = fitPageToScreen(pageSize, screenSize);
auto doc_page = this->m_docPages->GetAt(old_page);
/* Construct our list of rectangles */
- for (int k = 0; k < box_count; k++)
+ for (unsigned int k = 0; k < box_count; k++)
{
RectList^ rect_item = ref new RectList();
+ if (rect_item == nullptr)
+ {
+ break;
+ }
auto curr_box = mu_doc->GetTextSearch(k);
rect_item->Color = m_textcolor;
- rect_item->Height = curr_box->LowerRight.Y - curr_box->UpperLeft.Y;
- rect_item->Width = curr_box->LowerRight.X - curr_box->UpperLeft.X;
- rect_item->X = curr_box->UpperLeft.X * scale.X;
- rect_item->Y = curr_box->UpperLeft.Y * scale.Y;
- rect_item->Width *= (scale.X);
- rect_item->Height *= (scale.Y);
+ rect_item->Height = (int) (curr_box->LowerRight.Y - curr_box->UpperLeft.Y);
+ rect_item->Width = (int) (curr_box->LowerRight.X - curr_box->UpperLeft.X);
+ rect_item->X = (int) (curr_box->UpperLeft.X * scale.X);
+ rect_item->Y = (int) (curr_box->UpperLeft.Y * scale.Y);
+ rect_item->Width = (int)((double)rect_item->Width * scale.X);
+ rect_item->Height = (int)((double)rect_item->Height * scale.Y);
rect_item->Index = k.ToString();
m_text_list->Append(rect_item);
}
@@ -1092,7 +1181,7 @@ void MainPage::SearchInDirection(int dir, String^ textToFind)
if (box_count > 0)
{
- this->ShowSearchResults(page_num, box_count);
+ this->ShowSearchResults(page_num, (unsigned int) box_count);
}
}
}, task_continuation_context::use_current());
@@ -1101,8 +1190,8 @@ void MainPage::SearchInDirection(int dir, String^ textToFind)
/* This is here to handle when we rotate or go into the snapview mode */
void MainPage::GridSizeChanged()
{
- int height = this->ActualHeight;
- int width = this->ActualWidth;
+ int height = (int) (this->ActualHeight);
+ int width = (int) (this->ActualWidth);
FlipView^ old_flip = m_curr_flipView;
if (TopAppBar1->IsOpen)
@@ -1138,14 +1227,9 @@ void MainPage::GridSizeChanged()
}
if (xaml_WebView->Visibility == Windows::UI::Xaml::Visibility::Visible)
- {
- int height = xaml_OutsideGrid->ActualHeight;
- int height_app = TopAppBar1->ActualHeight;
+ xaml_WebView->Height = xaml_OutsideGrid->ActualHeight;
- xaml_WebView->Height = height - height_app;
- }
-
- UpDateThumbSizes();
+ UpdateThumbSizes();
if (m_num_pages > 0 && old_flip != m_curr_flipView && old_flip != nullptr)
{
@@ -1167,26 +1251,51 @@ void MainPage::GridSizeChanged()
}
}
-void MainPage::UpDateThumbSizes()
+void MainPage::UpdatePreRenderedPageSizes()
{
- /* Reset the thumb view scaling value */
if (m_num_pages > 0)
{
- int num_items = m_thumbnails->Size;
+ for (int k = m_currpage - LOOK_AHEAD; k <= m_currpage + LOOK_AHEAD; k++)
+ {
+ if (k >= 0 && k < m_num_pages && k != m_currpage)
+ {
+ DocumentPage ^doc = this->m_docPages->GetAt(k);
+ doc->Content = OLD_RESOLUTION;
+ int curr_height = doc->Height;
+ int curr_width = doc->Width;
+
+ double scale_x = (double)curr_height / (double)(this->xaml_zoomCanvas->Height);
+ double scale_y = (double)curr_width / (double)(this->xaml_zoomCanvas->Width);
+
+ double min_scale = max(scale_x, scale_y);
+ doc->Height = (int) (curr_height * m_doczoom / min_scale);
+ doc->Width = (int) (curr_width * m_doczoom / min_scale);
+ }
+ }
+ }
+}
+
+void MainPage::UpdateThumbSizes()
+{
+ /* Reset the thumbview scaling values */
+ if (m_num_pages > 0)
+ {
+ int num_items = m_docPages->Size;
for (int i = 0; i < num_items; i++)
{
- DocumentPage ^thumb_page = m_thumbnails->GetAt(i);
- if (thumb_page != nullptr && thumb_page->Image != nullptr)
+ DocumentPage ^thumb_page = m_docPages->GetAt(i);
+ if (thumb_page != nullptr && thumb_page->Image != nullptr
+ && thumb_page->Content == THUMBNAIL)
{
int curr_height = thumb_page->NativeHeight;
int curr_width = thumb_page->NativeWidth;
- double scale_x = (double) curr_height / (double) (this->xaml_zoomCanvas->Height);
- double scale_y = (double) curr_width / (double) (this->xaml_zoomCanvas->Width);
+ double scale_x = (double)curr_height / (double)(this->xaml_zoomCanvas->Height);
+ double scale_y = (double)curr_width / (double)(this->xaml_zoomCanvas->Width);
double min_scale = max(scale_x, scale_y);
- thumb_page->Height = curr_height * m_doczoom / min_scale;
- thumb_page->Width = curr_width * m_doczoom / min_scale;
+ thumb_page->Height = (int)(curr_height / min_scale);
+ thumb_page->Width = (int)(curr_width / min_scale);
}
}
}
@@ -1237,37 +1346,52 @@ void MainPage::AddLinkCanvas()
if (!link_page)
{
m_linkset->SetAt(m_currpage, true);
- int num_links = mu_doc->ComputeLinks(m_currpage);
+ unsigned 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.Y = (float) (this->ActualHeight);
+ screenSize.X = (float)(this->ActualWidth);
screenSize.X *= screenScale;
screenSize.Y *= screenScale;
- pageSize = mu_doc->GetPageSize(m_currpage);
+
+ try
+ {
+ pageSize = mu_doc->GetPageSize(m_currpage);
+ }
+ catch (Exception ^except)
+ {
+#ifdef _DEBUG
+ NotifyUser(except->Message, ErrorMessage);
+#endif
+ return;
+ }
scale = fitPageToScreen(pageSize, screenSize);
/* Create a new RectList collection */
auto link_list = ref new Platform::Collections::Vector<RectList^>();
+ if (link_list == nullptr)
+ return;
/* Now add the rects */
- for (int k = 0; k < num_links; k++)
+ for (unsigned int k = 0; k < num_links; k++)
{
auto curr_link = mu_doc->GetLink(k);
if (curr_link->Type != NOT_SET)
{
RectList^ rect_item = ref new RectList();
+ if (rect_item == nullptr)
+ break;
rect_item->Color = m_linkcolor;
- rect_item->Height = curr_link->LowerRight.Y - curr_link->UpperLeft.Y;
- rect_item->Width = curr_link->LowerRight.X - curr_link->UpperLeft.X;
- rect_item->X = curr_link->UpperLeft.X * scale.X;
- rect_item->Y = curr_link->UpperLeft.Y * scale.Y;
- rect_item->Width *= scale.X;
- rect_item->Height *= scale.Y;
+ rect_item->Height = (int) (curr_link->LowerRight.Y - curr_link->UpperLeft.Y);
+ rect_item->Width = (int) (curr_link->LowerRight.X - curr_link->UpperLeft.X);
+ rect_item->X = (int) (curr_link->UpperLeft.X * scale.X);
+ rect_item->Y = (int) (curr_link->UpperLeft.Y * scale.Y);
+ rect_item->Width = (int)((double)rect_item->Width * scale.X);
+ rect_item->Height = (int)((double)rect_item->Height * scale.Y);
rect_item->Type = curr_link->Type;
rect_item->Urilink = curr_link->Uri;
rect_item->PageNum = curr_link->PageNum;
@@ -1293,7 +1417,7 @@ void MainPage::LinkTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::Ta
{
Rectangle^ rect = safe_cast<Rectangle^>(e->OriginalSource);
String^ str_index = safe_cast<String^>(rect->Tag);
- int index = _wtof(str_index->Data());
+ int index = (int) (_wtof(str_index->Data()));
if (index >= 0 && index < m_num_pages)
{
@@ -1348,9 +1472,9 @@ void MainPage::ContentDisplay(Platform::Object^ sender, Windows::UI::Xaml::Route
{
if (xaml_ListView->Items->Size == 0)
{
- int size_content = mu_doc->ComputeContents();
+ unsigned int size_content = mu_doc->ComputeContents();
/* Bring up the content now */
- for (int k = 0; k < size_content; k++)
+ for (unsigned int k = 0; k < size_content; k++)
{
ContentItem^ item = mu_doc->GetContent(k);
this->xaml_ListView->Items->Append(item);
@@ -1405,7 +1529,6 @@ void MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEvent
this->xaml_MainGrid->Opacity = 1.0;
this->m_curr_flipView->IsEnabled = true;
this->xaml_PageSlider->IsEnabled = true;
- xaml_WebView->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
else if (this->m_curr_flipView->IsEnabled)
{
@@ -1415,7 +1538,7 @@ void MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEvent
this->m_curr_flipView->IsEnabled = false;
this->xaml_PageSlider->IsEnabled = false;
this->xaml_WebView->NavigateToString(html_string);
- this->xaml_WebView->Height = this->ActualHeight - 2 * this->BottomAppBar->ActualHeight;
+ this->xaml_WebView->Height = this->ActualHeight;
}
}
@@ -1423,14 +1546,48 @@ void MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEvent
void MainPage::topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
/* Remove search box in snapped view as we don't have the room for it */
- if (ApplicationView::Value == ApplicationViewState::Snapped && m_insearch)
+ int temp = (int) (this->ActualWidth);
+ if (this->ActualWidth < SEARCH_FIT && m_insearch)
ShowSearchBox();
UpdateAppBarButtonViewState();
+ /* This is needed to make sure we get the proper state during start-up. The
+ object has to be visible to set the state. So that is the way we start */
+ if (!m_insearch && FindBox->Visibility == Windows::UI::Xaml::Visibility::Visible)
+ {
+ FindBox->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ PrevSearch->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ NextSearch->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ }
+}
+
+String^ MainPage::GetVisualState()
+{
+ String^ visualstate = "FullScreenLandscape";
+
+ int width = (int) (this->ActualWidth);
+ int height = (int) (this->ActualHeight);
+
+ if (width < VS_SMALL)
+ {
+ visualstate = "Snapped";
+ }
+ else if (width < VS_LARGE)
+ {
+ if (width < height)
+ {
+ visualstate = "FullScreenPortrait";
+ }
+ else
+ {
+ visualstate = "Snapped";
+ }
+ }
+ return visualstate;
}
void MainPage::UpdateAppBarButtonViewState()
{
- String ^viewState = Windows::UI::ViewManagement::ApplicationView::Value.ToString();
+ String ^viewState = GetVisualState();
VisualStateManager::GoToState(Search, viewState, true);
VisualStateManager::GoToState(Contents, viewState, true);
VisualStateManager::GoToState(Links, viewState, true);
@@ -1442,7 +1599,7 @@ void MainPage::UpdateAppBarButtonViewState()
}
/* Scroll viewer scale changes. If first time to this page, then we essentially
- have our scroll setting set at 1.0. */
+ have our scroll setting set at 1.0. */
void MainPage::ScrollChanged(Platform::Object^ sender,
Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e)
{
@@ -1469,16 +1626,17 @@ void MainPage::ScrollChanged(Platform::Object^ sender,
}
/* Render at new resolution. */
spatial_info_t spatial_info = InitSpatial(m_doczoom);
- Point ras_size = ComputePageSize(spatial_info, page);
- doc_page->PageZoom = m_doczoom;
-
- auto render_task =
- create_task(mu_doc->RenderPageAsync(page, ras_size.X, ras_size.Y, true));
- render_task.then([this, page, ras_size, scrollviewer](InMemoryRandomAccessStream^ ras)
- {
- ReplaceImage(page, ras, ras_size, m_doczoom);
- }, task_continuation_context::use_current());
- UpDateThumbSizes();
+ Point ras_size;
+ if (ComputePageSize(spatial_info, page, &ras_size) == S_ISOK)
+ {
+ doc_page->PageZoom = m_doczoom;
+ auto render_task = create_task(mu_doc->RenderPageAsync(page, (int) ras_size.X, (int) ras_size.Y, true));
+ render_task.then([this, page, ras_size, scrollviewer](InMemoryRandomAccessStream^ ras)
+ {
+ if (ras != nullptr)
+ ReplaceImage(page, ras, ras_size, m_doczoom);
+ }, task_continuation_context::use_current());
+ }
}
}
@@ -1524,8 +1682,8 @@ void MainPage::NonTouchZoom(int zoom)
ScrollViewer^ scrollviewer;
FlipViewItem^ item = safe_cast<FlipViewItem^>
- (m_curr_flipView->ItemContainerGenerator->ContainerFromIndex(m_currpage));
- auto item2 = m_curr_flipView->ItemContainerGenerator->ContainerFromIndex(m_currpage);
+ (m_curr_flipView->ContainerFromIndex(m_currpage));
+ auto item2 = m_curr_flipView->ContainerFromIndex(m_currpage);
/* We don't know which one so check for both */
ScrollViewer^ t1 =
@@ -1567,8 +1725,8 @@ void MainPage::UpdateZoom()
{
ScrollViewer^ scrollviewer;
FlipViewItem^ item = safe_cast<FlipViewItem^>
- (m_curr_flipView->ItemContainerGenerator->ContainerFromIndex(m_currpage));
- auto item2 = m_curr_flipView->ItemContainerGenerator->ContainerFromIndex(m_currpage);
+ (m_curr_flipView->ContainerFromIndex(m_currpage));
+ auto item2 = m_curr_flipView->ContainerFromIndex(m_currpage);
/* We don't know which one so check for both */
ScrollViewer^ t1 =
@@ -1625,7 +1783,7 @@ void MainPage::PasswordOK(Platform::Object^ sender, Windows::UI::Xaml::RoutedEve
bool MainPage::IsNotStandardView()
{
return (this->xaml_ListView->Opacity == 1.0 ||
- xaml_WebView->Visibility == Windows::UI::Xaml::Visibility::Visible);
+ xaml_WebView->Visibility == Windows::UI::Xaml::Visibility::Visible);
}
/* The following code is for print support. */
@@ -1654,7 +1812,7 @@ void MainPage::SetPrintTask(PrintManager^ sender, PrintTaskRequestedEventArgs^ a
ref new TypedEventHandler<PrintTask^, PrintTaskProgressingEventArgs^>(this, &MainPage::PrintProgress);
print_task->Completed +=
ref new TypedEventHandler<PrintTask^, PrintTaskCompletedEventArgs^>(this, &MainPage::PrintCompleted);
- m_print_active = true;
+ m_print_active = PRINT_ACTIVE;
m_curr_print_count = 0;
PrintTaskOptionDetails^ printDetailedOptions =
@@ -1698,7 +1856,7 @@ void MainPage::SetPrintTask(PrintManager^ sender, PrintTaskRequestedEventArgs^ a
int MainPage::GetPrintPageCount()
{
if (m_ppage_num_list.size() > 0)
- return m_ppage_num_list.size();
+ return (int) m_ppage_num_list.size();
else
return m_num_pages;
}
@@ -1933,16 +2091,23 @@ void MainPage::DrawPreviewSurface(float width, float height, float scale_in,
spatial_info.scale_factor = 1.0;
spatial_info.size.X = width;
spatial_info.size.Y = height;
- Point ras_size = ComputePageSize(spatial_info, ren_page_num);
+ Point ras_size;
+
+ if (ComputePageSize(spatial_info, ren_page_num, &ras_size) != S_ISOK)
+ return;
+
ras_size.X = ceil(ras_size.X);
ras_size.Y = ceil(ras_size.Y);
Array<unsigned char>^ bmp_data;
- int code = mu_doc->RenderPageBitmapSync(ren_page_num, ras_size.X, ras_size.Y,
- true, &bmp_data);
+ int code = mu_doc->RenderPageBitmapSync(ren_page_num, (int) ras_size.X,
+ (int) ras_size.Y, true, false,
+ &bmp_data);
+ if (bmp_data == nullptr)
+ return;
D2D1_SIZE_U bit_map_rect;
- bit_map_rect.width = ras_size.X;
- bit_map_rect.height = ras_size.Y;
+ bit_map_rect.width = (UINT32) (ras_size.X);
+ bit_map_rect.height = (UINT32) (ras_size.Y);
D2D1_BITMAP_PROPERTIES1 bitmap_properties2 =
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE,
@@ -1950,8 +2115,8 @@ void MainPage::DrawPreviewSurface(float width, float height, float scale_in,
ID2D1Bitmap1 *bit_map;
ThrowIfFailed(d2d_context->CreateBitmap(bit_map_rect, &(bmp_data[0]),
- ras_size.X * 4, &bitmap_properties2,
- &bit_map));
+ (UINT32) (ras_size.X * 4),
+ &bitmap_properties2, &bit_map));
D2D1_SIZE_F size = bit_map->GetSize();
/* Handle centering */
@@ -1959,15 +2124,16 @@ void MainPage::DrawPreviewSurface(float width, float height, float scale_in,
float x_offset = 0;
if (m_centerprint)
{
- y_offset = (height - size.height) / 2.0;
- x_offset = (width - size.width) / 2.0;
+ y_offset = (float) ((height - size.height) / 2.0);
+ x_offset = (float) ((width - size.width) / 2.0);
}
d2d_context->BeginDraw();
d2d_context->DrawBitmap(bit_map, D2D1::RectF(x_offset, y_offset,
size.width + x_offset, size.height + y_offset));
ThrowIfFailed(d2d_context->EndDraw());
- ThrowIfFailed(previewTarget->DrawPage(page_num, dxgi_surface.Get(), dpi, dpi));
+ ThrowIfFailed(previewTarget->DrawPage(page_num, dxgi_surface.Get(),
+ (float) dpi, (float) dpi));
}
HRESULT MainPage::ClosePrintControl()
@@ -1982,6 +2148,15 @@ void MainPage::PrintPage(uint32 page_num, D2D1_RECT_F image_area, D2D1_SIZE_F pa
int index_page_num = page_num - 1;
int ren_page_num = index_page_num;
+ if (index_page_num == 0)
+ {
+ this->Dispatcher->RunAsync(CoreDispatcherPriority::Low,
+ ref new DispatchedHandler([this]()
+ {
+ xaml_PrintStack->Visibility = Windows::UI::Xaml::Visibility::Visible;
+ }));
+ }
+
/* Windoze seems to hand me a bogus dpi */
device_dpi = 96;
@@ -2006,28 +2181,32 @@ void MainPage::PrintPage(uint32 page_num, D2D1_RECT_F image_area, D2D1_SIZE_F pa
spatial_info_t spatial_info;
spatial_info.scale_factor = 1.0;
/* width and height are based upon device dpi (96) and MuPDF native
- resolution is 72dpi */
+ resolution is 72dpi */
spatial_info.size.X = (width /device_dpi) * (m_printresolution);
spatial_info.size.Y = (height /device_dpi) * (m_printresolution);
- Point ras_size = ComputePageSize(spatial_info, ren_page_num);
+ Point ras_size;
+ if (ComputePageSize(spatial_info, ren_page_num, &ras_size) != S_ISOK)
+ return;
ras_size.X = ceil(ras_size.X);
ras_size.Y = ceil(ras_size.Y);
Array<unsigned char>^ bmp_data;
- int code = mu_doc->RenderPageBitmapSync(ren_page_num, ras_size.X, ras_size.Y,
- true, &bmp_data);
+ int code = mu_doc->RenderPageBitmapSync(ren_page_num, (int) ras_size.X,
+ (int) ras_size.Y, true, false,
+ &bmp_data);
+ if (bmp_data == nullptr)
+ return;
D2D1_SIZE_U bit_map_rect;
- bit_map_rect.width = ras_size.X;
- bit_map_rect.height = ras_size.Y;
+ bit_map_rect.width = (UINT32) (ras_size.X);
+ bit_map_rect.height = (UINT32) (ras_size.Y);
D2D1_BITMAP_PROPERTIES1 bitmap_properties2 =
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE,
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED));
ID2D1Bitmap1 *bit_map;
- ThrowIfFailed(d2d_context->CreateBitmap(bit_map_rect, &(bmp_data[0]),
- ras_size.X * 4, &bitmap_properties2,
- &bit_map));
+ ThrowIfFailed(d2d_context->CreateBitmap(bit_map_rect, &(bmp_data[0]),
+ (UINT32)(ras_size.X * 4), &bitmap_properties2, &bit_map));
D2D1_SIZE_F size = bit_map->GetSize();
/* Handle centering */
@@ -2036,8 +2215,8 @@ void MainPage::PrintPage(uint32 page_num, D2D1_RECT_F image_area, D2D1_SIZE_F pa
if (m_centerprint)
{
/* Offsets need to be provided in the device dpi */
- y_offset = (page_area.height - (size.height * device_dpi / m_printresolution)) / 2.0;
- x_offset = (page_area.width - (size.width * device_dpi / m_printresolution)) / 2.0;
+ y_offset = (float) ((page_area.height - (size.height * device_dpi / m_printresolution)) / 2.0);
+ x_offset = (float) ((page_area.width - (size.width * device_dpi / m_printresolution)) / 2.0);
}
float image_height = (bit_map_rect.height / m_printresolution) * device_dpi;
@@ -2049,6 +2228,7 @@ void MainPage::PrintPage(uint32 page_num, D2D1_RECT_F image_area, D2D1_SIZE_F pa
ThrowIfFailed(d2d_context->EndDraw());
ThrowIfFailed(clist->Close());
ThrowIfFailed(m_d2d_printcontrol->AddPage(clist.Get(), page_area, print_ticket));
+ bit_map->Release();
}
void MainPage::RefreshPreview()
@@ -2063,18 +2243,35 @@ void MainPage::SetPrintTarget(void *print_struct)
m_print_struct = print_struct;
}
-/* These are called by the print thread and as such we cannot do UI updates
- directly. However we can keep a monitor of what is going on so that if
- someone tries to open a new document while we are printing some monster doc,
- we can let them know that they need to wait. */
void MainPage::PrintProgress(PrintTask^ sender, PrintTaskProgressingEventArgs^ args)
{
assert(IsBackgroundThread());
this->m_curr_print_count = args->DocumentPageCount;
+
+ /* Update the progress bar if it is still active */
+ this->Dispatcher->RunAsync(CoreDispatcherPriority::Low,
+ ref new DispatchedHandler([this]()
+ {
+ if (this->xaml_PrintStack->Visibility != Windows::UI::Xaml::Visibility::Collapsed)
+ {
+ xaml_PrintProgress->Value =
+ 100.0 * (double)m_curr_print_count / (double)GetPrintPageCount();
+ }
+ }));
}
void MainPage::PrintCompleted(PrintTask^ sender, PrintTaskCompletedEventArgs^ args)
{
assert(IsBackgroundThread());
- m_print_active = false;
+ m_print_active = PRINT_INACTIVE;
+ this->Dispatcher->RunAsync(CoreDispatcherPriority::Low,
+ ref new DispatchedHandler([this]()
+ {
+ xaml_PrintStack->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ }));
+}
+
+void mupdf_cpp::MainPage::HideProgress(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ xaml_PrintStack->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml.h b/platform/winrt/mupdf_cpp/MainPage.xaml.h
index 37d5227c..c7b5e88b 100644
--- a/platform/winrt/mupdf_cpp/MainPage.xaml.h
+++ b/platform/winrt/mupdf_cpp/MainPage.xaml.h
@@ -32,6 +32,7 @@ using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Popups;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::ApplicationModel;
+using namespace Windows::UI::Core;
using namespace mupdfwinrt;
using namespace Windows::Graphics::Display;
@@ -55,6 +56,12 @@ typedef enum {
REN_PAGE /* Used to ignore value when source based setting */
} RenderingStatus_t;
+typedef enum {
+ PRINT_INACTIVE = 0,
+ PRINT_ACTIVE,
+ PRINT_FAILED
+} PrintStatus_t;
+
typedef struct spatial_info_s
{
Point size;
@@ -111,9 +118,6 @@ 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
{
@@ -121,7 +125,15 @@ namespace mupdf_cpp
{
if (FAILED(hr))
{
- throw Platform::Exception::CreateException(hr);
+ /* We are in a different thread in this case. */
+ this->Dispatcher->RunAsync(CoreDispatcherPriority::Low,
+ ref new DispatchedHandler([this]()
+ {
+ this->m_print_active = PRINT_FAILED;
+ xaml_PrintStack->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+ this->NotifyUser("Print Failed", ErrorMessage);
+ }));
+ throw Platform::Exception::CreateException(hr, "Print Failed");
}
}
@@ -195,7 +207,7 @@ namespace mupdf_cpp
bool m_pageRangeEditVisible;
std::vector<int> m_ppage_num_list;
int m_curr_print_count;
- bool m_print_active;
+ PrintStatus_t m_print_active;
/* DirectX Print Control */
PrintManager ^m_print_manager;
@@ -226,17 +238,18 @@ namespace mupdf_cpp
void SearchPrev(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void CancelSearch(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void SearchInDirection(int dir, String^ textToFind);
- void ShowSearchResults(int page_num, int box_count);
+ void ShowSearchResults(int page_num, unsigned int box_count);
void ClearTextSearch();
void AddTextCanvas();
void GridSizeChanged();
- void UpDateThumbSizes();
+ void UpdateThumbSizes();
+ void UpdatePreRenderedPageSizes();
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 RenderThumbs();
- void SetThumb(int page_num, bool replace);
+ void SetThumb(unsigned int page_num);
void ReleasePages(int old_page, int new_page);
void Linker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void AddLinkCanvas();
@@ -249,10 +262,9 @@ namespace mupdf_cpp
void Reflower(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void topAppBar_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void UpdateAppBarButtonViewState();
- bool EnsureUnsnapped();
void ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command);
void OKInvokedHandler(Windows::UI::Popups::IUICommand^ command);
- Point ComputePageSize(spatial_info_t spatial_info, int page_num);
+ int ComputePageSize(spatial_info_t spatial_info, int page_num, Point *Point);
void ScrollChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e);
void LinkTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
void SearchProgress(IAsyncOperationWithProgress<int, double>^ operation, double status);
@@ -272,6 +284,8 @@ namespace mupdf_cpp
void Slider_Common();
void FlipView_Started(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
void UpdateZoom();
+ String^ GetVisualState();
+ void SetThumbInit(unsigned int page_num);
/* Print Related */
void RegisterForPrinting();
@@ -296,5 +310,8 @@ namespace mupdf_cpp
void SetPrintTarget(void *print_struct);
void PrintProgress(PrintTask^ sender, PrintTaskProgressingEventArgs^ args);
void PrintCompleted(PrintTask^ sender, PrintTaskCompletedEventArgs^ args);
- };
+private:
+ void Testing(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
+ void HideProgress(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+};
}
diff --git a/platform/winrt/mupdf_cpp/PrintPage.cpp b/platform/winrt/mupdf_cpp/PrintPage.cpp
index 5e14f191..83d31791 100644
--- a/platform/winrt/mupdf_cpp/PrintPage.cpp
+++ b/platform/winrt/mupdf_cpp/PrintPage.cpp
@@ -62,7 +62,7 @@ PrintPages::MakeDocument(IInspectable* doc_options, IPrintDocumentPackageTarget*
m_totalpages = m_renderer->GetPrintPageCount();
for (uint32 page_num = 1; page_num <= m_totalpages; ++page_num)
- m_renderer->PrintPage(page_num, imageableRect, pageSize, page_desc.DpiX, nullptr);
+ m_renderer->PrintPage(page_num, imageableRect, pageSize, (float) page_desc.DpiX, nullptr);
}
catch (Platform::Exception^ e)
{
diff --git a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj
index 2827fa75..f75e79fa 100644
--- a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj
+++ b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj
@@ -193,6 +193,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClInclude Include="..\mupdfwinrt\Links.h" />
<ClInclude Include="..\mupdfwinrt\status.h" />
<ClInclude Include="PrintPage.h" />
<ClInclude Include="DocumentPage.h" />
diff --git a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters
index 0a387642..5d7615b2 100644
--- a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters
+++ b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj.filters
@@ -30,6 +30,7 @@
<ClInclude Include="RectList.h" />
<ClInclude Include="..\mupdfwinrt\status.h" />
<ClInclude Include="PrintPage.h" />
+ <ClInclude Include="..\mupdfwinrt\Links.h" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
diff --git a/platform/winrt/mupdfwinrt/muctx.cpp b/platform/winrt/mupdfwinrt/muctx.cpp
index 73c44b05..2c40a85d 100644
--- a/platform/winrt/mupdfwinrt/muctx.cpp
+++ b/platform/winrt/mupdfwinrt/muctx.cpp
@@ -21,6 +21,8 @@ static int win_read_file(fz_stream *stm, unsigned char *buf, int len)
unsigned long long curr_pos = Stream->Position;
unsigned long long length = Stream->Size;
DataReader^ local_reader = ref new DataReader(Stream);
+ if (local_reader == nullptr)
+ return 0;
DataReaderLoadOperation^ result = local_reader->LoadAsync(len);
/* Block on the Async call. This is not on the UI thread. */
@@ -33,6 +35,8 @@ static int win_read_file(fz_stream *stm, unsigned char *buf, int len)
len = curr_len2;
Platform::Array<unsigned char>^ arrByte = ref new Platform::Array<unsigned char>(len);
+ if (arrByte == nullptr)
+ return 0;
local_reader->ReadBytes(arrByte);
memcpy(buf, arrByte->Data, len);
@@ -185,19 +189,24 @@ int muctx::GetPageCount()
}
/* Get page size */
-Point muctx::MeasurePage(int page_num)
+int muctx::MeasurePage(int page_num, Point *size)
{
- 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;
+ fz_try(mu_ctx)
+ {
+ page = fz_load_page(mu_doc, page_num);
+ bounds = fz_bound_page(mu_doc, page, &rect);
+ size->X = bounds->x1 - bounds->x0;
+ size->Y = bounds->y1 - bounds->y0;
+ }
+ fz_catch(mu_ctx)
+ {
+ return E_FAIL;
+ }
+ return 0;
}
/* Get page size */
@@ -321,12 +330,12 @@ int muctx::GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec)
}
/* Get the links and pack into a smart pointer structure */
-int muctx::GetLinks(int page_num, sh_vector_link links_vec)
+unsigned int muctx::GetLinks(int page_num, sh_vector_link links_vec)
{
fz_page *page = NULL;
fz_link *links = NULL;
int k = 0;
- int num_links = 0;
+ unsigned int num_links = 0;
fz_var(page);
fz_var(links);
@@ -530,12 +539,12 @@ status_t muctx::RenderPage(int page_num, unsigned char *bmp_data, int bmp_width,
bool muctx::RequiresPassword(void)
{
- return fz_needs_password(mu_doc);
+ return fz_needs_password(mu_doc) != 0;
}
bool muctx::ApplyPassword(char* password)
{
- return fz_authenticate_password(mu_doc, password);
+ return fz_authenticate_password(mu_doc, password) != 0;
}
String^ muctx::GetHTML(int page_num)
diff --git a/platform/winrt/mupdfwinrt/muctx.h b/platform/winrt/mupdfwinrt/muctx.h
index 33f6acc5..5c452155 100644
--- a/platform/winrt/mupdfwinrt/muctx.h
+++ b/platform/winrt/mupdfwinrt/muctx.h
@@ -91,9 +91,9 @@ public:
unsigned char *bmp_data, int bmp_width, int bmp_height,
bool flipy);
fz_display_list* CreateDisplayList(int page_num, int *width, int *height);
- Point MeasurePage(int page_num);
+ int MeasurePage(int page_num, Point *size);
Point MeasurePage(fz_page *page);
- int GetLinks(int page_num, sh_vector_link links_vec);
+ unsigned int GetLinks(int page_num, sh_vector_link links_vec);
int GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec);
int GetContents(sh_vector_content contents_vec);
String^ GetHTML(int page_num);
diff --git a/platform/winrt/mupdfwinrt/mudocument.cpp b/platform/winrt/mupdfwinrt/mudocument.cpp
index d4855dd9..48093780 100644
--- a/platform/winrt/mupdfwinrt/mudocument.cpp
+++ b/platform/winrt/mupdfwinrt/mudocument.cpp
@@ -1,8 +1,8 @@
// mudocument.cpp
/* This file contains the interface between the muctx class, which
- implements the mupdf calls and the WinRT objects enabling calling from
- C#, C++, Visual Basic, JavaScript applications */
+ implements the mupdf calls and the WinRT objects enabling calling from
+ C#, C++, Visual Basic, JavaScript applications */
#include "pch.h"
#include "mudocument.h"
@@ -46,8 +46,10 @@ Point mudocument::GetPageSize(int page_num)
Point size;
mutex_lock.lock();
- size = this->mu_object.MeasurePage(page_num);
+ int code = this->mu_object.MeasurePage(page_num, &size);
mutex_lock.unlock();
+ if (code < 0)
+ throw ref new Exception(code, ref new String(L"Get Page Size Failed"));
return size;
}
@@ -86,8 +88,7 @@ Windows::Foundation::IAsyncOperation<int>^ mudocument::OpenFileAsync(StorageFile
}
}
catch(COMException^ ex) {
- /* Need to do something useful here */
- throw ex;
+ throw ref new FailureException("Open File Failed");
}
});
});
@@ -168,15 +169,23 @@ Windows::Foundation::IAsyncOperationWithProgress<int, double>^
}
/* Pack the page into a bitmap. This is used in the DirectX code for printing
- not in the xaml related code. */
+ not in the xaml related code. It is also used by the thumbnail creation
+ thread to ensure that the thumbs are created in order and we don't create
+ thousands of threads */
int mudocument::RenderPageBitmapSync(int page_num, int bmp_width, int bmp_height,
- bool use_dlist, Array<unsigned char>^* bit_map)
+ bool use_dlist, bool flipy, Array<unsigned char>^* bit_map)
{
status_t code;
/* Allocate space for bmp */
Array<unsigned char>^ bmp_data =
ref new Array<unsigned char>(bmp_height * 4 * bmp_width);
+ if (bmp_data == nullptr)
+ {
+ *bit_map = nullptr;
+ return E_OUTOFMEM;
+ }
+
if (use_dlist)
{
void *dlist;
@@ -190,21 +199,27 @@ int mudocument::RenderPageBitmapSync(int page_num, int bmp_width, int bmp_height
&page_height);
/* Rendering of display list can occur with other threads so unlock */
mutex_lock.unlock();
+ if (dlist == NULL)
+ {
+ *bit_map = nullptr;
+ return E_FAILURE;
+ }
code = mu_object.RenderPageMT(dlist, page_width, page_height,
&(bmp_data[0]), bmp_width, bmp_height,
- false);
+ flipy);
}
else
{
/* Rendering in immediate mode. Keep lock in place */
mutex_lock.lock();
code = mu_object.RenderPage(page_num, &(bmp_data[0]), bmp_width,
- bmp_height, false);
+ bmp_height, flipy);
mutex_lock.unlock();
}
if (code != S_ISOK)
{
- throw ref new FailureException("Page Rendering Failed");
+ *bit_map = nullptr;
+ return E_FAILURE;
}
*bit_map = bmp_data;
@@ -222,9 +237,17 @@ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
/* Allocate space for bmp */
Array<unsigned char>^ bmp_data =
ref new Array<unsigned char>(bmp_height * 4 * bmp_width);
+ if (bmp_data == nullptr)
+ return nullptr;
+
/* Set up the memory stream */
InMemoryRandomAccessStream ^ras = ref new InMemoryRandomAccessStream();
+ if (ras == nullptr)
+ return nullptr;
DataWriter ^dw = ref new DataWriter(ras->GetOutputStreamAt(0));
+ if (dw == nullptr)
+ return nullptr;
+
status_t code;
/* Go ahead and write our header data into the memory stream */
@@ -241,8 +264,10 @@ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
in the page cache */
dlist = (void*) mu_object.CreateDisplayList(page_num, &page_width,
&page_height);
- /* Rendering of display list can occur with other threads so unlock */
mutex_lock.unlock();
+ if (dlist == NULL)
+ return nullptr;
+ /* Rendering of display list can occur with other threads so unlock */
code = mu_object.RenderPageMT(dlist, page_width, page_height,
&(bmp_data[0]), bmp_width, bmp_height,
true);
@@ -256,35 +281,38 @@ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
mutex_lock.unlock();
}
if (code != S_ISOK)
- {
- throw ref new FailureException("Page Rendering Failed");
- }
+ return nullptr;
/* 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) {
- }
+ auto t = create_task(dw->StoreAsync());
+ t.wait();
/* Return raster stream */
return ras;
});
}
-int mudocument::ComputeLinks(int page_num)
+unsigned int mudocument::ComputeLinks(int page_num)
{
/* 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>());
mutex_lock.lock();
- int num_items = mu_object.GetLinks(page_num, link_smart_ptr_vec);
+ unsigned int num_items = mu_object.GetLinks(page_num, link_smart_ptr_vec);
mutex_lock.unlock();
- if (num_items == 0)
+ if (num_items == 0 || num_items == E_FAIL)
return 0;
/* Pack into winRT type*/
this->links = ref new Platform::Collections::Vector<Links^>();
- for (int k = 0; k < num_items; k++)
+ if (this->links == nullptr)
+ return 0;
+ for (unsigned int k = 0; k < num_items; k++)
{
auto new_link = ref new Links();
+ if (new_link == nullptr)
+ {
+ this->links = nullptr;
+ return 0;
+ }
sh_link muctx_link = link_smart_ptr_vec->at(k);
new_link->LowerRight = muctx_link->lower_right;
new_link->UpperLeft = muctx_link->upper_left;
@@ -295,13 +323,18 @@ int mudocument::ComputeLinks(int page_num)
String^ str = char_to_String(muctx_link->uri.get());
// The URI to launch
new_link->Uri = ref new Windows::Foundation::Uri(str);
+ if (new_link->Uri == nullptr)
+ {
+ this->links = nullptr;
+ return 0;
+ }
}
this->links->Append(new_link);
}
return num_items;
}
-Links^ mudocument::GetLink(int k)
+Links^ mudocument::GetLink(unsigned int k)
{
if (k >= this->links->Size)
return nullptr;
@@ -324,9 +357,16 @@ int mudocument::ComputeTextSearch(String^ text, int page_num)
return 0;
/* Pack into winRT type*/
this->textsearch = ref new Platform::Collections::Vector<Links^>();
+ if (this->textsearch == nullptr)
+ return 0;
for (int k = 0; k < num_items; k++)
{
auto new_link = ref new Links();
+ if (new_link == nullptr)
+ {
+ this->textsearch = nullptr;
+ return 0;
+ }
sh_text muctx_text = text_smart_ptr_vec->at(k);
new_link->LowerRight = muctx_text->lower_right;
new_link->UpperLeft = muctx_text->upper_left;
@@ -347,14 +387,14 @@ int mudocument::TextSearchCount(void)
}
/* Returns the kth item for a page after a text search query */
-Links^ mudocument::GetTextSearch(int k)
+Links^ mudocument::GetTextSearch(unsigned int k)
{
if (k >= this->textsearch->Size)
return nullptr;
return this->textsearch->GetAt(k);
}
-int mudocument::ComputeContents()
+unsigned int mudocument::ComputeContents()
{
/* We get back a standard smart pointer from muctx interface and go to
* WinRT type here */
@@ -369,11 +409,18 @@ int mudocument::ComputeContents()
return 0;
/* Pack into winRT type*/
this->contents = ref new Platform::Collections::Vector<ContentItem^>();
- int num_items = content_smart_ptr_vec->size();
+ if (this->contents == nullptr)
+ return 0;
+ unsigned int num_items = content_smart_ptr_vec->size();
- for (int k = 0; k < num_items; k++)
+ for (unsigned int k = 0; k < num_items; k++)
{
auto new_content = ref new ContentItem();
+ if (new_content == nullptr)
+ {
+ this->contents = nullptr;
+ return 0;
+ }
sh_content muctx_content = content_smart_ptr_vec->at(k);
new_content->Page = muctx_content->page;
new_content->StringMargin = muctx_content->string_margin;
@@ -383,7 +430,7 @@ int mudocument::ComputeContents()
return num_items;
}
-ContentItem^ mudocument::GetContent(int k)
+ContentItem^ mudocument::GetContent(unsigned int k)
{
if (k >= this->contents->Size)
return nullptr;
diff --git a/platform/winrt/mupdfwinrt/mudocument.h b/platform/winrt/mupdfwinrt/mudocument.h
index c3356337..3e0b9fcf 100644
--- a/platform/winrt/mupdfwinrt/mudocument.h
+++ b/platform/winrt/mupdfwinrt/mudocument.h
@@ -35,18 +35,18 @@ namespace mupdfwinrt
Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
RenderPageAsync(int page_num, int width, int height, bool use_dlist);
int RenderPageBitmapSync(int page_num, int bmp_width, int bmp_height,
- bool use_dlist, Array<unsigned char>^* bit_map);
+ bool use_dlist, bool flipy, Array<unsigned char>^* bit_map);
Windows::Foundation::IAsyncOperationWithProgress<int, double>^
SearchDocumentWithProgressAsync(String^ textToFind, int dir,
int start_page, int num_pages);
String^ ComputeHTML(int page_num);
int ComputeTextSearch(String^ text, int page_num);
- Links^ GetTextSearch(int k);
+ Links^ GetTextSearch(unsigned int k);
int TextSearchCount(void);
- int ComputeContents(void);
- ContentItem^ GetContent(int k);
- int ComputeLinks(int page_num);
- Links^ GetLink(int k);
+ unsigned int ComputeContents(void);
+ ContentItem^ GetContent(unsigned int k);
+ unsigned int ComputeLinks(int page_num);
+ Links^ GetLink(unsigned int k);
bool RequiresPassword();
bool ApplyPassword(String^ password);
};
diff --git a/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj b/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj
index 5917a638..d2f6ae88 100644
--- a/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj
+++ b/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj
@@ -220,7 +220,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Cache.h" />
- <ClInclude Include="Links.h" />
<ClInclude Include="ContentItem.h" />
<ClInclude Include="muctx.h" />
<ClInclude Include="pch.h" />
diff --git a/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters b/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters
index 7598f3e5..99e37356 100644
--- a/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters
+++ b/platform/winrt/mupdfwinrt/mupdfwinrt.vcxproj.filters
@@ -19,7 +19,6 @@
<ClInclude Include="pch.h" />
<ClInclude Include="mudocument.h" />
<ClInclude Include="muctx.h" />
- <ClInclude Include="Links.h" />
<ClInclude Include="utils.h" />
<ClInclude Include="ContentItem.h" />
<ClInclude Include="Cache.h" />
diff --git a/platform/winrt/mupdfwinrt/status.h b/platform/winrt/mupdfwinrt/status.h
index af168d62..9eea09aa 100644
--- a/platform/winrt/mupdfwinrt/status.h
+++ b/platform/winrt/mupdfwinrt/status.h
@@ -2,9 +2,9 @@
typedef enum {
S_ISOK = 0,
- E_FAILURE = 1,
- E_OUTOFMEM = 2,
- E_NEEDPASSWORD
+ E_FAILURE = -1,
+ E_OUTOFMEM = -2,
+ E_NEEDPASSWORD = -3
} status_t;
typedef enum {