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/mupdf_cpp/RectList.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/mupdf_cpp/RectList.h')
-rw-r--r-- | winrt/mupdf_cpp/RectList.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/winrt/mupdf_cpp/RectList.h b/winrt/mupdf_cpp/RectList.h new file mode 100644 index 00000000..eb4532aa --- /dev/null +++ b/winrt/mupdf_cpp/RectList.h @@ -0,0 +1,68 @@ +#pragma once + + +/* Used for binding to the xaml in the scroll view. */ +using namespace Windows::UI::Xaml::Media::Imaging; +using namespace Windows::UI::Xaml::Controls; + + + +namespace mupdf_cpp +{ + [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639 + + public ref class RectList sealed + { + private: + int heightr; + int widthr; + int x; + int y; + public: + RectList(void); + + property int HeightR + { + int get() { return ((int) heightr); } + void set(int value) + { + if (value < 0) + { + throw ref new Platform::InvalidArgumentException(); + } + heightr = value; + } + } + + property int WidthR + { + int get() { return widthr; } + void set(int value) + { + if (value < 0) + { + throw ref new Platform::InvalidArgumentException(); + } + widthr = value; + } + } + + property int X + { + int get() { return x; } + void set(int value) + { + x = value; + } + } + + property int Y + { + int get() { return y; } + void set(int value) + { + y = value; + } + } + }; +} |