summaryrefslogtreecommitdiff
path: root/platform/windows/gsview/TextLine.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/TextLine.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/TextLine.cs')
-rw-r--r--platform/windows/gsview/TextLine.cs121
1 files changed, 121 insertions, 0 deletions
diff --git a/platform/windows/gsview/TextLine.cs b/platform/windows/gsview/TextLine.cs
new file mode 100644
index 00000000..c37f604b
--- /dev/null
+++ b/platform/windows/gsview/TextLine.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using System.Threading.Tasks;
+using System.ComponentModel;
+using System.Collections.ObjectModel;
+
+namespace gsview
+{
+ public enum Intersection_t
+ {
+ NONE,
+ PARTIAL,
+ FULL
+ };
+
+ public class TextLine : INotifyPropertyChanged
+ {
+ public List<TextCharacter> TextCharacters;
+ double height;
+ double width;
+ double x;
+ double y;
+ double scale;
+ String color;
+ int page_number;
+
+ /* Determine intersection case of line with selection rectangle */
+ public Intersection_t CheckIntersection(double rect_x, double rect_y, double rect_w, double rect_h)
+ {
+ if (rect_h == 0 || rect_y > y + height || rect_y + rect_h < y)
+ return Intersection_t.NONE;
+
+ if (rect_y <= y && y + height <= rect_y + rect_h)
+ return Intersection_t.FULL;
+
+ return Intersection_t.PARTIAL;
+ }
+
+ public double Height
+ {
+ get { return height; }
+ set
+ {
+ height = value;
+ OnPropertyChanged("Height");
+ }
+ }
+
+ public double Width
+ {
+ get { return width; }
+ set
+ {
+ width = value;
+ OnPropertyChanged("Width");
+ }
+ }
+
+ public double X
+ {
+ get { return x; }
+ set
+ {
+ x = value;
+ OnPropertyChanged("X");
+ }
+ }
+
+ public double Y
+ {
+ get { return y; }
+ set
+ {
+ y = value;
+ OnPropertyChanged("Y");
+ }
+ }
+ public double Scale
+ {
+ get { return scale; }
+ set { scale = value;}
+ }
+
+ public int PageNumber
+ {
+ get { return page_number; }
+ set { page_number = value; }
+ }
+
+ public String Color
+ {
+ get { return color; }
+ set
+ {
+ color = value;
+ //OnPropertyChanged("Color");
+ }
+ }
+ 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 class LinesText : ObservableCollection<TextLine>
+ {
+ public LinesText()
+ : base()
+ {
+ }
+ }
+}