From ced8337a902cfb9988d014c099b90b2b66212825 Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Sat, 4 May 2013 22:59:31 -0700 Subject: 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. --- winrt/mupdfwinrt/mudocument.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 winrt/mupdfwinrt/mudocument.h (limited to 'winrt/mupdfwinrt/mudocument.h') 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 +#include + +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; + Platform::Collections::Vector^ textsearch; + public: + mudocument(); + Windows::Foundation::IAsyncAction^ OpenFile(StorageFile^ file); + int GetNumPages(); + Point GetPageSize(int page_num); + Windows::Foundation::IAsyncOperation^ + 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 -- cgit v1.2.3