diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2013-05-04 22:59:31 -0700 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 19:25:44 +0100 |
commit | ced8337a902cfb9988d014c099b90b2b66212825 (patch) | |
tree | c91a41d504b4cbddec169a2e5e4a2a5031863ad4 /winrt/mupdfwinrt/mudocument.h | |
parent | 4bbdac7510e0a02f86fd00629a8b344d85404528 (diff) | |
download | mupdf-ced8337a902cfb9988d014c099b90b2b66212825.tar.xz |
Major changes in the entire design.
Initial commit of this and it has several issues that have to be worked through. Lots of
broken stuff but I needed to get it in place.
Added 2 new classes. One is muctx which contains all the interfacing to mupdf and uses
standard c++ types. The other is mudocument which interfaces between muctx and the WinRT
world. It passes WinRT objects to and from applications which can be written in C++, C#,
Visual Basic, Javascript etc. mudocument and muctx will reside in a winRT DLL. The
Viewer application (c++ version) is now in mupdf_cpp project and now has a flip view
structure that includes a scroll viewer which has data binding to a collection. This
enables much easier zooming and updating, however I am still trying how to bind the
canvas elements that contain the text search or link information.
Diffstat (limited to 'winrt/mupdfwinrt/mudocument.h')
-rw-r--r-- | winrt/mupdfwinrt/mudocument.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/winrt/mupdfwinrt/mudocument.h b/winrt/mupdfwinrt/mudocument.h new file mode 100644 index 00000000..b315a18f --- /dev/null +++ b/winrt/mupdfwinrt/mudocument.h @@ -0,0 +1,40 @@ +#pragma once + +/* This file contains the WinRT API interface between the muctx class which + implements the mupdf calls and the WinRT objects enabling calling from + C#, C++, Visual Basic, JavaScript applications */ + +#include "muctx.h" +#include "Links.h" +#include "ppltasks.h" +#include <winnt.h> +#include <collection.h> + +using namespace Windows::Storage; +using namespace Platform; +using namespace Concurrency; +using namespace Platform::Collections; + +namespace mupdfwinrt +{ + public ref class mudocument sealed + { + + private: + muctx mu_object; + std::mutex mutex_lock; + Platform::Collections::Vector<Links^>^ links; + Platform::Collections::Vector<Links^>^ textsearch; + public: + mudocument(); + Windows::Foundation::IAsyncAction^ OpenFile(StorageFile^ file); + int GetNumPages(); + Point GetPageSize(int page_num); + Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^ + RenderPage(int page_num, int width, int height); + int ComputeLinks(int page_num); + Links^ GetLink(int k); + int ComputeTextSearch(String^ text, int page_num); + + }; +}
\ No newline at end of file |