summaryrefslogtreecommitdiff
path: root/platform/windows/gsview/DocPage.cs
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2014-09-09 16:31:31 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2014-09-09 16:39:41 -0700
commit7ea99e3a8951e265d1437a77dcfee069de0edf76 (patch)
tree8e113fea67931064e2a9338d67b26aaabab27512 /platform/windows/gsview/DocPage.cs
parent8a9519f2183b64fe220bcb1f6acedbe6acc190cd (diff)
downloadmupdf-7ea99e3a8951e265d1437a77dcfee069de0edf76.tar.xz
Rename of winrt to windows due to presence on gsview in this folder.
The contents of this folder will contain both winrt and gsview projects which are shared in a common visual studio 2013 solution.
Diffstat (limited to 'platform/windows/gsview/DocPage.cs')
-rw-r--r--platform/windows/gsview/DocPage.cs281
1 files changed, 281 insertions, 0 deletions
diff --git a/platform/windows/gsview/DocPage.cs b/platform/windows/gsview/DocPage.cs
new file mode 100644
index 00000000..267d99e8
--- /dev/null
+++ b/platform/windows/gsview/DocPage.cs
@@ -0,0 +1,281 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using System.Threading.Tasks;
+using System.ComponentModel;
+using System.Windows.Media.Imaging;
+using System.Collections.ObjectModel;
+using System.Windows.Media;
+
+namespace gsview
+{
+ public enum Annotate_t
+ {
+ UNKNOWN,
+ COMPUTING,
+ NO_ANNOTATE,
+ HAS_ANNOTATE,
+ ANNOTATE_VISIBLE,
+ ANNOTATE_HIDDEN
+ }
+
+ public class DocPage : INotifyPropertyChanged
+ {
+ private LinesText m_lines;
+ private BlocksText m_blocks;
+ private int height;
+ private int width;
+ private int nativeheight;
+ private int nativewidth;
+ private double zoom;
+ private Annotate_t annotate;
+ private BitmapSource bitmap;
+ private IList<RectList> textbox;
+ private List<RectList> linkbox;
+ private Page_Content_t content;
+ private String pagename;
+ private int pagenum;
+ private double sely;
+ private double selx;
+ private double selheight;
+ private double selwidth;
+ private String selcolor;
+ private double sel_anchorx;
+ private double sel_anchory;
+
+ public double SelAnchorX
+ {
+ get { return sel_anchorx; }
+ set { sel_anchorx = value; }
+ }
+
+ public double SelAnchorY
+ {
+ get { return sel_anchory; }
+ set { sel_anchory = value; }
+ }
+
+ public double SelY
+ {
+ get { return sely; }
+ set
+ {
+ sely = value;
+ OnPropertyChanged("SelY");
+ }
+ }
+
+ public double SelX
+ {
+ get { return selx; }
+ set
+ {
+ selx = value;
+ OnPropertyChanged("SelX");
+ }
+ }
+
+ public double SelHeight
+ {
+ get { return selheight; }
+ set
+ {
+ selheight = value;
+ OnPropertyChanged("SelHeight");
+ }
+ }
+
+ public double SelWidth
+ {
+ get { return selwidth; }
+ set
+ {
+ selwidth = value;
+ OnPropertyChanged("SelWidth");
+ }
+ }
+
+ public String SelColor
+ {
+ get { return selcolor; }
+ set
+ {
+ selcolor = value;
+ OnPropertyChanged("SelColor");
+ }
+ }
+
+ public int Height
+ {
+ get { return height; }
+ set
+ {
+ height = value;
+ OnPropertyChanged("Height");
+ }
+ }
+
+ public int Width
+ {
+ get { return width; }
+ set
+ {
+ width = value;
+ OnPropertyChanged("Width");
+ }
+ }
+
+ public int NativeHeight
+ {
+ get { return nativewidth; }
+ set { nativewidth = value; }
+ }
+
+ public int NativeWidth
+ {
+ get { return nativeheight; }
+ set { nativeheight = value; }
+ }
+
+ public Annotate_t Annotate
+ {
+ get { return annotate; }
+ set { annotate = value; }
+ }
+
+ public double Zoom
+ {
+ get { return zoom; }
+ set { zoom = value; }
+ }
+
+ public BitmapSource BitMap
+ {
+ get { return bitmap; }
+ set
+ {
+ bitmap = value;
+ OnPropertyChanged("BitMap");
+ }
+ }
+
+ public IList<RectList> TextBox
+ {
+ get { return textbox; }
+ set
+ {
+ textbox = value;
+ OnPropertyChanged("TextBox");
+ }
+ }
+
+ public List<RectList> LinkBox
+ {
+ get { return linkbox; }
+ set
+ {
+ linkbox = value;
+ OnPropertyChanged("LinkBox");
+ }
+ }
+
+ public BlocksText TextBlocks
+ {
+ get { return m_blocks; }
+ set
+ {
+ m_blocks = value;
+ OnPropertyChanged("TextBlocks");
+ }
+ }
+
+ public LinesText SelectedLines
+ {
+ get { return m_lines; }
+ set
+ {
+ m_lines = value;
+ OnPropertyChanged("SelectedLines");
+ }
+ }
+
+ public Page_Content_t Content
+ {
+ get { return content; }
+ set { content = value; }
+ }
+
+ public String PageName
+ {
+ get { return pagename; }
+ set { pagename = value; }
+ }
+
+ public int PageNum
+ {
+ get { return pagenum; }
+ set { pagenum = value; }
+ }
+
+ public AA_t AA
+ {
+ get;
+ set;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ // Create the OnPropertyChanged method to raise the event
+ protected void OnPropertyChanged(string name)
+ {
+ PropertyChangedEventHandler handler = PropertyChanged;
+ if (handler != null)
+ {
+ handler(this, new PropertyChangedEventArgs(name));
+ }
+ }
+
+ public DocPage()
+ {
+ this.Height = 0;
+ this.Width = 0;
+ this.NativeHeight = 0;
+ this.NativeWidth = 0;
+ this.Zoom = 0;
+ this.BitMap = null;
+ this.TextBox = null;
+ this.LinkBox = null;
+ this.Content = Page_Content_t.NOTSET;
+ this.PageNum = -1;
+ this.PageName = "";
+ this.TextBlocks = null;
+ this.AA = AA_t.HIGH;
+ }
+
+ public DocPage(int Height, int Width, double Zoom, BitmapSource BitMap,
+ List<RectList> TextBox, List<RectList> LinkBox,
+ Page_Content_t Content, int PageNum, BlocksText TextBlocks,
+ AA_t AA)
+ {
+ this.Height = Height;
+ this.Width = Width;
+ this.Zoom = Zoom;
+ this.BitMap = BitMap;
+ this.TextBox = TextBox;
+ this.LinkBox = LinkBox;
+ this.Content = Content;
+ this.PageNum = PageNum;
+ this.PageName = ("Page " + (PageNum + 1));
+ this.TextBlocks = TextBlocks;
+ this.AA = AA;
+ }
+ };
+ public class Pages : ObservableCollection<DocPage>
+ {
+ public Pages()
+ : base()
+ {
+ }
+ }
+}