Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVsevolod Kukol <sevoku@microsoft.com>2017-02-12 18:37:35 +0300
committerVsevolod Kukol <sevoku@microsoft.com>2017-02-12 18:37:35 +0300
commitfb6c9996da67d69523e69c04657ad6c6cc3110fc (patch)
tree10fd5043761db442d0c3bcb8d0205bcd1e46f46e
parent1413b1bb0c6d26c2c952504e23027b7b11d72eca (diff)
[Mac] Remove deprecated MonoMac code
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs16
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/CellUtil.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/CellViewBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/CheckBoxTableCell.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/CompositeCell.cs23
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/ICellSource.cs6
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/ImageTableCell.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac.CellViews/TextTableCell.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/BoxBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ButtonBackend.cs26
-rw-r--r--Xwt.XamMac/Xwt.Mac/CalendarBackend.cs14
-rw-r--r--Xwt.XamMac/Xwt.Mac/CheckBoxBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ColorPickerBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ComboBoxBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ComboBoxEntryBackend.cs20
-rw-r--r--Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs20
-rw-r--r--Xwt.XamMac/Xwt.Mac/CustomWidgetBackend.cs11
-rw-r--r--Xwt.XamMac/Xwt.Mac/DatePickerBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/DialogBackend.cs20
-rw-r--r--Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs15
-rw-r--r--Xwt.XamMac/Xwt.Mac/ExpanderBackend.cs24
-rw-r--r--Xwt.XamMac/Xwt.Mac/FileDialogBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/FontBackendHandler.cs17
-rw-r--r--Xwt.XamMac/Xwt.Mac/FrameBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/IViewObject.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ImageBuilderBackendHandler.cs14
-rw-r--r--Xwt.XamMac/Xwt.Mac/ImageHandler.cs26
-rw-r--r--Xwt.XamMac/Xwt.Mac/ImagePatternBackendHandler.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/ImageViewBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs8
-rw-r--r--Xwt.XamMac/Xwt.Mac/LabelBackend.cs19
-rw-r--r--Xwt.XamMac/Xwt.Mac/LinkLabelBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/ListBoxBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ListViewBackend.cs16
-rw-r--r--Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/MacEngine.cs18
-rw-r--r--Xwt.XamMac/Xwt.Mac/MacKeyboardHandler.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac/MenuBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/MenuButtonBackend.cs16
-rw-r--r--Xwt.XamMac/Xwt.Mac/MenuItemBackend.cs120
-rw-r--r--Xwt.XamMac/Xwt.Mac/Messaging.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs7
-rw-r--r--Xwt.XamMac/Xwt.Mac/NSTableViewBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/NotebookBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/ObjcHelper.cs7
-rw-r--r--Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/PanedBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs18
-rw-r--r--Xwt.XamMac/Xwt.Mac/PopoverBackend.cs18
-rw-r--r--Xwt.XamMac/Xwt.Mac/ProgressBarBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/RadioButtonBackend.cs14
-rw-r--r--Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs30
-rw-r--r--Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs10
-rw-r--r--Xwt.XamMac/Xwt.Mac/ScrollAdjustmentBackend.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs14
-rw-r--r--Xwt.XamMac/Xwt.Mac/ScrollbarBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/SelectFolderDialogBackend.cs15
-rw-r--r--Xwt.XamMac/Xwt.Mac/SelectFontDialogBackend.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac/SeparatorBackend.cs11
-rw-r--r--Xwt.XamMac/Xwt.Mac/SeparatorMenuItemBackend.cs9
-rw-r--r--Xwt.XamMac/Xwt.Mac/SliderBackend.cs11
-rw-r--r--Xwt.XamMac/Xwt.Mac/SpinButtonBackend.cs18
-rw-r--r--Xwt.XamMac/Xwt.Mac/SpinnerBackend.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/StatusIconBackend.cs11
-rw-r--r--Xwt.XamMac/Xwt.Mac/TableViewBackend.cs19
-rw-r--r--Xwt.XamMac/Xwt.Mac/TextEntryBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs23
-rw-r--r--Xwt.XamMac/Xwt.Mac/ToggleButtonBackend.cs15
-rw-r--r--Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs13
-rw-r--r--Xwt.XamMac/Xwt.Mac/Util.cs92
-rw-r--r--Xwt.XamMac/Xwt.Mac/ViewBackend.cs24
-rw-r--r--Xwt.XamMac/Xwt.Mac/WebViewBackend.cs14
-rw-r--r--Xwt.XamMac/Xwt.Mac/WidgetView.cs12
-rw-r--r--Xwt.XamMac/Xwt.Mac/WindowBackend.cs32
79 files changed, 209 insertions, 1083 deletions
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs
index ac113548..e5ff7a03 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs
@@ -24,21 +24,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using System.Drawing;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.CoreGraphics;
-using MonoMac.AppKit;
-#else
-using CoreGraphics;
using AppKit;
-#endif
+using CoreGraphics;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CellUtil.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CellUtil.cs
index 6eb3850d..053c80d0 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/CellUtil.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/CellUtil.cs
@@ -26,16 +26,8 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CellViewBackend.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CellViewBackend.cs
index 3dd94302..6dabbb65 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/CellViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/CellViewBackend.cs
@@ -23,16 +23,8 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CheckBoxTableCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CheckBoxTableCell.cs
index 2037b52f..55380955 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/CheckBoxTableCell.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/CheckBoxTableCell.cs
@@ -24,15 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CompositeCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CompositeCell.cs
index 00b5c17d..40aea638 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/CompositeCell.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/CompositeCell.cs
@@ -26,24 +26,12 @@
using System;
-using Xwt.Backends;
using System.Collections.Generic;
-using System.Drawing;
using System.Linq;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -63,11 +51,6 @@ namespace Xwt.Mac
}
}
- static CompositeCell ()
- {
- Util.MakeCopiable<CompositeCell> ();
- }
-
public CompositeCell (ApplicationContext context, Orientation dir, ICellSource source)
{
if (source == null)
@@ -104,14 +87,12 @@ namespace Xwt.Mac
source.SetCurrentEventRow (tablePosition.Position);
}
-#if !MONOMAC
public override NSObject Copy (NSZone zone)
{
var ob = (ICopiableObject) base.Copy (zone);
ob.CopyFrom (this);
return (NSObject) ob;
}
-#endif
void ICopiableObject.CopyFrom (object other)
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/ICellSource.cs b/Xwt.XamMac/Xwt.Mac.CellViews/ICellSource.cs
index f9d8674f..95c51a7b 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/ICellSource.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/ICellSource.cs
@@ -24,14 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
using System;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-#endif
-
namespace Xwt.Mac
{
interface ICellSource
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/ImageTableCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/ImageTableCell.cs
index 8654db50..204e08b6 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/ImageTableCell.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/ImageTableCell.cs
@@ -25,20 +25,9 @@
// THE SOFTWARE.
using System;
-
-using Xwt.Drawing;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/TextTableCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/TextTableCell.cs
index 9cd94acb..be255e33 100644
--- a/Xwt.XamMac/Xwt.Mac.CellViews/TextTableCell.cs
+++ b/Xwt.XamMac/Xwt.Mac.CellViews/TextTableCell.cs
@@ -26,15 +26,8 @@
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
index 820c95ad..56f21b7a 100644
--- a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
@@ -25,20 +25,9 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-using System.Drawing;
-#else
using AppKit;
-using Foundation;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/BoxBackend.cs b/Xwt.XamMac/Xwt.Mac/BoxBackend.cs
index bcc04b13..be9485dc 100644
--- a/Xwt.XamMac/Xwt.Mac/BoxBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/BoxBackend.cs
@@ -25,17 +25,9 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using MonoMac.AppKit;
-#else
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ButtonBackend.cs b/Xwt.XamMac/Xwt.Mac/ButtonBackend.cs
index c04bfdaa..76eeb9b8 100644
--- a/Xwt.XamMac/Xwt.Mac/ButtonBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ButtonBackend.cs
@@ -25,21 +25,11 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-using MonoMac.ObjCRuntime;
-using CGRect = System.Drawing.RectangleF;
-#else
using AppKit;
using CoreGraphics;
using Foundation;
-#endif
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
@@ -124,28 +114,16 @@ namespace Xwt.Mac
Widget.BezelStyle = NSBezelStyle.RegularSquare;
else
Widget.BezelStyle = NSBezelStyle.Rounded;
-#if MONOMAC
- Messaging.void_objc_msgSend_bool (Widget.Handle, selSetShowsBorderOnlyWhileMouseInside.Handle, false);
-#else
Widget.ShowsBorderOnlyWhileMouseInside = false;
-#endif
break;
case ButtonStyle.Borderless:
case ButtonStyle.Flat:
Widget.BezelStyle = NSBezelStyle.ShadowlessSquare;
-#if MONOMAC
- Messaging.void_objc_msgSend_bool (Widget.Handle, selSetShowsBorderOnlyWhileMouseInside.Handle, true);
-#else
Widget.ShowsBorderOnlyWhileMouseInside = true;
-#endif
break;
}
}
}
-
-#if MONOMAC
- protected static Selector selSetShowsBorderOnlyWhileMouseInside = new Selector ("setShowsBorderOnlyWhileMouseInside:");
-#endif
public void SetButtonType (ButtonType type)
{
diff --git a/Xwt.XamMac/Xwt.Mac/CalendarBackend.cs b/Xwt.XamMac/Xwt.Mac/CalendarBackend.cs
index 1b53678d..3e52a415 100644
--- a/Xwt.XamMac/Xwt.Mac/CalendarBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/CalendarBackend.cs
@@ -25,19 +25,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-
-
-
-
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/CheckBoxBackend.cs b/Xwt.XamMac/Xwt.Mac/CheckBoxBackend.cs
index 9ffe6884..3532f77c 100644
--- a/Xwt.XamMac/Xwt.Mac/CheckBoxBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/CheckBoxBackend.cs
@@ -23,16 +23,8 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ColorPickerBackend.cs b/Xwt.XamMac/Xwt.Mac/ColorPickerBackend.cs
index e1d38b96..49b40f76 100644
--- a/Xwt.XamMac/Xwt.Mac/ColorPickerBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ColorPickerBackend.cs
@@ -23,16 +23,8 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ComboBoxBackend.cs b/Xwt.XamMac/Xwt.Mac/ComboBoxBackend.cs
index a6f8c863..af734970 100644
--- a/Xwt.XamMac/Xwt.Mac/ComboBoxBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ComboBoxBackend.cs
@@ -49,16 +49,8 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ComboBoxEntryBackend.cs b/Xwt.XamMac/Xwt.Mac/ComboBoxEntryBackend.cs
index b25bb9d3..34860feb 100644
--- a/Xwt.XamMac/Xwt.Mac/ComboBoxEntryBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ComboBoxEntryBackend.cs
@@ -24,17 +24,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -101,11 +93,7 @@ namespace Xwt.Mac
#endregion
}
- #if MONOMAC
- class MacComboBox: NSComboBox, IViewObject
- #else
class MacComboBox : NSComboBox, IViewObject, INSComboBoxDelegate
- #endif
{
IComboBoxEventSink eventSink;
ITextEntryEventSink entryEventSink;
@@ -118,9 +106,7 @@ namespace Xwt.Mac
{
this.context = context;
this.eventSink = eventSink;
- #if !MONOMAC
Delegate = this;
- #endif
}
public void SetEntryEventSink (ITextEntryEventSink entryEventSink)
@@ -136,7 +122,6 @@ namespace Xwt.Mac
public ViewBackend Backend { get; set; }
- #if !MONOMAC
[Export ("comboBoxSelectionDidChange:")]
public new void SelectionChanged (NSNotification notification)
{
@@ -147,7 +132,6 @@ namespace Xwt.Mac
});
}
}
- #endif
public override void DidChange (NSNotification notification)
{
diff --git a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs
index 73b666d0..c433354d 100644
--- a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs
@@ -26,25 +26,11 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-using Xwt.Drawing;
-using System.Drawing;
using System.Collections.Generic;
-using System.Linq;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.CoreGraphics;
-using MonoMac.AppKit;
-#else
-using CoreGraphics;
using AppKit;
-#endif
+using CoreGraphics;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/CustomWidgetBackend.cs b/Xwt.XamMac/Xwt.Mac/CustomWidgetBackend.cs
index daf1650d..f8bb53dc 100644
--- a/Xwt.XamMac/Xwt.Mac/CustomWidgetBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/CustomWidgetBackend.cs
@@ -23,18 +23,9 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-#else
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/DatePickerBackend.cs b/Xwt.XamMac/Xwt.Mac/DatePickerBackend.cs
index dcd12b72..4443d335 100644
--- a/Xwt.XamMac/Xwt.Mac/DatePickerBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/DatePickerBackend.cs
@@ -24,17 +24,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs
index 3e79cd37..833e46ea 100644
--- a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs
@@ -24,25 +24,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using System.Linq;
-using Xwt.Backends;
-using Xwt.Drawing;
using System.Collections.Generic;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-#else
-using Foundation;
+using System.Linq;
using AppKit;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs b/Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs
index 4de77253..242baf7c 100644
--- a/Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs
@@ -1,18 +1,5 @@
-using System;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ExpanderBackend.cs b/Xwt.XamMac/Xwt.Mac/ExpanderBackend.cs
index 7b768f46..caba6beb 100644
--- a/Xwt.XamMac/Xwt.Mac/ExpanderBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ExpanderBackend.cs
@@ -1,23 +1,9 @@
using System;
-
-using Xwt;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using CGSize = System.Drawing.SizeF;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using Foundation;
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -302,11 +288,7 @@ namespace Xwt.Mac
if (animating) {
NSAnimation animation = new NSViewAnimation (new [] {
NSDictionary.FromObjectsAndKeys (
-#if MONOMAC
- new object[] { this, NSValue.FromRectangleF (Frame), NSValue.FromRectangleF (newFrame) },
-#else
new object[] { this, NSValue.FromCGRect (Frame), NSValue.FromCGRect (newFrame) },
-#endif
new object[] { NSViewAnimation.TargetKey, NSViewAnimation.StartFrameKey, NSViewAnimation.EndFrameKey }
)
});
diff --git a/Xwt.XamMac/Xwt.Mac/FileDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/FileDialogBackend.cs
index 72e87d4d..f1e46fbc 100644
--- a/Xwt.XamMac/Xwt.Mac/FileDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/FileDialogBackend.cs
@@ -23,19 +23,10 @@
// 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 Xwt.Backends;
using System.Linq;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/FontBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/FontBackendHandler.cs
index ad8ef990..e10a0110 100644
--- a/Xwt.XamMac/Xwt.Mac/FontBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/FontBackendHandler.cs
@@ -25,23 +25,14 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-using Xwt.Drawing;
using System.Collections.Generic;
-using System.Text;
using System.Globalization;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreText;
-#else
-using Foundation;
+using System.Text;
using AppKit;
using CoreText;
-#endif
+using Foundation;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/FrameBackend.cs b/Xwt.XamMac/Xwt.Mac/FrameBackend.cs
index 157b642b..199362cf 100644
--- a/Xwt.XamMac/Xwt.Mac/FrameBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/FrameBackend.cs
@@ -24,20 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using AppKit;
+using CoreGraphics;
using Xwt.Backends;
using Xwt.Drawing;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using CGRect = System.Drawing.RectangleF;
-using MonoMac.AppKit;
-#else
-using CoreGraphics;
-using AppKit;
-#endif
-
namespace Xwt.Mac
{
public class FrameBackend: ViewBackend<NSBox,IFrameEventSink>, IFrameBackend
diff --git a/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs
index cb19181b..2735fc02 100644
--- a/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs
@@ -25,19 +25,9 @@
// THE SOFTWARE.
using System;
-using System.Drawing;
-using Xwt.Backends;
-using Xwt.Drawing;
using System.Collections.Generic;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGPoint = System.Drawing.PointF;
-using MonoMac.CoreGraphics;
-#else
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/IViewObject.cs b/Xwt.XamMac/Xwt.Mac/IViewObject.cs
index 46910d2c..d2d35057 100644
--- a/Xwt.XamMac/Xwt.Mac/IViewObject.cs
+++ b/Xwt.XamMac/Xwt.Mac/IViewObject.cs
@@ -24,17 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ImageBuilderBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/ImageBuilderBackendHandler.cs
index 08979280..a51667ca 100644
--- a/Xwt.XamMac/Xwt.Mac/ImageBuilderBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/ImageBuilderBackendHandler.cs
@@ -24,20 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using AppKit;
+using CoreGraphics;
using Xwt.Backends;
using Xwt.Drawing;
-using System.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.CoreGraphics;
-using MonoMac.AppKit;
-#else
-using CoreGraphics;
-using AppKit;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ImageHandler.cs b/Xwt.XamMac/Xwt.Mac/ImageHandler.cs
index 2880f814..ff805ddc 100644
--- a/Xwt.XamMac/Xwt.Mac/ImageHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/ImageHandler.cs
@@ -25,30 +25,16 @@
// THE SOFTWARE.
using System;
-using System.Linq;
-using Xwt.Backends;
-using System.Drawing;
using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using Xwt.Drawing;
using System.IO;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using MonoMac.CoreGraphics;
-#else
-using Foundation;
+using System.Linq;
+using System.Runtime.InteropServices;
using AppKit;
using CoreGraphics;
+using Foundation;
using ObjCRuntime;
-#endif
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
@@ -352,12 +338,10 @@ namespace Xwt.Mac
return new CustomImage (actx, drawCallback);
}
- #if !MONOMAC
public override NSObject Copy (NSZone zone)
{
return new CustomImage (actx, drawCallback);
}
- #endif
}
}
diff --git a/Xwt.XamMac/Xwt.Mac/ImagePatternBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/ImagePatternBackendHandler.cs
index 17422221..c7621c33 100644
--- a/Xwt.XamMac/Xwt.Mac/ImagePatternBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/ImagePatternBackendHandler.cs
@@ -23,19 +23,8 @@
// 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 Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ImageViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ImageViewBackend.cs
index 219b2aed..a152c931 100644
--- a/Xwt.XamMac/Xwt.Mac/ImageViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ImageViewBackend.cs
@@ -23,19 +23,8 @@
// 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 Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.ObjCRuntime;
-using MonoMac.AppKit;
-#else
-using ObjCRuntime;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs b/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs
index 63002dec..50f3b981 100644
--- a/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs
+++ b/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs
@@ -23,15 +23,9 @@
// 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;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
+using System;
using AppKit;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/LabelBackend.cs b/Xwt.XamMac/Xwt.Mac/LabelBackend.cs
index a9cc182c..97cbe13d 100644
--- a/Xwt.XamMac/Xwt.Mac/LabelBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/LabelBackend.cs
@@ -25,21 +25,10 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using CGRect = System.Drawing.RectangleF;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using MonoMac.CoreGraphics;
-#else
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -227,11 +216,7 @@ namespace Xwt.Mac
if (expandVertically)
Child.Frame = new CGRect (0, 0, Frame.Width, Frame.Height);
else {
-#if MONOMAC
- Child.Frame = new System.Drawing.RectangleF (0, (Frame.Height - Child.Frame.Height) / 2, Frame.Width, Child.Frame.Height);
-#else
Child.Frame = new CGRect (0, (Frame.Height - Child.Frame.Height) / 2, Frame.Width, Child.Frame.Height);
-#endif
}
Child.NeedsDisplay = true;
}
diff --git a/Xwt.XamMac/Xwt.Mac/LinkLabelBackend.cs b/Xwt.XamMac/Xwt.Mac/LinkLabelBackend.cs
index 7f2da131..9fbcf930 100644
--- a/Xwt.XamMac/Xwt.Mac/LinkLabelBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/LinkLabelBackend.cs
@@ -25,17 +25,9 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ListBoxBackend.cs b/Xwt.XamMac/Xwt.Mac/ListBoxBackend.cs
index 5767e512..aad70347 100644
--- a/Xwt.XamMac/Xwt.Mac/ListBoxBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ListBoxBackend.cs
@@ -23,16 +23,10 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
+using System;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs
index 0b5648e6..2c223b02 100644
--- a/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs
@@ -28,22 +28,10 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-#else
-using Foundation;
using AppKit;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs b/Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs
index f3000e3d..c7a2d5e8 100644
--- a/Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/MacClipboardBackend.cs
@@ -23,20 +23,13 @@
// 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.IO;
using System.Linq;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs b/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs
index 94957955..c52fa9a2 100644
--- a/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs
@@ -23,21 +23,12 @@
// 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 Xwt.Backends;
using System.Collections.Generic;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGPoint = System.Drawing.PointF;
-using CGRect = System.Drawing.RectangleF;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MacEngine.cs b/Xwt.XamMac/Xwt.Mac/MacEngine.cs
index aa6e62fc..3af46cf5 100644
--- a/Xwt.XamMac/Xwt.Mac/MacEngine.cs
+++ b/Xwt.XamMac/Xwt.Mac/MacEngine.cs
@@ -25,24 +25,12 @@
// THE SOFTWARE.
using System;
-
using System.Collections.Generic;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using MonoMac.CoreGraphics;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using Foundation;
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MacKeyboardHandler.cs b/Xwt.XamMac/Xwt.Mac/MacKeyboardHandler.cs
index 36b5f351..d8707cbb 100644
--- a/Xwt.XamMac/Xwt.Mac/MacKeyboardHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/MacKeyboardHandler.cs
@@ -23,16 +23,9 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MenuBackend.cs b/Xwt.XamMac/Xwt.Mac/MenuBackend.cs
index c8957c5c..d54db859 100644
--- a/Xwt.XamMac/Xwt.Mac/MenuBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/MenuBackend.cs
@@ -24,16 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MenuButtonBackend.cs b/Xwt.XamMac/Xwt.Mac/MenuButtonBackend.cs
index f7d288bb..4eaac2be 100644
--- a/Xwt.XamMac/Xwt.Mac/MenuButtonBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/MenuButtonBackend.cs
@@ -24,21 +24,13 @@
// 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 Xwt.Backends;
-using Xwt.Drawing;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using CGRect = System.Drawing.RectangleF;
-#else
-using Foundation;
+using System;
using AppKit;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/MenuItemBackend.cs b/Xwt.XamMac/Xwt.Mac/MenuItemBackend.cs
index dd3e3083..062775c3 100644
--- a/Xwt.XamMac/Xwt.Mac/MenuItemBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/MenuItemBackend.cs
@@ -25,22 +25,13 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
using System.Collections.Generic;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
- public class MenuItemBackend: IMenuItemBackend
+ public class MenuItemBackend : IMenuItemBackend
{
NSMenuItem item;
IMenuItemEventSink eventSink;
@@ -48,26 +39,27 @@ namespace Xwt.Mac
ApplicationContext context;
string label;
bool useMnemonic;
-
- public MenuItemBackend (): this (new NSMenuItem ())
+
+ public MenuItemBackend() : this(new NSMenuItem())
{
}
-
- public MenuItemBackend (NSMenuItem item)
+
+ public MenuItemBackend(NSMenuItem item)
{
this.item = item;
}
-
- public NSMenuItem Item {
+
+ public NSMenuItem Item
+ {
get { return item; }
}
-
- public void Initialize (IMenuItemEventSink eventSink)
+
+ public void Initialize(IMenuItemEventSink eventSink)
{
this.eventSink = eventSink;
}
- public void SetSubmenu (IMenuBackend menu)
+ public void SetSubmenu(IMenuBackend menu)
{
if (menu == null)
item.Submenu = null;
@@ -75,92 +67,110 @@ namespace Xwt.Mac
item.Submenu = ((MenuBackend)menu);
}
- public string Label {
- get {
+ public string Label
+ {
+ get
+ {
return label;
}
- set {
- item.Title = UseMnemonic ? value.RemoveMnemonic () : value;
+ set
+ {
+ item.Title = UseMnemonic ? value.RemoveMnemonic() : value;
label = value;
}
}
- public bool UseMnemonic {
- get {
+ public bool UseMnemonic
+ {
+ get
+ {
return useMnemonic;
}
- set {
+ set
+ {
useMnemonic = value;
Label = label ?? string.Empty;
}
}
-
- public void SetImage (ImageDescription image)
+
+ public void SetImage(ImageDescription image)
{
- item.Image = image.ToNSImage ();
+ item.Image = image.ToNSImage();
}
-
- public bool Visible {
- get {
+
+ public bool Visible
+ {
+ get
+ {
return !item.Hidden;
}
- set {
+ set
+ {
item.Hidden = !value;
}
}
-
- public bool Sensitive {
- get {
+
+ public bool Sensitive
+ {
+ get
+ {
return item.Enabled;
}
- set {
+ set
+ {
item.Enabled = value;
}
}
-
- public bool Checked {
- get {
+
+ public bool Checked
+ {
+ get
+ {
return item.State == NSCellStateValue.On;
}
- set {
+ set
+ {
if (value)
item.State = NSCellStateValue.On;
else
item.State = NSCellStateValue.Off;
}
}
-
+
#region IBackend implementation
- public void InitializeBackend (object frontend, ApplicationContext context)
+ public void InitializeBackend(object frontend, ApplicationContext context)
{
this.context = context;
}
- public void EnableEvent (object eventId)
+ public void EnableEvent(object eventId)
{
- if (eventId is MenuItemEvent) {
+ if (eventId is MenuItemEvent)
+ {
if (enabledEvents == null)
- enabledEvents = new List<MenuItemEvent> ();
- enabledEvents.Add ((MenuItemEvent)eventId);
+ enabledEvents = new List<MenuItemEvent>();
+ enabledEvents.Add((MenuItemEvent)eventId);
if ((MenuItemEvent)eventId == MenuItemEvent.Clicked)
item.Activated += HandleItemActivated;
}
}
- public void DisableEvent (object eventId)
+ public void DisableEvent(object eventId)
{
- if (eventId is MenuItemEvent) {
- enabledEvents.Remove ((MenuItemEvent)eventId);
+ if (eventId is MenuItemEvent)
+ {
+ enabledEvents.Remove((MenuItemEvent)eventId);
if ((MenuItemEvent)eventId == MenuItemEvent.Clicked)
item.Activated -= HandleItemActivated;
}
}
#endregion
-
- void HandleItemActivated (object sender, EventArgs e)
+
+ void HandleItemActivated(object sender, EventArgs e)
{
- context.InvokeUserCode (delegate {
- eventSink.OnClicked ();
+ context.InvokeUserCode(delegate
+ {
+ eventSink.OnClicked();
});
}
}
diff --git a/Xwt.XamMac/Xwt.Mac/Messaging.cs b/Xwt.XamMac/Xwt.Mac/Messaging.cs
index 066447a8..8f6a20ca 100644
--- a/Xwt.XamMac/Xwt.Mac/Messaging.cs
+++ b/Xwt.XamMac/Xwt.Mac/Messaging.cs
@@ -23,18 +23,10 @@
// 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.Runtime.InteropServices;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
using Foundation;
-using AppKit;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs b/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
index 9e2b3772..2b811172 100644
--- a/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
+++ b/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
@@ -24,14 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-
-#if MONOMAC
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
-
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/NSTableViewBackend.cs b/Xwt.XamMac/Xwt.Mac/NSTableViewBackend.cs
index baa30e17..34f93a2f 100644
--- a/Xwt.XamMac/Xwt.Mac/NSTableViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/NSTableViewBackend.cs
@@ -27,19 +27,9 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-#else
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/NotebookBackend.cs b/Xwt.XamMac/Xwt.Mac/NotebookBackend.cs
index f42266bf..1596c6b0 100644
--- a/Xwt.XamMac/Xwt.Mac/NotebookBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/NotebookBackend.cs
@@ -24,19 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using Xwt.Backends;
-using System.Collections.Generic;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ObjcHelper.cs b/Xwt.XamMac/Xwt.Mac/ObjcHelper.cs
index 8cd827fd..2eac2455 100644
--- a/Xwt.XamMac/Xwt.Mac/ObjcHelper.cs
+++ b/Xwt.XamMac/Xwt.Mac/ObjcHelper.cs
@@ -26,14 +26,7 @@
using System;
using System.Runtime.InteropServices;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.ObjCRuntime;
-#else
using ObjCRuntime;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs b/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs
index abd2cff0..9e234f17 100644
--- a/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs
@@ -25,16 +25,10 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-#else
+using System;
using AppKit;
-using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/PanedBackend.cs b/Xwt.XamMac/Xwt.Mac/PanedBackend.cs
index 6754360c..02624533 100644
--- a/Xwt.XamMac/Xwt.Mac/PanedBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/PanedBackend.cs
@@ -23,18 +23,10 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs b/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs
index 9fcc4803..012efb01 100644
--- a/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs
@@ -1,14 +1,6 @@
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
diff --git a/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs
index acf756b3..6427ba42 100644
--- a/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs
@@ -25,24 +25,8 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-using Xwt.Drawing;
-using System.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-#else
-using Foundation;
-using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs
index 00fd41cd..f7645d29 100644
--- a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs
@@ -23,23 +23,13 @@
// 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 Xwt;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-using MonoMac.ObjCRuntime;
-#else
-using Foundation;
+using System;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
diff --git a/Xwt.XamMac/Xwt.Mac/ProgressBarBackend.cs b/Xwt.XamMac/Xwt.Mac/ProgressBarBackend.cs
index 7f176280..7fefabd4 100644
--- a/Xwt.XamMac/Xwt.Mac/ProgressBarBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ProgressBarBackend.cs
@@ -24,18 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.ObjCRuntime;
-using MonoMac.AppKit;
-#else
using AppKit;
-using ObjCRuntime;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/RadioButtonBackend.cs b/Xwt.XamMac/Xwt.Mac/RadioButtonBackend.cs
index ca864d45..0ac50b98 100644
--- a/Xwt.XamMac/Xwt.Mac/RadioButtonBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/RadioButtonBackend.cs
@@ -23,20 +23,10 @@
// 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.Generic;
-
-using Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
+using System;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs
index f1c7cf2c..5d3fbc3f 100644
--- a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs
@@ -23,32 +23,17 @@
// 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.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
-
-
-using Xwt;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nuint = System.UInt32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using Foundation;
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -280,7 +265,6 @@ namespace Xwt.Mac
return true;
}
- #if !MONOMAC
public override void ViewDidMoveToWindow ()
{
base.ViewDidMoveToWindow ();
@@ -341,7 +325,6 @@ namespace Xwt.Mac
});
}
}
- #endif
void CommonInit ()
{
@@ -489,10 +472,6 @@ namespace Xwt.Mac
public void EmitText (FormattedText text)
{
- #if MONOMAC
- // FIXME: MonoMac does not expose the required API
- EmitText (text.Text, RichTextInlineStyle.Normal);
- #else
if (text.Attributes.Count == 0) {
EmitText (text.Text, RichTextInlineStyle.Normal);
return;
@@ -516,7 +495,6 @@ namespace Xwt.Mac
// first = false;
xmlWriter.WriteRaw (line);
}
- #endif
}
private static readonly IntPtr _AppKitHandle = Dlfcn.dlopen ("/System/Library/Frameworks/AppKit.framework/AppKit", 0);
diff --git a/Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs
index 607f44f9..e24bbf2e 100644
--- a/Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs
@@ -23,18 +23,10 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-#else
using AppKit;
using Foundation;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ScrollAdjustmentBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollAdjustmentBackend.cs
index 7a1c7514..e0707249 100644
--- a/Xwt.XamMac/Xwt.Mac/ScrollAdjustmentBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ScrollAdjustmentBackend.cs
@@ -23,16 +23,9 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs
index 3c68f618..372bf62b 100644
--- a/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs
@@ -23,20 +23,11 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-#else
+using System;
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs
index 7e9c78b2..717b9f40 100644
--- a/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs
@@ -23,21 +23,11 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-#else
+using System;
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ScrollbarBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollbarBackend.cs
index 50d217e3..dc2c9418 100644
--- a/Xwt.XamMac/Xwt.Mac/ScrollbarBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ScrollbarBackend.cs
@@ -23,19 +23,11 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-#else
+using System;
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SelectFolderDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/SelectFolderDialogBackend.cs
index f224ea3e..d3d32828 100644
--- a/Xwt.XamMac/Xwt.Mac/SelectFolderDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SelectFolderDialogBackend.cs
@@ -23,20 +23,9 @@
// 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 Xwt.Backends;
-using System.IO;
-using System.Linq;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
-using AppKit;
-#endif
+using System.Linq;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SelectFontDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/SelectFontDialogBackend.cs
index a642d055..d48d7525 100644
--- a/Xwt.XamMac/Xwt.Mac/SelectFontDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SelectFontDialogBackend.cs
@@ -23,16 +23,11 @@
// 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 Xwt.Backends;
-using Xwt.Drawing;
-#if MONOMAC
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-#else
using AppKit;
using Foundation;
-#endif
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SeparatorBackend.cs b/Xwt.XamMac/Xwt.Mac/SeparatorBackend.cs
index 89f66169..e38ebdb5 100644
--- a/Xwt.XamMac/Xwt.Mac/SeparatorBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SeparatorBackend.cs
@@ -23,18 +23,9 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SeparatorMenuItemBackend.cs b/Xwt.XamMac/Xwt.Mac/SeparatorMenuItemBackend.cs
index 62698cf6..d948d198 100644
--- a/Xwt.XamMac/Xwt.Mac/SeparatorMenuItemBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SeparatorMenuItemBackend.cs
@@ -23,16 +23,9 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SliderBackend.cs b/Xwt.XamMac/Xwt.Mac/SliderBackend.cs
index c60fae42..f97bed76 100644
--- a/Xwt.XamMac/Xwt.Mac/SliderBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SliderBackend.cs
@@ -26,19 +26,10 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
using System.Collections.Generic;
-
-#if MONOMAC
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-using nint = System.Int32;
-using CGSize = System.Drawing.SizeF;
-#else
using AppKit;
-using Foundation;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SpinButtonBackend.cs b/Xwt.XamMac/Xwt.Mac/SpinButtonBackend.cs
index 4c5fe897..feb91d29 100644
--- a/Xwt.XamMac/Xwt.Mac/SpinButtonBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SpinButtonBackend.cs
@@ -1,23 +1,9 @@
using System;
-
-using Xwt.Backends;
-
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-#else
-using Foundation;
using AppKit;
using CoreGraphics;
+using Foundation;
using ObjCRuntime;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/SpinnerBackend.cs b/Xwt.XamMac/Xwt.Mac/SpinnerBackend.cs
index 860c42ab..d61cc6a1 100644
--- a/Xwt.XamMac/Xwt.Mac/SpinnerBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/SpinnerBackend.cs
@@ -24,18 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.ObjCRuntime;
-using MonoMac.AppKit;
-#else
using AppKit;
-using ObjCRuntime;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/StatusIconBackend.cs b/Xwt.XamMac/Xwt.Mac/StatusIconBackend.cs
index c8ce4fe0..efac8ced 100644
--- a/Xwt.XamMac/Xwt.Mac/StatusIconBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/StatusIconBackend.cs
@@ -25,17 +25,8 @@
// THE SOFTWARE.
using System;
-using System.Collections.ObjectModel;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.AppKit;
-#else
using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/TableViewBackend.cs b/Xwt.XamMac/Xwt.Mac/TableViewBackend.cs
index b861f8e7..b0259b03 100644
--- a/Xwt.XamMac/Xwt.Mac/TableViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/TableViewBackend.cs
@@ -25,19 +25,10 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
using System.Collections.Generic;
-using System.Linq;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
-using Foundation;
using AppKit;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -67,12 +58,6 @@ namespace Xwt.Mac
Widget.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
Widget.AutoresizesSubviews = true;
}
-
- protected override void Dispose (bool disposing)
- {
- base.Dispose (disposing);
- Util.DrainObjectCopyPool ();
- }
public ScrollPolicy VerticalScrollPolicy {
get {
diff --git a/Xwt.XamMac/Xwt.Mac/TextEntryBackend.cs b/Xwt.XamMac/Xwt.Mac/TextEntryBackend.cs
index 4398d500..731f0223 100644
--- a/Xwt.XamMac/Xwt.Mac/TextEntryBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/TextEntryBackend.cs
@@ -24,20 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Xwt.Backends;
using System;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-#else
+using AppKit;
using CoreGraphics;
using Foundation;
-using AppKit;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs
index 09fed26e..191d5f47 100644
--- a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs
+++ b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs
@@ -25,27 +25,12 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.CoreText;
-using MonoMac.CoreGraphics;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using CGRect = System.Drawing.RectangleF;
-#else
-using Foundation;
using AppKit;
-using CoreText;
using CoreGraphics;
-#endif
-
-using System.Collections.Generic;
+using CoreText;
+using Foundation;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/ToggleButtonBackend.cs b/Xwt.XamMac/Xwt.Mac/ToggleButtonBackend.cs
index ada9830e..a95cce5d 100644
--- a/Xwt.XamMac/Xwt.Mac/ToggleButtonBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ToggleButtonBackend.cs
@@ -23,18 +23,9 @@
// 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 Xwt.Backends;
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.ObjCRuntime;
-using MonoMac.AppKit;
-#else
using AppKit;
-using ObjCRuntime;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -72,11 +63,7 @@ namespace Xwt.Mac
switch (((Button)Frontend).Style) {
case ButtonStyle.Borderless:
case ButtonStyle.Flat:
-#if MONOMAC
- Messaging.void_objc_msgSend_bool (Widget.Handle, selSetShowsBorderOnlyWhileMouseInside.Handle, !Active);
-#else
Widget.ShowsBorderOnlyWhileMouseInside = !Active;
-#endif
break;
}
lastState = Widget.State;
diff --git a/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs b/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs
index 59044023..cd2a9db5 100644
--- a/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs
@@ -25,20 +25,11 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
using System.Collections.Generic;
-
-#if MONOMAC
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGPoint = System.Drawing.PointF;
-#else
using AppKit;
-using Foundation;
using CoreGraphics;
-#endif
+using Foundation;
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/Util.cs b/Xwt.XamMac/Xwt.Mac/Util.cs
index 4fb4a3ed..df737ada 100644
--- a/Xwt.XamMac/Xwt.Mac/Util.cs
+++ b/Xwt.XamMac/Xwt.Mac/Util.cs
@@ -25,31 +25,14 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
using System.Text;
-using Xwt.Backends;
-using Xwt.Drawing;
-
-#if MONOMAC
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.AppKit;
-using MonoMac.CoreGraphics;
-using MonoMac.CoreImage;
-using MonoMac.Foundation;
-using MonoMac.ObjCRuntime;
-#else
using AppKit;
using CoreGraphics;
using CoreImage;
using Foundation;
using ObjCRuntime;
-#endif
-
-using RectangleF = System.Drawing.RectangleF;
-using SizeF = System.Drawing.SizeF;
+using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.Mac
{
@@ -204,13 +187,13 @@ namespace Xwt.Mac
}
*/
- public static SizeF ToIconSize (IconSize size)
+ public static CGSize ToIconSize (IconSize size)
{
switch (size) {
- case IconSize.Small: return new SizeF (16f, 16f);
- case IconSize.Large: return new SizeF (64f, 64f);
+ case IconSize.Small: return new CGSize (16f, 16f);
+ case IconSize.Large: return new CGSize (64f, 64f);
}
- return new SizeF (32f, 32f);
+ return new CGSize (32f, 32f);
}
public static string ToUTI (this TransferDataType dt)
@@ -228,73 +211,14 @@ namespace Xwt.Mac
return dt.Id;
}
-
-#if MONOMAC
- static Selector selCopyWithZone = new Selector ("copyWithZone:");
- static DateTime lastCopyPoolDrain = DateTime.Now;
- static List<object> copyPool = new List<object> ();
-
- /// <summary>
- /// Implements the NSCopying protocol in a class. The class must implement ICopiableObject.
- /// The method ICopiableObject.CopyFrom will be called to make the copy of the object
- /// </summary>
- /// <typeparam name="T">Type for which to enable copying</typeparam>
- public static void MakeCopiable<T> () where T:ICopiableObject
- {
- Class c = new Class (typeof(T));
- c.AddMethod (selCopyWithZone.Handle, new Func<IntPtr, IntPtr, IntPtr, IntPtr> (MakeCopy), "i@:@");
- }
-
- static IntPtr MakeCopy (IntPtr sender, IntPtr sel, IntPtr zone)
- {
- var thisOb = (ICopiableObject) Runtime.GetNSObject (sender);
-
- // Makes a copy of the object by calling the default implementation of copyWithZone
- IntPtr copyHandle = Messaging.IntPtr_objc_msgSendSuper_IntPtr(((NSObject)thisOb).SuperHandle, selCopyWithZone.Handle, zone);
- var copyOb = (ICopiableObject) Runtime.GetNSObject (copyHandle);
-
- // Copy of managed data
- copyOb.CopyFrom (thisOb);
-
- // Copied objects are for internal use of the Cocoa framework. We need to keep a reference of the
- // managed object until the the framework doesn't need it anymore.
-
- if ((DateTime.Now - lastCopyPoolDrain).TotalSeconds > 2)
- DrainObjectCopyPool ();
-
- copyPool.Add (copyOb);
-
- return ((NSObject)copyOb).Handle;
- }
-
- public static void DrainObjectCopyPool ()
- {
- // Objects in the pool have been created by Cocoa, so there should be no managed references
- // other than the ones we keep in the pool. An object can be removed from the pool if it
- // has only 1 reference left (the managed one)
-
- List<NSObject> markedForDelete = new List<NSObject> ();
-
- foreach (NSObject ob in copyPool) {
- var count = ob.RetainCount;
- if (count == 1)
- markedForDelete.Add (ob);
- }
- foreach (NSObject ob in markedForDelete)
- copyPool.Remove (ob);
-
- lastCopyPoolDrain = DateTime.Now;
- }
-#else
- public static void MakeCopiable<T> () where T:ICopiableObject
+ /*public static void MakeCopiable<T> () where T:ICopiableObject
{
// Nothing to do for XamMac
}
public static void DrainObjectCopyPool ()
{
// Nothing to do for XamMac
- }
-#endif
+ }*/
public static NSBitmapImageFileType ToMacFileType (this ImageFileType type)
{
diff --git a/Xwt.XamMac/Xwt.Mac/ViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ViewBackend.cs
index 5a0c855b..0c6f51b7 100644
--- a/Xwt.XamMac/Xwt.Mac/ViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/ViewBackend.cs
@@ -26,31 +26,13 @@
using System;
using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
using System.Linq;
using System.Xml;
-using Xwt;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using CGRect = System.Drawing.RectangleF;
-using CGPoint = System.Drawing.PointF;
-using CGSize = System.Drawing.SizeF;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using MonoMac.CoreGraphics;
-using MonoMac.CoreAnimation;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-using CoreAnimation;
-#endif
+using Foundation;
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
diff --git a/Xwt.XamMac/Xwt.Mac/WebViewBackend.cs b/Xwt.XamMac/Xwt.Mac/WebViewBackend.cs
index 3a7bfbcd..791c84c1 100644
--- a/Xwt.XamMac/Xwt.Mac/WebViewBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/WebViewBackend.cs
@@ -26,22 +26,12 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
using System.Linq;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.WebKit;
-using WebKitView = MonoMac.WebKit.WebView;
-#else
-using Foundation;
using AppKit;
+using Foundation;
using WebKit;
+using Xwt.Backends;
using WebKitView = WebKit.WebView;
-#endif
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/WidgetView.cs b/Xwt.XamMac/Xwt.Mac/WidgetView.cs
index ae892407..d7ff2b77 100644
--- a/Xwt.XamMac/Xwt.Mac/WidgetView.cs
+++ b/Xwt.XamMac/Xwt.Mac/WidgetView.cs
@@ -26,19 +26,9 @@
// THE SOFTWARE.
using System;
-using Xwt.Backends;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.CoreGraphics;
-using MonoMac.AppKit;
-using CGRect = System.Drawing.RectangleF;
-using CGSize = System.Drawing.SizeF;
-#else
using AppKit;
using CoreGraphics;
-#endif
+using Xwt.Backends;
namespace Xwt.Mac
{
diff --git a/Xwt.XamMac/Xwt.Mac/WindowBackend.cs b/Xwt.XamMac/Xwt.Mac/WindowBackend.cs
index 171bfd59..d900cfd5 100644
--- a/Xwt.XamMac/Xwt.Mac/WindowBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/WindowBackend.cs
@@ -29,23 +29,11 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
-using Xwt.Backends;
-using System.Drawing;
-
-#if MONOMAC
-using nint = System.Int32;
-using nfloat = System.Single;
-using MonoMac.Foundation;
-using MonoMac.AppKit;
-using MonoMac.ObjCRuntime;
-using CGRect = System.Drawing.RectangleF;
-#else
-using Foundation;
using AppKit;
-using ObjCRuntime;
using CoreGraphics;
-#endif
+using Foundation;
+using ObjCRuntime;
+using Xwt.Backends;
namespace Xwt.Mac
{
@@ -193,11 +181,7 @@ namespace Xwt.Mac
switch (@event) {
case WindowFrameEvent.BoundsChanged:
DidResize += HandleDidResize;
-#if MONOMAC
- DidMoved += HandleDidResize;
-#else
DidMove += HandleDidResize;
-#endif
break;
case WindowFrameEvent.Hidden:
EnableVisibilityEvent (@event);
@@ -313,11 +297,7 @@ namespace Xwt.Mac
switch (@event) {
case WindowFrameEvent.BoundsChanged:
DidResize -= HandleDidResize;
-#if MONOMAC
- DidMoved -= HandleDidResize;
-#else
- DidMove -= HandleDidResize;
-#endif
+ DidMove -= HandleDidResize;
break;
case WindowFrameEvent.Hidden:
this.WillClose -= OnWillClose;
@@ -477,11 +457,7 @@ namespace Xwt.Mac
// WORKAROUND:
// bump native reference count by calling DangerousRetain()
// base.Dispose will now unref the window correctly without crashing
- #if MONOMAC
- Messaging.void_objc_msgSend(this.Handle, retainSel.Handle);
- #else
DangerousRetain();
- #endif
// tell Cocoa to release the window on Close
ReleasedWhenClosed = true;
// Close the window (Cocoa will do its job even if the window is already closed)