summaryrefslogtreecommitdiff
path: root/platform/winrt/mupdf_cpp/App.xaml.cpp
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2014-01-08 22:42:10 -0800
committerMichael Vrhel <michael.vrhel@artifex.com>2014-01-09 14:25:57 -0800
commitcd84c92e68a7a3131895c469294235159ffab4dd (patch)
treec2f3b00708a583e8b6666f2131aab026b7f108e5 /platform/winrt/mupdf_cpp/App.xaml.cpp
parent5249664dd8178e985b4ef47af6e1772b4c7665e7 (diff)
downloadmupdf-cd84c92e68a7a3131895c469294235159ffab4dd.tar.xz
Add tiling into the DirectX printing code.
The tiling in x and y is needed to ensure that we can print at high resolutions with devices that have smaller bit map sizes (e.g. the surface). Banding only in the y dimension like we often do is not sufficient. Also fix an open with file association bug that must of occurred with the transition to 8.1 And update WinRT solution for recent changes in mupdf code. This includes the addition of a few new files and the document type registration.
Diffstat (limited to 'platform/winrt/mupdf_cpp/App.xaml.cpp')
-rw-r--r--platform/winrt/mupdf_cpp/App.xaml.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/platform/winrt/mupdf_cpp/App.xaml.cpp b/platform/winrt/mupdf_cpp/App.xaml.cpp
index d0b9d8c7..4bb9614c 100644
--- a/platform/winrt/mupdf_cpp/App.xaml.cpp
+++ b/platform/winrt/mupdf_cpp/App.xaml.cpp
@@ -95,17 +95,23 @@ void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEvent
}
}
-// Handle file activations.
+/* Handle case where we do a association file opening and the app is already
+ running */
void App::OnFileActivated(Windows::ApplicationModel::Activation::FileActivatedEventArgs^ args)
{
- auto rootFrame = ref new Frame();
- TypeName pageType = { "mupdf_cpp.MainPage", TypeKind::Custom };
- rootFrame->Navigate(pageType, args);
- Window::Current->Content = rootFrame;
- auto rootPage = safe_cast<MainPage^>(rootFrame->Content);
- rootPage->FileEvent = args;
- rootPage->ProtocolEvent = nullptr;
+ auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
+ if (rootFrame->Content == nullptr)
+ {
+ if (!rootFrame->Navigate(TypeName(MainPage::typeid)))
+ {
+ throw ref new FailureException("Failed to create initial page");
+ }
+ }
+ auto p = dynamic_cast<MainPage^>(rootFrame->Content);
+ p->FileEvent = args;
+ p->ProtocolEvent = nullptr;
+ p->FromFile();
Window::Current->Activate();
}