diff --git a/CFNetwork/MonoMac.CFNetwork.Test.csproj b/CFNetwork/MonoMac.CFNetwork.Test.csproj index a799087..0efd0f3 100644 --- a/CFNetwork/MonoMac.CFNetwork.Test.csproj +++ b/CFNetwork/MonoMac.CFNetwork.Test.csproj @@ -6,7 +6,7 @@ 10.0.0 2.0 {D7C26BE0-9517-4773-954C-4E74A53BEA09} - {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe MonoMac.CFNetwork.Test MonoMac.CFNetwork.Test @@ -72,13 +72,11 @@ - - \Applications\MonoDevelop.app\Contents\MacOS\lib\monodevelop\AddIns\MonoDevelop.MonoMac\MonoMac.dll - \Applications\MonoDevelop.app\Contents\MacOS\lib\monodevelop\AddIns\MonoDevelop.MonoMac\MonoMac.CFNetwork.dll + diff --git a/CoreAnimationBook/BackgroundFilteredView/AppDelegate.cs b/CoreAnimationBook/BackgroundFilteredView/AppDelegate.cs index 0ec34ec..87bd84b 100644 --- a/CoreAnimationBook/BackgroundFilteredView/AppDelegate.cs +++ b/CoreAnimationBook/BackgroundFilteredView/AppDelegate.cs @@ -1,8 +1,8 @@ using System; -using System.Drawing; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.ObjCRuntime; +using CoreGraphics; +using Foundation; +using AppKit; +using ObjCRuntime; namespace BackgroundFilteredView { @@ -14,7 +14,7 @@ namespace BackgroundFilteredView { } - public override void FinishedLaunching (NSObject notification) + public override void DidFinishLaunching (NSNotification notification) { mainWindowController = new MainWindowController (); mainWindowController.Window.MakeKeyAndOrderFront (this); diff --git a/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.cs b/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.cs index b41fa99..6361406 100644 --- a/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.cs +++ b/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.cs @@ -2,16 +2,16 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Drawing; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.CoreAnimation; -using MonoMac.CoreGraphics; -using MonoMac.CoreImage; +using CoreGraphics; +using Foundation; +using AppKit; +using CoreAnimation; +using CoreGraphics; +using CoreImage; namespace BackgroundFilteredView { - public partial class BackgroundFilteredView : MonoMac.AppKit.NSView + public partial class BackgroundFilteredView : AppKit.NSView { public BackgroundFilteredView (IntPtr handle) : base(handle) {} @@ -55,18 +55,18 @@ namespace BackgroundFilteredView AddAnimationToTorusFilter (); } - public override void DrawRect (RectangleF dirtyRect) + public override void DrawRect (CGRect dirtyRect) { - RectangleF bounds = Bounds; - SizeF stripeSize = bounds.Size; + CGRect bounds = Bounds; + CGSize stripeSize = bounds.Size; stripeSize.Width = bounds.Width / 10.0f; - RectangleF stripe = bounds; + CGRect stripe = bounds; stripe.Size = stripeSize; NSColor[] colors = new NSColor[2] { NSColor.White, NSColor.Blue }; for (int i = 0; i < 10; i++){ colors[i % 2].Set(); NSGraphics.RectFill(stripe); - PointF origin = stripe.Location; + CGPoint origin = stripe.Location; origin.X += stripe.Size.Width; stripe.Location = origin; } diff --git a/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.csproj b/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.csproj index d9e79b0..6d96d02 100644 --- a/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.csproj +++ b/CoreAnimationBook/BackgroundFilteredView/BackgroundFilteredView.csproj @@ -6,12 +6,12 @@ 10.0.0 2.0 {B5F58EC4-8C3E-4B91-ABF8-82691F18873F} - {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe BackgroundFilteredView BackgroundFilteredView - v4.0 - + v2.0 + Xamarin.Mac true @@ -36,10 +36,7 @@ - - - False - + @@ -68,6 +65,5 @@ - - + \ No newline at end of file diff --git a/CoreAnimationBook/BackgroundFilteredView/Main.cs b/CoreAnimationBook/BackgroundFilteredView/Main.cs index 4ef2751..a019ab1 100644 --- a/CoreAnimationBook/BackgroundFilteredView/Main.cs +++ b/CoreAnimationBook/BackgroundFilteredView/Main.cs @@ -1,5 +1,5 @@ using System; -using MonoMac.AppKit; +using AppKit; namespace BackgroundFilteredView { diff --git a/CoreAnimationBook/BackgroundFilteredView/MainMenu.xib.designer.cs b/CoreAnimationBook/BackgroundFilteredView/MainMenu.xib.designer.cs index 4da4e54..8a3f732 100644 --- a/CoreAnimationBook/BackgroundFilteredView/MainMenu.xib.designer.cs +++ b/CoreAnimationBook/BackgroundFilteredView/MainMenu.xib.designer.cs @@ -12,7 +12,7 @@ namespace BackgroundFilteredView { // Should subclass MonoMac.AppKit.NSResponder - [MonoMac.Foundation.Register("AppDelegate")] + [Foundation.Register("AppDelegate")] public partial class AppDelegate { } } diff --git a/CoreAnimationBook/BackgroundFilteredView/MainWindow.cs b/CoreAnimationBook/BackgroundFilteredView/MainWindow.cs index 7cf1285..deb5a27 100644 --- a/CoreAnimationBook/BackgroundFilteredView/MainWindow.cs +++ b/CoreAnimationBook/BackgroundFilteredView/MainWindow.cs @@ -2,12 +2,12 @@ using System; using System.Collections.Generic; using System.Linq; -using MonoMac.Foundation; -using MonoMac.AppKit; +using Foundation; +using AppKit; namespace BackgroundFilteredView { - public partial class MainWindow : MonoMac.AppKit.NSWindow + public partial class MainWindow : AppKit.NSWindow { public MainWindow (IntPtr handle) : base(handle) {} diff --git a/CoreAnimationBook/BackgroundFilteredView/MainWindow.xib.designer.cs b/CoreAnimationBook/BackgroundFilteredView/MainWindow.xib.designer.cs index 386af6a..45f0715 100644 --- a/CoreAnimationBook/BackgroundFilteredView/MainWindow.xib.designer.cs +++ b/CoreAnimationBook/BackgroundFilteredView/MainWindow.xib.designer.cs @@ -12,22 +12,22 @@ namespace BackgroundFilteredView { // Should subclass MonoMac.AppKit.NSView - [MonoMac.Foundation.Register("BackgroundFilteredView")] + [Foundation.Register("BackgroundFilteredView")] public partial class BackgroundFilteredView { - private global::MonoMac.AppKit.NSView __mt_controls; + private global::AppKit.NSView __mt_controls; #pragma warning disable 0169 - [MonoMac.Foundation.Export("addFilter:")] - partial void AddFilter (MonoMac.AppKit.NSButton sender); + [Foundation.Export("addFilter:")] + partial void AddFilter (AppKit.NSButton sender); - [MonoMac.Foundation.Export("removeFilter:")] - partial void RemoveFilter (MonoMac.AppKit.NSButton sender); + [Foundation.Export("removeFilter:")] + partial void RemoveFilter (AppKit.NSButton sender); - [MonoMac.Foundation.Connect("controls")] - private global::MonoMac.AppKit.NSView controls { + [Foundation.Connect("controls")] + private global::AppKit.NSView controls { get { - this.__mt_controls = ((global::MonoMac.AppKit.NSView)(this.GetNativeField("controls"))); + this.__mt_controls = ((global::AppKit.NSView)(this.GetNativeField("controls"))); return this.__mt_controls; } set { @@ -38,12 +38,12 @@ namespace BackgroundFilteredView { } // Should subclass MonoMac.AppKit.NSWindow - [MonoMac.Foundation.Register("MainWindow")] + [Foundation.Register("MainWindow")] public partial class MainWindow { } // Should subclass MonoMac.AppKit.NSWindowController - [MonoMac.Foundation.Register("MainWindowController")] + [Foundation.Register("MainWindowController")] public partial class MainWindowController { } } diff --git a/CoreAnimationBook/BackgroundFilteredView/MainWindowController.cs b/CoreAnimationBook/BackgroundFilteredView/MainWindowController.cs index fb2786e..3bbae92 100644 --- a/CoreAnimationBook/BackgroundFilteredView/MainWindowController.cs +++ b/CoreAnimationBook/BackgroundFilteredView/MainWindowController.cs @@ -2,12 +2,12 @@ using System; using System.Collections.Generic; using System.Linq; -using MonoMac.Foundation; -using MonoMac.AppKit; +using Foundation; +using AppKit; namespace BackgroundFilteredView { - public partial class MainWindowController : MonoMac.AppKit.NSWindowController + public partial class MainWindowController : AppKit.NSWindowController { #region Constructors diff --git a/CoreTextArcMonoMac/AppDelegate.cs b/CoreTextArcMonoMac/AppDelegate.cs index 23d9880..4c3d108 100644 --- a/CoreTextArcMonoMac/AppDelegate.cs +++ b/CoreTextArcMonoMac/AppDelegate.cs @@ -1,7 +1,7 @@ using System; -using System.Drawing; -using MonoMac.Foundation; -using MonoMac.AppKit; +using CoreGraphics; +using Foundation; +using AppKit; namespace CoreTextArcMonoMac { @@ -11,7 +11,7 @@ namespace CoreTextArcMonoMac { } - public override void FinishedLaunching (NSObject notification) + public override void DidFinishLaunching (NSNotification notification) { // You can put any code here after your app launched. } diff --git a/CoreTextArcMonoMac/CoreTextArcMonoMac.csproj b/CoreTextArcMonoMac/CoreTextArcMonoMac.csproj index bb30513..0167434 100644 --- a/CoreTextArcMonoMac/CoreTextArcMonoMac.csproj +++ b/CoreTextArcMonoMac/CoreTextArcMonoMac.csproj @@ -6,12 +6,12 @@ 10.0.0 2.0 {8A201BCD-D384-47A7-B029-88E6187D688A} - {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe CoreTextArcMonoMac CoreTextArcMonoMac - v4.0 - + v2.0 + Xamarin.Mac true @@ -36,8 +36,7 @@ - - + @@ -63,6 +62,5 @@ - - + \ No newline at end of file diff --git a/CoreTextArcMonoMac/CoreTextArcView.cs b/CoreTextArcMonoMac/CoreTextArcView.cs index 1a160b6..6a6bf22 100644 --- a/CoreTextArcMonoMac/CoreTextArcView.cs +++ b/CoreTextArcMonoMac/CoreTextArcView.cs @@ -1,15 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Drawing; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.CoreGraphics; -using MonoMac.CoreText; +using CoreGraphics; +using Foundation; +using AppKit; +using CoreGraphics; +using CoreText; namespace CoreTextArcMonoMac { - public partial class CoreTextArcView : MonoMac.AppKit.NSView + public partial class CoreTextArcView : AppKit.NSView { NSFont _font; string _string; @@ -32,7 +32,7 @@ namespace CoreTextArcMonoMac } [Export("initWithFrame:")] - public CoreTextArcView (RectangleF frame) : base(frame) + public CoreTextArcView (CGRect frame) : base(frame) { Font = NSFont.FromFontName (ARCVIEW_DEFAULT_FONT_NAME, ARCVIEW_DEFAULT_FONT_SIZE); Title = "Curvaceous MonoMac"; @@ -47,9 +47,9 @@ namespace CoreTextArcMonoMac // Examine each run in the line, updating glyphOffset to track how far along the run is // in terms of glyphCount. long glyphOffset = 0; - float ascent = 0; - float descent = 0; - float leading = 0; + nfloat ascent = 0; + nfloat descent = 0; + nfloat leading = 0; foreach (var run in runArray) { var runGlyphCount = run.GlyphCount; @@ -82,7 +82,7 @@ namespace CoreTextArcMonoMac } } - public override void DrawRect (RectangleF dirtyRect) + public override void DrawRect (CGRect dirtyRect) { // Don't draw if we don't have a font or a title. if (Font == null || Title == string.Empty) @@ -99,7 +99,7 @@ namespace CoreTextArcMonoMac //CTLineRef line = CTLineCreateWithAttributedString((CFAttributedStringRef)self.attributedString); CTLine line = new CTLine (AttributedString); - int glyphCount = line.GlyphCount; + int glyphCount = (int)line.GlyphCount; if (glyphCount == 0) return; @@ -113,7 +113,7 @@ namespace CoreTextArcMonoMac // Stroke the arc in red for verification. context.BeginPath (); context.AddArc (0, 0, Radius, (float)Math.PI, 0, true); - context.SetRGBStrokeColor (1, 0, 0, 1); + context.SetStrokeColor (1, 0, 0, 1); context.StrokePath (); // Rotate the context 90 degrees counterclockwise. @@ -123,7 +123,7 @@ namespace CoreTextArcMonoMac // glyph has already been calculated; with that information in hand, draw those glyphs // overstruck and centered over one another, making sure to rotate the context after each // glyph so the glyphs are spread along a semicircular path. - PointF textPosition = new PointF (0, Radius); + CGPoint textPosition = new CGPoint (0, Radius); context.TextPosition = textPosition; var runArray = line.GetGlyphRuns (); @@ -154,7 +154,7 @@ namespace CoreTextArcMonoMac // Center this glyph by moving left by half its width. var glyphWidth = glyphArcInfo[runGlyphIndex + glyphOffset].width; var halfGlyphWidth = glyphWidth / 2.0; - var positionForThisGlyph = new PointF (textPosition.X - (float)halfGlyphWidth, textPosition.Y); + var positionForThisGlyph = new CGPoint (textPosition.X - (float)halfGlyphWidth, textPosition.Y); // Glyphs are positioned relative to the text position for the line, so offset text position leftwards by this glyph's // width in preparation for the next glyph. @@ -179,7 +179,7 @@ namespace CoreTextArcMonoMac context.SetFont (cgFont); context.SetFontSize (runFont.Size); - context.SetRGBFillColor (0.25f, 0.25f, 0.25f, 1); + context.SetFillColor (0.25f, 0.25f, 0.25f, 1); context.ShowGlyphsAtPositions (glyph, position, 1); } @@ -188,31 +188,31 @@ namespace CoreTextArcMonoMac if (ShowsGlyphBounds) { var glyphBounds = run.GetImageBounds (context, glyphRange); - context.SetRGBStrokeColor (0, 0, 1, 1); + context.SetStrokeColor (0, 0, 1, 1); context.StrokeRect (glyphBounds); } // Draw the bounding boxes defined by the line metrics if (ShowsLineMetrics) { - var lineMetrics = new RectangleF (); - float ascent = 0; - float descent = 0; - float leading = 0; + var lineMetrics = new CGRect (); + nfloat ascent = 0; + nfloat descent = 0; + nfloat leading = 0; run.GetTypographicBounds (glyphRange, out ascent, out descent, out leading); // The glyph is centered around the y-axis - lineMetrics.Location = new PointF (-(float)halfGlyphWidth, positionForThisGlyph.Y - descent); - lineMetrics.Size = new SizeF (glyphWidth, ascent + descent); - context.SetRGBStrokeColor (0, 1, 0, 1); + lineMetrics.Location = new CGPoint (-(float)halfGlyphWidth, positionForThisGlyph.Y - descent); + lineMetrics.Size = new CGSize (glyphWidth, ascent + descent); + context.SetStrokeColor (0, 1, 0, 1); context.StrokeRect (lineMetrics); } } - glyphOffset += runGlyphCount; + glyphOffset += (int)runGlyphCount; } context.RestoreState (); diff --git a/CoreTextArcMonoMac/Main.cs b/CoreTextArcMonoMac/Main.cs index 72f3862..af44bdf 100644 --- a/CoreTextArcMonoMac/Main.cs +++ b/CoreTextArcMonoMac/Main.cs @@ -1,8 +1,8 @@ using System; -using System.Drawing; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.ObjCRuntime; +using CoreGraphics; +using Foundation; +using AppKit; +using ObjCRuntime; namespace CoreTextArcMonoMac { diff --git a/CoreTextArcMonoMac/MainMenu.xib.designer.cs b/CoreTextArcMonoMac/MainMenu.xib.designer.cs index 57e2d52..35c5df5 100644 --- a/CoreTextArcMonoMac/MainMenu.xib.designer.cs +++ b/CoreTextArcMonoMac/MainMenu.xib.designer.cs @@ -12,7 +12,7 @@ namespace CoreTextArcMonoMac { // Should subclass MonoMac.AppKit.NSResponder - [MonoMac.Foundation.Register("AppDelegate")] + [Foundation.Register("AppDelegate")] public partial class AppDelegate { } } diff --git a/CoreTextArcMonoMac/MyDocument.cs b/CoreTextArcMonoMac/MyDocument.cs index dcaeb57..3265dcc 100644 --- a/CoreTextArcMonoMac/MyDocument.cs +++ b/CoreTextArcMonoMac/MyDocument.cs @@ -1,23 +1,23 @@ using System; using System.Collections.Generic; using System.Linq; -using MonoMac.Foundation; -using MonoMac.AppKit; +using Foundation; +using AppKit; namespace CoreTextArcMonoMac { - public partial class MyDocument : MonoMac.AppKit.NSDocument + public partial class MyDocument : AppKit.NSDocument { // Called when created from unmanaged code public MyDocument (IntPtr handle) : base(handle) { } - // Called when created directly from a XIB file + /* // Called when created directly from a XIB file [Export("initWithCoder:")] public MyDocument (NSCoder coder) : base(coder) { - } + }*/ public override void WindowControllerDidLoadNib (NSWindowController windowController) { diff --git a/CoreTextArcMonoMac/MyDocument.xib.designer.cs b/CoreTextArcMonoMac/MyDocument.xib.designer.cs index f110dcd..e3d981a 100644 --- a/CoreTextArcMonoMac/MyDocument.xib.designer.cs +++ b/CoreTextArcMonoMac/MyDocument.xib.designer.cs @@ -12,45 +12,45 @@ namespace CoreTextArcMonoMac { // Should subclass MonoMac.AppKit.NSView - [MonoMac.Foundation.Register("CoreTextArcView")] + [Foundation.Register("CoreTextArcView")] public partial class CoreTextArcView { } // Should subclass MonoMac.Foundation.NSObject - [MonoMac.Foundation.Register("FirstResponder")] + [Foundation.Register("FirstResponder")] public partial class FirstResponder { #pragma warning disable 0169 - [MonoMac.Foundation.Export("setDimsSubstitutedGlyphs:")] - partial void setDimsSubstitutedGlyphs (MonoMac.AppKit.NSButton sender); + [Foundation.Export("setDimsSubstitutedGlyphs:")] + partial void setDimsSubstitutedGlyphs (AppKit.NSButton sender); - [MonoMac.Foundation.Export("setShowsGlyphOutlines:")] - partial void setShowsGlyphOutlines (MonoMac.AppKit.NSButton sender); + [Foundation.Export("setShowsGlyphOutlines:")] + partial void setShowsGlyphOutlines (AppKit.NSButton sender); - [MonoMac.Foundation.Export("setShowsLineMetrics:")] - partial void setShowsLineMetrics (MonoMac.AppKit.NSButton sender); + [Foundation.Export("setShowsLineMetrics:")] + partial void setShowsLineMetrics (AppKit.NSButton sender); - [MonoMac.Foundation.Export("toggleBold:")] - partial void toggleBold (MonoMac.AppKit.NSButton sender); + [Foundation.Export("toggleBold:")] + partial void toggleBold (AppKit.NSButton sender); - [MonoMac.Foundation.Export("toggleItalic:")] - partial void toggleItalic (MonoMac.AppKit.NSButton sender); + [Foundation.Export("toggleItalic:")] + partial void toggleItalic (AppKit.NSButton sender); } // Should subclass MonoMac.AppKit.NSDocument - [MonoMac.Foundation.Register("MyDocument")] + [Foundation.Register("MyDocument")] public partial class MyDocument { private CoreTextArcView __mt_arcView; - private global::MonoMac.AppKit.NSButton __mt_boldButton; + private global::AppKit.NSButton __mt_boldButton; - private global::MonoMac.AppKit.NSButton __mt_italicButton; + private global::AppKit.NSButton __mt_italicButton; - private global::MonoMac.AppKit.NSTextField __mt_txtField; + private global::AppKit.NSTextField __mt_txtField; #pragma warning disable 0169 - [MonoMac.Foundation.Connect("arcView")] + [Foundation.Connect("arcView")] private CoreTextArcView arcView { get { this.__mt_arcView = ((CoreTextArcView)(this.GetNativeField("arcView"))); @@ -62,10 +62,10 @@ namespace CoreTextArcMonoMac { } } - [MonoMac.Foundation.Connect("boldButton")] - private global::MonoMac.AppKit.NSButton boldButton { + [Foundation.Connect("boldButton")] + private global::AppKit.NSButton boldButton { get { - this.__mt_boldButton = ((global::MonoMac.AppKit.NSButton)(this.GetNativeField("boldButton"))); + this.__mt_boldButton = ((global::AppKit.NSButton)(this.GetNativeField("boldButton"))); return this.__mt_boldButton; } set { @@ -74,10 +74,10 @@ namespace CoreTextArcMonoMac { } } - [MonoMac.Foundation.Connect("italicButton")] - private global::MonoMac.AppKit.NSButton italicButton { + [Foundation.Connect("italicButton")] + private global::AppKit.NSButton italicButton { get { - this.__mt_italicButton = ((global::MonoMac.AppKit.NSButton)(this.GetNativeField("italicButton"))); + this.__mt_italicButton = ((global::AppKit.NSButton)(this.GetNativeField("italicButton"))); return this.__mt_italicButton; } set { @@ -86,10 +86,10 @@ namespace CoreTextArcMonoMac { } } - [MonoMac.Foundation.Connect("txtField")] - private global::MonoMac.AppKit.NSTextField txtField { + [Foundation.Connect("txtField")] + private global::AppKit.NSTextField txtField { get { - this.__mt_txtField = ((global::MonoMac.AppKit.NSTextField)(this.GetNativeField("txtField"))); + this.__mt_txtField = ((global::AppKit.NSTextField)(this.GetNativeField("txtField"))); return this.__mt_txtField; } set {