diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2013-05-08 15:23:37 -0700 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 19:25:52 +0100 |
commit | 3824bf32f8595c2f037db14e133b798bfae65027 (patch) | |
tree | 38dba1a41cc630758e3ec3a30478305c201dfff7 /winrt/mupdf_cpp/RectList.h | |
parent | b1d1cad431495900378054fec3981221b17cdcb1 (diff) | |
download | mupdf-3824bf32f8595c2f037db14e133b798bfae65027.tar.xz |
Display of link in document reworked.
They are now bound to the UI xaml as a collection of rectangle coordinate and color.
Diffstat (limited to 'winrt/mupdf_cpp/RectList.h')
-rw-r--r-- | winrt/mupdf_cpp/RectList.h | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/winrt/mupdf_cpp/RectList.h b/winrt/mupdf_cpp/RectList.h index eb4532aa..d138397a 100644 --- a/winrt/mupdf_cpp/RectList.h +++ b/winrt/mupdf_cpp/RectList.h @@ -1,12 +1,10 @@ #pragma once - -/* Used for binding to the xaml in the scroll view. */ +/* WinRT RectList class for binding a collection of rects to the xaml ui */ using namespace Windows::UI::Xaml::Media::Imaging; using namespace Windows::UI::Xaml::Controls; +using namespace Platform; /* For String */ - - 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 @@ -14,36 +12,50 @@ namespace mupdf_cpp public ref class RectList sealed { private: - int heightr; - int widthr; + int height; + int width; int x; int y; + String^ color; + /* These are used to store the link infomation */ + int type; + int pagenum; + Windows::Foundation::Uri ^uri; public: RectList(void); - property int HeightR + property int Height { - int get() { return ((int) heightr); } + int get() { return ((int) height); } void set(int value) { if (value < 0) { throw ref new Platform::InvalidArgumentException(); } - heightr = value; + height = value; + } + } + + property String^ Color + { + String^ get() { return (color); } + void set(String^ value) + { + color = value; } } - property int WidthR + property int Width { - int get() { return widthr; } + int get() { return width; } void set(int value) { if (value < 0) { throw ref new Platform::InvalidArgumentException(); } - widthr = value; + width = value; } } @@ -64,5 +76,32 @@ namespace mupdf_cpp y = value; } } + + property int Type + { + int get() { return type; } + void set(int value) + { + type = value; + } + } + + property int PageNum + { + int get() { return pagenum; } + void set(int value) + { + pagenum = value; + } + } + + property Windows::Foundation::Uri^ Urilink + { + Windows::Foundation::Uri^ get() { return uri; } + void set(Windows::Foundation::Uri^ value) + { + uri = value; + } + } }; } |