diff options
| author | MichaelTheShifter <[email protected]> | 2016-07-20 09:40:36 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-07-20 09:40:36 -0400 |
| commit | d40fed5ce2bc806a91245adb18039634eac13ed0 (patch) | |
| tree | f1d7168aee6db109ac2c738ad18c9db667a6ba69 /source/ShiftUI/Design/Behavior | |
| parent | f1856e8ed30ed882229fd3fa2a4038122a5fb441 (diff) | |
| download | shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.tar.gz shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.tar.bz2 shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.zip | |
Move ShiftUI source code to ShiftOS
This'll be a lot easier to work on.
Diffstat (limited to 'source/ShiftUI/Design/Behavior')
| -rw-r--r-- | source/ShiftUI/Design/Behavior/Adorner.cs | 81 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/Behavior.cs | 155 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/BehaviorDragDropEventArgs.cs | 50 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/BehaviorDragDropEventHandler.cs | 36 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/BehaviorService.cs | 154 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollection.cs | 128 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollectionEnumerator.cs | 90 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/ComponentGlyph.cs | 73 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/ControlBodyGlyph.cs | 70 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/Glyph.cs | 70 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/GlyphCollection.cs | 111 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/GlyphSelectionType.cs | 41 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/SnapLine.cs | 133 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/SnapLinePriority.cs | 42 | ||||
| -rw-r--r-- | source/ShiftUI/Design/Behavior/SnapLineType.cs | 45 |
15 files changed, 1279 insertions, 0 deletions
diff --git a/source/ShiftUI/Design/Behavior/Adorner.cs b/source/ShiftUI/Design/Behavior/Adorner.cs new file mode 100644 index 0000000..f67c6af --- /dev/null +++ b/source/ShiftUI/Design/Behavior/Adorner.cs @@ -0,0 +1,81 @@ +// +// ShiftUI.Design.Behavior.Adorner +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public sealed class Adorner + { + public Adorner () + { + } + + [MonoTODO] + public void Invalidate () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Invalidate (Rectangle rectangle) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Invalidate (Region region) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public BehaviorService BehaviorService { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + + [MonoTODO] + public bool Enabled { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + + [MonoTODO] + public GlyphCollection Glyphs { + get { throw new NotImplementedException (); } + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/Behavior.cs b/source/ShiftUI/Design/Behavior/Behavior.cs new file mode 100644 index 0000000..df6185a --- /dev/null +++ b/source/ShiftUI/Design/Behavior/Behavior.cs @@ -0,0 +1,155 @@ +// +// ShiftUI.Design.Behavior.Behavior +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.ComponentModel.Design; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public abstract class Behavior + { + [MonoTODO] + protected Behavior () + { + throw new NotImplementedException (); + } + + [MonoTODO] + protected Behavior (bool callParentBehavior, BehaviorService behaviorService) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual Cursor Cursor { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public virtual bool DisableAllCommands { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public virtual MenuCommand FindCommand (CommandID commandId) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnDragDrop (Glyph g, DragEventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnDragEnter (Glyph g, DragEventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnDragLeave (Glyph g, EventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnDragOver (Glyph g, DragEventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnGiveFeedback (Glyph g, GiveFeedbackEventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnLoseCapture (Glyph g, EventArgs e) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseDoubleClick (Glyph g, MouseButtons button, Point mouseLoc) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseDown (Glyph g, MouseButtons button, Point mouseLoc) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseEnter (Glyph g) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseHover (Glyph g, Point mouseLoc) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseLeave (Glyph g) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseMove (Glyph g, MouseButtons button, Point mouseLoc) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool OnMouseUp (Glyph g, MouseButtons button) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnQueryContinueDrag (Glyph g, QueryContinueDragEventArgs e) + { + throw new NotImplementedException (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/BehaviorDragDropEventArgs.cs b/source/ShiftUI/Design/Behavior/BehaviorDragDropEventArgs.cs new file mode 100644 index 0000000..9a22361 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/BehaviorDragDropEventArgs.cs @@ -0,0 +1,50 @@ +// +// ShiftUI.Design.Behavior.BehaviorDragDropEventArgs +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; + +namespace ShiftUI.Design.Behavior +{ + public class BehaviorDragDropEventArgs : EventArgs + { + ICollection components; + + public BehaviorDragDropEventArgs (ICollection dragComponents) + { + this.components = dragComponents; + } + + public ICollection DragComponents { + get { return components; } + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/BehaviorDragDropEventHandler.cs b/source/ShiftUI/Design/Behavior/BehaviorDragDropEventHandler.cs new file mode 100644 index 0000000..83c1ef3 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/BehaviorDragDropEventHandler.cs @@ -0,0 +1,36 @@ +// +// ShiftUI.Design.Behavior.BehaviorDragDropEventHandler +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +namespace ShiftUI.Design.Behavior +{ + public delegate void BehaviorDragDropEventHandler (object sender, BehaviorDragDropEventArgs e); +} + diff --git a/source/ShiftUI/Design/Behavior/BehaviorService.cs b/source/ShiftUI/Design/Behavior/BehaviorService.cs new file mode 100644 index 0000000..cc741b1 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/BehaviorService.cs @@ -0,0 +1,154 @@ +// +// ShiftUI.Design.Behavior.BehaviorService +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public sealed class BehaviorService : IDisposable + { + internal BehaviorService () + { + } + + public event BehaviorDragDropEventHandler BeginDrag; + public event BehaviorDragDropEventHandler EndDrag; + public event EventHandler Synchronize; + + [MonoTODO] + public BehaviorServiceAdornerCollection Adorners { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public Graphics AdornerWindowGraphics { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public Behavior CurrentBehavior { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public Point AdornerWindowPointToScreen (Point p) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Point AdornerWindowToScreen () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Rectangle WidgetRectInAdornerWindow (Widget c) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Point WidgetToAdornerWindow (Widget c) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Dispose () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Behavior GetNextBehavior (Behavior behavior) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Invalidate () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Invalidate (Rectangle rect) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void Invalidate (Region r) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Point MapAdornerWindowPoint (IntPtr handle, Point pt) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Behavior PopBehavior (Behavior behavior) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void PushBehavior (Behavior behavior) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void PushCaptureBehavior (Behavior behavior) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public Point ScreenToAdornerWindow (Point p) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public void SyncSelection () + { + throw new NotImplementedException (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollection.cs b/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollection.cs new file mode 100644 index 0000000..2850cd4 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollection.cs @@ -0,0 +1,128 @@ +// +// ShiftUI.Design.Behavior.BehaviorServiceAdornerCollection +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Collections; + +namespace ShiftUI.Design.Behavior +{ + public sealed class BehaviorServiceAdornerCollection : CollectionBase + { + int state; + + public BehaviorServiceAdornerCollection (BehaviorService behaviorService) + : this (behaviorService.Adorners) + { + } + + public BehaviorServiceAdornerCollection (Adorner [] value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public BehaviorServiceAdornerCollection (BehaviorServiceAdornerCollection value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + internal int State { + get { return state; } + } + + public Adorner this [int index] { + get { return (Adorner) InnerList [index]; } + set { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList [index] = value; + } + } + + public int Add (Adorner value) + { + state++; + return InnerList.Add (value); + } + + public void AddRange (Adorner [] value) + { + state++; + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public void AddRange (BehaviorServiceAdornerCollection value) + { + state++; + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public bool Contains (Adorner value) + { + return InnerList.Contains (value); + } + + public void CopyTo (Adorner [] array, int index) + { + InnerList.CopyTo (array, index); + } + + public int IndexOf (Adorner value) + { + return InnerList.IndexOf (value); + } + + public BehaviorServiceAdornerCollectionEnumerator GetEnumerator () + { + return new BehaviorServiceAdornerCollectionEnumerator (this); + } + + public void Insert (int index, Adorner value) + { + state++; + InnerList.Insert (index, value); + } + + public void Remove (Adorner value) + { + state++; + InnerList.Remove (value); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollectionEnumerator.cs b/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollectionEnumerator.cs new file mode 100644 index 0000000..a4e9138 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/BehaviorServiceAdornerCollectionEnumerator.cs @@ -0,0 +1,90 @@ +// +// ShiftUI.Design.Behavior.BehaviorServiceAdornerCollectionEnumerator +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Collections; + +namespace ShiftUI.Design.Behavior +{ + public class BehaviorServiceAdornerCollectionEnumerator : IEnumerator + { + BehaviorServiceAdornerCollection mappings; + int index, state; + + public BehaviorServiceAdornerCollectionEnumerator (BehaviorServiceAdornerCollection mappings) + { + if (mappings == null) + throw new ArgumentNullException ("mappings"); + this.mappings = mappings; + + Reset (); + } + + public Adorner Current { + get { return index < 0 ? null : mappings [index]; } + } + + void CheckState () + { + if (mappings.State != state) + throw new InvalidOperationException ("Collection has changed"); + } + + public bool MoveNext () + { + CheckState (); + if (index++ < mappings.Count) + return true; + index--; + return false; + } + + public void Reset () + { + index = -1; + } + + object IEnumerator.Current { + get { return Current; } + } + + bool IEnumerator.MoveNext () + { + return MoveNext (); + } + + void IEnumerator.Reset () + { + Reset (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/ComponentGlyph.cs b/source/ShiftUI/Design/Behavior/ComponentGlyph.cs new file mode 100644 index 0000000..0f8c53b --- /dev/null +++ b/source/ShiftUI/Design/Behavior/ComponentGlyph.cs @@ -0,0 +1,73 @@ +// +// ShiftUI.Design.Behavior.ComponentGlyph +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public class ComponentGlyph : Glyph + { + IComponent component; + + public ComponentGlyph (IComponent relatedComponent) + : this (relatedComponent, null) + { + } + + public ComponentGlyph (IComponent relatedComponent, Behavior behavior) + : base (behavior) + { + this.component = relatedComponent; + } + + [MonoTODO] + public IComponent RelatedComponent { + get { return component; } + } + + [MonoTODO] + public override Cursor GetHitTest (Point p) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public override void Paint (PaintEventArgs pe) + { + throw new NotImplementedException (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/ControlBodyGlyph.cs b/source/ShiftUI/Design/Behavior/ControlBodyGlyph.cs new file mode 100644 index 0000000..547eea1 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/ControlBodyGlyph.cs @@ -0,0 +1,70 @@ +// +// ShiftUI.Design.Behavior.WidgetBodyGlyph +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public class WidgetBodyGlyph : ComponentGlyph + { + Rectangle bounds; + + [MonoTODO] + public WidgetBodyGlyph (Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior) + : base (relatedComponent, behavior) + { + this.bounds = bounds; + throw new NotImplementedException (); + } + + [MonoTODO] + public WidgetBodyGlyph (Rectangle bounds, Cursor cursor, IComponent relatedComponent, WidgetDesigner designer) + : this (bounds, cursor, relatedComponent, designer.BehaviorService.CurrentBehavior) + { + } + + [MonoTODO] + public override Rectangle Bounds { + get { return bounds; } + } + + [MonoTODO] + public override Cursor GetHitTest (Point p) + { + throw new NotImplementedException (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/Glyph.cs b/source/ShiftUI/Design/Behavior/Glyph.cs new file mode 100644 index 0000000..3452627 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/Glyph.cs @@ -0,0 +1,70 @@ +// +// ShiftUI.Design.Behavior.Glyph +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; + +namespace ShiftUI.Design.Behavior +{ + public abstract class Glyph + { + Behavior behavior; + + [MonoTODO] + protected Glyph (Behavior behavior) + { + SetBehavior (behavior); + } + + [MonoTODO] + public virtual Behavior Behavior { + get { return behavior; } + } + + [MonoTODO] + public virtual Rectangle Bounds { + get { throw new NotImplementedException (); } + } + + public abstract Cursor GetHitTest (Point p); + + public abstract void Paint (PaintEventArgs pe); + + [MonoTODO] + protected void SetBehavior (Behavior behavior) + { + throw new NotImplementedException (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/GlyphCollection.cs b/source/ShiftUI/Design/Behavior/GlyphCollection.cs new file mode 100644 index 0000000..d19e689 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/GlyphCollection.cs @@ -0,0 +1,111 @@ +// +// ShiftUI.Design.Behavior.GlyphCollection +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System; +using System.Collections; + +namespace ShiftUI.Design.Behavior +{ + public class GlyphCollection : CollectionBase + { + public GlyphCollection () + { + } + + public GlyphCollection (Glyph [] value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public GlyphCollection (GlyphCollection value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public Glyph this [int index] { + get { return (Glyph) InnerList [index]; } + set { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList [index] = value; + } + } + + public int Add (Glyph value) + { + return InnerList.Add (value); + } + + public void AddRange (Glyph [] value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public void AddRange (GlyphCollection value) + { + if (value == null) + throw new ArgumentNullException ("value"); + InnerList.AddRange (value); + } + + public bool Contains (Glyph value) + { + return InnerList.Contains (value); + } + + public void CopyTo (Glyph [] array, int index) + { + InnerList.CopyTo (array, index); + } + + public int IndexOf (Glyph value) + { + return InnerList.IndexOf (value); + } + + public void Insert (int index, Glyph value) + { + InnerList.Insert (index, value); + } + + public void Remove (Glyph value) + { + InnerList.Remove (value); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/GlyphSelectionType.cs b/source/ShiftUI/Design/Behavior/GlyphSelectionType.cs new file mode 100644 index 0000000..6220c03 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/GlyphSelectionType.cs @@ -0,0 +1,41 @@ +// +// ShiftUI.Design.Behavior.GlyphSelectionType +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +namespace ShiftUI.Design.Behavior +{ + public enum GlyphSelectionType + { + NotSelected, + Selected, + SelectedPrimary + } +} + diff --git a/source/ShiftUI/Design/Behavior/SnapLine.cs b/source/ShiftUI/Design/Behavior/SnapLine.cs new file mode 100644 index 0000000..3b7da92 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/SnapLine.cs @@ -0,0 +1,133 @@ +// +// ShiftUI.Design.Behavior.SnapLine +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + + +using System; + +namespace ShiftUI.Design.Behavior +{ + public sealed class SnapLine + { + [MonoTODO] + public static bool ShouldSnap (SnapLine line1, SnapLine line2) + { + throw new NotImplementedException (); + } + + SnapLineType type; + int offset; + string filter; + SnapLinePriority priority; + + [MonoTODO] + public SnapLine (SnapLineType type, int offset) + : this (type, offset, null) + { + } + + [MonoTODO] + public SnapLine (SnapLineType type, int offset, string filter) + : this (type, offset, filter, default (SnapLinePriority)) + { + } + + [MonoTODO] + public SnapLine (SnapLineType type, int offset, SnapLinePriority priority) + : this (type, offset, null, priority) + { + } + + [MonoTODO] + public SnapLine (SnapLineType type, int offset, string filter, SnapLinePriority priority) + { + this.type =type; + this.offset = offset; + this.filter = filter; + this.priority = priority; + } + + public string Filter { + get { return filter; } + } + + public bool IsHorizontal { + get { + switch (SnapLineType) { + case SnapLineType.Top: + case SnapLineType.Bottom: + case SnapLineType.Horizontal: + case SnapLineType.Baseline: + return true; + default: + return false; + } + } + } + + public bool IsVertical { + get { + switch (SnapLineType) { + case SnapLineType.Left: + case SnapLineType.Right: + case SnapLineType.Vertical: + return true; + default: + return false; + } + } + } + + public int Offset { + get { return offset; } + } + + public SnapLinePriority Priority { + get { return priority; } + } + + public SnapLineType SnapLineType { + get { return type; } + } + + [MonoTODO] + public void AdjustOffset (int adjustment) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public override string ToString () + { + return base.ToString (); + } + } +} + diff --git a/source/ShiftUI/Design/Behavior/SnapLinePriority.cs b/source/ShiftUI/Design/Behavior/SnapLinePriority.cs new file mode 100644 index 0000000..b0dff04 --- /dev/null +++ b/source/ShiftUI/Design/Behavior/SnapLinePriority.cs @@ -0,0 +1,42 @@ +// +// ShiftUI.Design.Behavior.SnapLinePriority +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +namespace ShiftUI.Design.Behavior +{ + public enum SnapLinePriority + { + Low = 1, + Medium, + High, + Always + } +} + diff --git a/source/ShiftUI/Design/Behavior/SnapLineType.cs b/source/ShiftUI/Design/Behavior/SnapLineType.cs new file mode 100644 index 0000000..a0b294b --- /dev/null +++ b/source/ShiftUI/Design/Behavior/SnapLineType.cs @@ -0,0 +1,45 @@ +// +// ShiftUI.Design.Behavior.SnapLineType +// +// Author: +// Atsushi Enomoto ([email protected]) +// +// Copyright (C) 2007 Novell, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +namespace ShiftUI.Design.Behavior +{ + public enum SnapLineType + { + Top, + Bottom, + Left, + Right, + Horizontal, + Vertical, + Baseline + } +} + |
