OSDN Git Service

MVVM対応に備えてシンボル系列のプロパティもDocumentに移行した
authorgdkhd812 <test@nnn.co.jp>
Sun, 25 Oct 2015 16:09:30 +0000 (21:39 +0530)
committergdkhd812 <test@nnn.co.jp>
Sun, 25 Oct 2015 16:09:30 +0000 (21:39 +0530)
Core/Direct2D/D2DRenderCommon.cs
Core/Document.cs
Core/ITextRender.cs
Core/ViewBase.cs
WPF/FooEditEngine/FooTextBox.cs
WPF/FooEditEngine/WPF/WPFRender.cs
WPF/UnitTest/DummyRender.cs
Windows/FooEditEngine/FooTextBox.cs
Windows/FooEditEngine/PrintableTextRender.cs

index dc1c1ce..2238410 100644 (file)
@@ -296,7 +296,6 @@ namespace FooEditEngine
                     this.HiddenChars.AddSymbol(' ', '□');
                 else
                     this.HiddenChars.RemoveSymbol(' ');
-                this.ChangedRenderResource(this, new ChangedRenderRsourceEventArgs(ResourceType.InlineChar));
             }
         }
 
@@ -317,7 +316,6 @@ namespace FooEditEngine
                     this.HiddenChars.AddSymbol(' ', 'ロ');
                 else
                     this.HiddenChars.RemoveSymbol(' ');
-                this.ChangedRenderResource(this, new ChangedRenderRsourceEventArgs(ResourceType.InlineChar));
             }
         }
 
@@ -338,7 +336,6 @@ namespace FooEditEngine
                     this.HiddenChars.AddSymbol('\t', '>');
                 else
                     this.HiddenChars.RemoveSymbol('\t');
-                this.ChangedRenderResource(this, new ChangedRenderRsourceEventArgs(ResourceType.InlineChar));
             }
         }
 
@@ -351,7 +348,6 @@ namespace FooEditEngine
             set
             {
                 this._ShowLineBreak = value;
-                this.ChangedRenderResource(this, new ChangedRenderRsourceEventArgs(ResourceType.InlineChar));
             }
         }
 
index 45cb2dc..15c11d7 100644 (file)
@@ -142,6 +142,7 @@ namespace FooEditEngine
         SemaphoreSlim Semaphore = new SemaphoreSlim(MaxSemaphoreCount);
         LineBreakMethod _LineBreak;
         int _TabStops, _LineBreakCharCount = 80;
+        bool _ShowFullSpace, _ShowHalfSpace, _ShowTab, _ShowLineBreak;
 
         /// <summary>
         /// 一行当たりの最大文字数
@@ -196,6 +197,77 @@ namespace FooEditEngine
         }
 
         /// <summary>
+        /// ShowFullSpace変更時に呼び出されるイベント
+        /// </summary>
+        public event EventHandler ShowFullSpaceChanged;
+
+        /// <summary>
+        /// 全角スペースを表示するかどうか
+        /// </summary>
+        public bool ShowFullSpace
+        {
+            get { return this._ShowFullSpace; }
+            set
+            {
+                this._ShowFullSpace = value;
+                this.ShowFullSpaceChanged(this, null);
+            }
+        }
+
+        /// <summary>
+        /// ShowHalfSpace変更時に呼び出されるイベント
+        /// </summary>
+        public event EventHandler ShowHalfSpaceChanged;
+
+        /// <summary>
+        /// 半角スペースを表示するかどうか
+        /// </summary>
+        public bool ShowHalfSpace
+        {
+            get { return this._ShowHalfSpace; }
+            set
+            {
+                this._ShowHalfSpace = value;
+                this.ShowHalfSpaceChanged(this, null);
+            }
+        }
+
+        /// <summary>
+        /// ShowTab変更時に呼び出されるイベント
+        /// </summary>
+        public event EventHandler ShowTabChanged;
+
+        /// <summary>
+        /// TABを表示するかどうか
+        /// </summary>
+        public bool ShowTab
+        {
+            get { return this._ShowTab; }
+            set
+            {
+                this._ShowTab = value;
+                this.ShowTabChanged(this, null);
+            }
+        }
+
+        /// <summary>
+        /// ShowLineBreak変更時に呼び出されるイベント
+        /// </summary>
+        public event EventHandler ShowLineBreakChanged;
+        /// <summary>
+        /// 改行を表示するかどうか
+        /// </summary>
+        public bool ShowLineBreak
+        {
+            get { return this._ShowLineBreak; }
+            set
+            {
+                this._ShowLineBreak = value;
+                this.ShowLineBreakChanged(this, null);
+            }
+        }
+
+        /// <summary>
         /// 選択範囲にあるグリッパーのリスト
         /// </summary>
         internal GripperRectangle SelectGrippers
index 78754d4..80ba5a5 100644 (file)
@@ -497,6 +497,26 @@ namespace FooEditEngine
         int TabWidthChar { get; set; }
 
         /// <summary>
+        /// 全角スペースを表示するかどうか
+        /// </summary>
+        bool ShowFullSpace { get; set; }
+
+        /// <summary>
+        /// 半角スペースを表示するかどうか
+        /// </summary>
+        bool ShowHalfSpace { get; set; }
+
+        /// <summary>
+        /// TABを表示するかどうか
+        /// </summary>
+        bool ShowTab { get; set; }
+
+        /// <summary>
+        /// 改行を表示するかどうか
+        /// </summary>
+        bool ShowLineBreak { get; set; }
+
+        /// <summary>
         /// 1文字当たりの高さと幅
         /// </summary>
         Size emSize { get; }
index 44928c3..e4752b2 100644 (file)
@@ -114,6 +114,26 @@ namespace FooEditEngine
             {
                 this.render.RightToLeft = this.Document.RightToLeft;
             };
+            this.Document.ShowFullSpaceChanged += (s, e) =>
+            {
+                this.render.ShowFullSpace = this.Document.ShowFullSpace;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowHalfSpaceChanged += (s, e) =>
+            {
+                this.render.ShowHalfSpace = this.Document.ShowHalfSpace;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowTabChanged += (s, e) =>
+            {
+                this.render.ShowTab = this.Document.ShowTab;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowLineBreakChanged += (s, e) =>
+            {
+                this.render.ShowLineBreak = this.Document.ShowLineBreak;
+                this._LayoutLines.ClearLayoutCache();
+            };
         }
 
         protected LineToIndexTable _LayoutLines
index a764471..0f2a28b 100644 (file)
@@ -1193,16 +1193,16 @@ namespace FooEditEngine.WPF
                     this.Document.UrlMark = this.MarkURL;
                     break;
                 case "ShowFullSpace":
-                    this.Render.ShowFullSpace = this.ShowFullSpace;
+                    this.Document.ShowFullSpace = this.ShowFullSpace;
                     break;
                 case "ShowHalfSpace":
-                    this.Render.ShowHalfSpace = this.ShowHalfSpace;
+                    this.Document.ShowHalfSpace = this.ShowHalfSpace;
                     break;
                 case "ShowTab":
-                    this.Render.ShowTab = this.ShowTab;
+                    this.Document.ShowTab = this.ShowTab;
                     break;
                 case "ShowLineBreak":
-                    this.Render.ShowLineBreak = this.ShowLineBreak;
+                    this.Document.ShowLineBreak = this.ShowLineBreak;
                     break;
                 case "FlowDirection":
                     this.Document.RightToLeft = this.FlowDirection == System.Windows.FlowDirection.RightToLeft;
index c2ddbb7..a1f9274 100644 (file)
@@ -349,6 +349,19 @@ namespace FooEditEngine.WPF
             set;
         }
 
+        public bool ShowLineBreak
+        {
+            get
+            {
+                throw new NotImplementedException();
+            }
+
+            set
+            {
+                throw new NotImplementedException();
+            }
+        }
+
         public event ChangedRenderResourceEventHandler ChangedRenderResource;
 
         public void DrawCachedBitmap(Rectangle rect)
index b83f38e..6c11233 100644 (file)
@@ -52,6 +52,30 @@ namespace UnitTest
             set;
         }
 
+        public bool ShowFullSpace
+        {
+            get;
+            set;
+        }
+
+        public bool ShowHalfSpace
+        {
+            get;
+            set;
+        }
+
+        public bool ShowTab
+        {
+            get;
+            set;
+        }
+
+        public bool ShowLineBreak
+        {
+            get;
+            set;
+        }
+
         public event ChangedRenderResourceEventHandler ChangedRenderResource;
 
         public event EventHandler ChangedRightToLeft;
index 7a55291..bc0888f 100644 (file)
@@ -329,11 +329,11 @@ namespace FooEditEngine.Windows
         {
             get
             {
-                return this.render.ShowFullSpace;
+                return this.Document.ShowFullSpace;
             }
             set
             {
-                this.render.ShowFullSpace = value;
+                this.Document.ShowFullSpace = value;
             }
         }
 
@@ -345,11 +345,11 @@ namespace FooEditEngine.Windows
         {
             get
             {
-                return this.render.ShowHalfSpace;
+                return this.Document.ShowHalfSpace;
             }
             set
             {
-                this.render.ShowHalfSpace = value;
+                this.Document.ShowHalfSpace = value;
             }
         }
 
@@ -361,11 +361,11 @@ namespace FooEditEngine.Windows
         {
             get
             {
-                return this.render.ShowTab;
+                return this.Document.ShowTab;
             }
             set
             {
-                this.render.ShowTab = value;
+                this.Document.ShowTab = value;
             }
         }
 
@@ -377,11 +377,11 @@ namespace FooEditEngine.Windows
         {
             get
             {
-                return this.render.ShowLineBreak;
+                return this.Document.ShowLineBreak;
             }
             set
             {
-                this.render.ShowLineBreak = value;
+                this.Document.ShowLineBreak = value;
             }
         }
 
index f2d58ec..68ea320 100644 (file)
@@ -256,5 +256,28 @@ namespace FooEditEngine.Windows
             set { this.sf.SetTabStops(0,new float[]{value});}
         }
 
+        public bool ShowFullSpace
+        {
+            get;
+            set;
+        }
+
+        public bool ShowHalfSpace
+        {
+            get;
+            set;
+        }
+
+        public bool ShowTab
+        {
+            get;
+            set;
+        }
+
+        public bool ShowLineBreak
+        {
+            get;
+            set;
+        }
     }
 }