From fb2dcb3b086bb4ce29d86a0b03c007f4e51d23ca Mon Sep 17 00:00:00 2001 From: Tim Uy Date: Fri, 20 Sep 2013 17:58:20 -0700 Subject: [PATCH] Add MvvmCross_Mac solution for Xamarin Studio, Mac-implementation, sample project (N=0) --- .gitignore | 33 + .../Cirrious.MvvmCross.Binding.Mac.csproj | 22 +- .../BindingContext/IMvxBindingContext.cs | 17 + .../MvxMacBindingBuilder.cs | 80 +- .../MvxBaseNSDatePickerTargetBinding.cs | 63 + .../Target/MvxNSButtonTitleTargetBinding.cs | 49 + .../MvxNSDatePickerDateTargetBinding.cs | 36 + .../MvxNSDatePickerTimeTargetBinding.cs | 53 + .../MvxNSSearchFieldTextTargetBinding.cs | 57 + .../Target/MvxNSSliderValueTargetBinding.cs | 59 + .../Target/MvxNSSwitchOnTargetBinding.cs | 59 + .../Target/MvxNSTextFieldTextTargetBinding.cs | 57 + .../Target/MvxNSTextViewTextTargetBinding.cs | 60 + .../MvxNSViewVisibilityTargetBinding.cs | 58 + .../Target/MvxNSViewVisibleTargetBinding.cs | 45 + .../Views/IMvxBindable.cs | 18 + .../Views/MvxView.cs | 60 + .../Cirrious.MvvmCross.Mac.csproj | 34 +- .../Platform/MvxApplicationDelegate.cs | 1 + .../Platform/MvxDebugTrace.cs | 22 +- .../Platform/MvxMacSetup.cs | 134 +- .../Platform/MvxTouchSetup.cs | 132 + .../Views/MvxBindingViewControllerAdapter.cs | 43 + .../Views/MvxMacViewDispatcher.cs | 30 +- .../Views/MvxMacViewsContainer.cs | 3 +- .../Views/MvxViewController.cs | 13 +- .../Views/MvxViewControllerAdapter.cs | 40 + .../MvxViewControllerAdaptingExtensions.cs | 20 + .../MvxViewControllerExtensionMethods.cs | 97 + .../Views/Presenters/IMvxMacViewPresenter.cs | 17 + .../Presenters/MvxBaseMacViewPresenter.cs | 26 + .../Views/Presenters/MvxMacViewPresenter.cs | 112 +- .../Cirrious.MvvmCross.csproj | 12 +- .../Cirrious.CrossCore.Mac.csproj | 3 +- .../Properties/AssemblyInfo.cs | 23 +- .../Views/IMvxEventSourceViewController.cs | 10 +- .../Views/MvxBaseViewControllerAdapter.cs | 38 +- .../Views/MvxDelegateExtensionMethods.cs | 32 + .../Views/MvxEventSourceViewController.cs | 89 +- CrossUI/CrossUI.Core/CrossUI.Core.csproj | 4 +- Samples/FirstDemo.Core/App.cs | 17 + Samples/FirstDemo.Core/FirstDemo.Core.csproj | 62 + .../FirstDemo.Core/Properties/AssemblyInfo.cs | 22 + .../ViewModels/FirstViewModel.cs | 36 + Samples/FirstDemo.Mac/AppDelegate.cs | 37 + Samples/FirstDemo.Mac/AppDelegate.designer.cs | 10 + Samples/FirstDemo.Mac/FirstDemo.Mac.csproj | 139 + Samples/FirstDemo.Mac/Info.plist | 18 + Samples/FirstDemo.Mac/Main.cs | 18 + Samples/FirstDemo.Mac/MainMenu.xib | 4074 +++++++++++++++++ Samples/FirstDemo.Mac/MainWindow.cs | 30 + Samples/FirstDemo.Mac/MainWindow.designer.cs | 15 + Samples/FirstDemo.Mac/MainWindow.xib | 189 + Samples/FirstDemo.Mac/MainWindowController.cs | 41 + Samples/FirstDemo.Mac/Setup.cs | 23 + Samples/FirstDemo.Mac/Views/FirstView.cs | 31 + .../FirstDemo.Mac/Views/FirstView.designer.cs | 15 + Samples/FirstDemo.Mac/Views/FirstView.xib | 166 + .../Views/FirstViewController.cs | 62 + Samples/FirstDemo2.Mac/AppDelegate.cs | 37 + .../FirstDemo2.Mac/AppDelegate.designer.cs | 10 + .../FirstDemo2.Mac-all-target-headers.hmap | Bin 0 -> 793 bytes .../FirstDemo2.Mac-generated-files.hmap | Bin 0 -> 121 bytes .../FirstDemo2.Mac-own-target-headers.hmap | Bin 0 -> 793 bytes .../FirstDemo2.Mac-project-headers.hmap | Bin 0 -> 897 bytes .../FirstDemo2.Mac.build/FirstDemo2.Mac.hmap | Bin 0 -> 1665 bytes Samples/FirstDemo2.Mac/FirstDemo2.Mac.csproj | 137 + Samples/FirstDemo2.Mac/Info.plist | 20 + Samples/FirstDemo2.Mac/Main.cs | 18 + Samples/FirstDemo2.Mac/MainMenu.xib | 4074 +++++++++++++++++ Samples/FirstDemo2.Mac/Setup.cs | 23 + Samples/FirstDemo2.Mac/Views/FirstView.cs | 31 + .../Views/FirstView.designer.cs | 15 + Samples/FirstDemo2.Mac/Views/FirstView.xib | 166 + .../Views/FirstViewController.cs | 62 + 75 files changed, 11142 insertions(+), 217 deletions(-) create mode 100644 Cirrious/Cirrious.MvvmCross.Binding.Mac/Interfaces/BindingContext/IMvxBindingContext.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxBaseNSDatePickerTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSButtonTitleTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerDateTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerTimeTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSearchFieldTextTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSliderValueTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSwitchOnTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextFieldTextTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextViewTextTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibilityTargetBinding.cs create mode 100755 Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibleTargetBinding.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/IMvxBindable.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/MvxView.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxTouchSetup.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/MvxBindingViewControllerAdapter.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdapter.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdaptingExtensions.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerExtensionMethods.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/IMvxMacViewPresenter.cs create mode 100644 Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxBaseMacViewPresenter.cs create mode 100644 CrossCore/Cirrious.CrossCore.Mac/Views/MvxDelegateExtensionMethods.cs create mode 100644 Samples/FirstDemo.Core/App.cs create mode 100644 Samples/FirstDemo.Core/FirstDemo.Core.csproj create mode 100644 Samples/FirstDemo.Core/Properties/AssemblyInfo.cs create mode 100644 Samples/FirstDemo.Core/ViewModels/FirstViewModel.cs create mode 100644 Samples/FirstDemo.Mac/AppDelegate.cs create mode 100644 Samples/FirstDemo.Mac/AppDelegate.designer.cs create mode 100644 Samples/FirstDemo.Mac/FirstDemo.Mac.csproj create mode 100644 Samples/FirstDemo.Mac/Info.plist create mode 100644 Samples/FirstDemo.Mac/Main.cs create mode 100644 Samples/FirstDemo.Mac/MainMenu.xib create mode 100644 Samples/FirstDemo.Mac/MainWindow.cs create mode 100644 Samples/FirstDemo.Mac/MainWindow.designer.cs create mode 100644 Samples/FirstDemo.Mac/MainWindow.xib create mode 100644 Samples/FirstDemo.Mac/MainWindowController.cs create mode 100644 Samples/FirstDemo.Mac/Setup.cs create mode 100644 Samples/FirstDemo.Mac/Views/FirstView.cs create mode 100644 Samples/FirstDemo.Mac/Views/FirstView.designer.cs create mode 100644 Samples/FirstDemo.Mac/Views/FirstView.xib create mode 100644 Samples/FirstDemo.Mac/Views/FirstViewController.cs create mode 100644 Samples/FirstDemo2.Mac/AppDelegate.cs create mode 100644 Samples/FirstDemo2.Mac/AppDelegate.designer.cs create mode 100644 Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-all-target-headers.hmap create mode 100644 Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-generated-files.hmap create mode 100644 Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-own-target-headers.hmap create mode 100644 Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-project-headers.hmap create mode 100644 Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac.hmap create mode 100644 Samples/FirstDemo2.Mac/FirstDemo2.Mac.csproj create mode 100644 Samples/FirstDemo2.Mac/Info.plist create mode 100644 Samples/FirstDemo2.Mac/Main.cs create mode 100644 Samples/FirstDemo2.Mac/MainMenu.xib create mode 100644 Samples/FirstDemo2.Mac/Setup.cs create mode 100644 Samples/FirstDemo2.Mac/Views/FirstView.cs create mode 100644 Samples/FirstDemo2.Mac/Views/FirstView.designer.cs create mode 100644 Samples/FirstDemo2.Mac/Views/FirstView.xib create mode 100644 Samples/FirstDemo2.Mac/Views/FirstViewController.cs diff --git a/.gitignore b/.gitignore index dd6c88b48..5b3a28630 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,36 @@ _ReSharper*/ AppPackages/ *.ncrunchproject *.nupkg +*.sdf +*.opensdf + +#NuGet +packages/ +!packages/Microsoft.Office.js.1.0.0/ +!packages/repositories.config + +#Allow NuGet.exe (do not ignore) +!NuGet.exe +*.orig + +# Xcode +.DS_Store +*/build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +*.hmap +*.xccheckout + +#CocoaPods +Pods diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Cirrious.MvvmCross.Binding.Mac.csproj b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Cirrious.MvvmCross.Binding.Mac.csproj index 6eac590b9..eee3e948c 100644 --- a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Cirrious.MvvmCross.Binding.Mac.csproj +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Cirrious.MvvmCross.Binding.Mac.csproj @@ -33,12 +33,32 @@ False + + - + + + + + + + + + + + + + + + + + + + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Interfaces/BindingContext/IMvxBindingContext.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Interfaces/BindingContext/IMvxBindingContext.cs new file mode 100644 index 000000000..3afb8f7a4 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Interfaces/BindingContext/IMvxBindingContext.cs @@ -0,0 +1,17 @@ +// IMvxBindingContext.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.MvvmCross.Binding.Interfaces.BindingContext; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Touch.Interfaces.BindingContext +{ + public interface IMvxBindingContext + : IMvxBaseBindingContext + { + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/MvxMacBindingBuilder.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/MvxMacBindingBuilder.cs index 9f5e76782..57235428b 100644 --- a/Cirrious/Cirrious.MvvmCross.Binding.Mac/MvxMacBindingBuilder.cs +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/MvxMacBindingBuilder.cs @@ -8,26 +8,64 @@ using System; using Cirrious.MvvmCross.Binding.Bindings.Target.Construction; using Cirrious.CrossCore.Converters; +using Cirrious.MvvmCross.Binding.BindingContext; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Binding.Mac.Target; -namespace Cirrious.MvvmCross.Binding.Touch +namespace Cirrious.MvvmCross.Binding.Mac { public class MvxMacBindingBuilder : MvxBindingBuilder { - private readonly Action _fillRegistryAction; - private readonly Action _fillValueConvertersAction; + private readonly Action _fillRegistryAction; + private readonly Action _fillValueConvertersAction; + private readonly Action _fillBindingNamesAction; - public MvxMacBindingBuilder(Action fillRegistryAction, - Action fillValueConvertersAction) + public MvxMacBindingBuilder(Action fillRegistryAction = null, + Action fillValueConvertersAction = null, + Action fillBindingNamesAction = null) { - _fillRegistryAction = fillRegistryAction; - _fillValueConvertersAction = fillValueConvertersAction; + _fillRegistryAction = fillRegistryAction; + _fillValueConvertersAction = fillValueConvertersAction; + _fillBindingNamesAction = fillBindingNamesAction; } protected override void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry) { base.FillTargetFactories(registry); + registry.RegisterCustomBindingFactory("Visibility", + view => + new MvxNSViewVisibilityTargetBinding(view)); + registry.RegisterCustomBindingFactory("Visible", + view => + new MvxNSViewVisibleTargetBinding(view)); + registry.RegisterPropertyInfoBindingFactory(typeof(MvxNSSliderValueTargetBinding), typeof(NSSlider), + "Value"); + registry.RegisterPropertyInfoBindingFactory(typeof (MvxNSDatePickerDateTargetBinding), + typeof (NSDatePicker), + "Date"); + registry.RegisterCustomBindingFactory( + "Time", + view => new MvxNSDatePickerTimeTargetBinding(view, (typeof(NSDatePicker).GetProperty("Date")))); + + registry.RegisterPropertyInfoBindingFactory(typeof (MvxNSTextFieldTextTargetBinding), typeof (NSTextField), + "StringValue"); + registry.RegisterPropertyInfoBindingFactory(typeof (MvxNSTextViewTextTargetBinding), typeof (NSTextView), + "StringValue"); + + registry.RegisterPropertyInfoBindingFactory(typeof (MvxNSSwitchOnTargetBinding), typeof (NSButton), "On"); + registry.RegisterPropertyInfoBindingFactory(typeof(MvxNSSearchFieldTextTargetBinding), typeof(NSSearchField), "Text"); + + registry.RegisterCustomBindingFactory("Title", + (button) => new MvxNSButtonTitleTargetBinding(button)); + + /* Todo: Address this for trackpad + registry.RegisterCustomBindingFactory("Tap", view => new MvxNSViewTapTargetBinding(view)); + registry.RegisterCustomBindingFactory("DoubleTap", view => new MvxNSViewTapTargetBinding(view, 2, 1)); + registry.RegisterCustomBindingFactory("TwoFingerTap", view => new MvxNSViewTapTargetBinding(view, 1, 2)); + */ + if (_fillRegistryAction != null) _fillRegistryAction(registry); } @@ -45,5 +83,31 @@ namespace Cirrious.MvvmCross.Binding.Touch if (_fillValueConvertersAction != null) _fillValueConvertersAction(registry); } - } + + protected override void FillDefaultBindingNames(IMvxBindingNameRegistry registry) + { + base.FillDefaultBindingNames(registry); + + registry.AddOrOverwrite(typeof (NSButton), "TouchUpInside"); + registry.AddOrOverwrite(typeof (NSSegmentedControl), "Clicked"); + + registry.AddOrOverwrite(typeof (NSSearchField), "Text"); + registry.AddOrOverwrite(typeof (NSTextField), "Text"); + registry.AddOrOverwrite(typeof (NSTextView), "Text"); + registry.AddOrOverwrite(typeof (NSTextField), "Text"); +// registry.AddOrOverwrite(typeof (MvxCollectionViewSource), "ItemsSource"); +// registry.AddOrOverwrite(typeof (MvxTableViewSource), "ItemsSource"); +// registry.AddOrOverwrite(typeof (MvxImageView), "ImageUrl"); + registry.AddOrOverwrite(typeof (NSImageView), "Image"); + registry.AddOrOverwrite(typeof (NSDatePicker), "Date"); + registry.AddOrOverwrite(typeof (NSSlider), "Value"); + registry.AddOrOverwrite(typeof (NSButton), "On"); + registry.AddOrOverwrite(typeof (NSDatePicker), "Date"); +// registry.AddOrOverwrite(typeof (IMvxImageHelper), "ImageUrl"); +// registry.AddOrOverwrite(typeof (MvxImageViewLoader), "ImageUrl"); + + if (_fillBindingNamesAction != null) + _fillBindingNamesAction(registry); + } + } } \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxBaseNSDatePickerTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxBaseNSDatePickerTargetBinding.cs new file mode 100755 index 000000000..499c42a0d --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxBaseNSDatePickerTargetBinding.cs @@ -0,0 +1,63 @@ +// MvxBaseUIDatePickerTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public abstract class MvxBaseNSDatePickerTargetBinding : MvxPropertyInfoTargetBinding + { + protected MvxBaseNSDatePickerTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var datePicker = View; + if (datePicker == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, + "Error - NSDatePicker is null in MvxBaseNSDatePickerTargetBinding"); + } + else + { + datePicker.Action = new MonoMac.ObjCRuntime.Selector ("datePickerAction:"); + } + } + + [Export("datePickerAction:")] + private void datePickerAction() + { + var view = View; + if (view == null) + return; + FireValueChanged(GetValueFrom(view)); + } + + protected abstract object GetValueFrom(NSDatePicker view); + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var datePicker = View; + if (datePicker != null) + { +// datePicker.ValueChanged -= DatePickerOnValueChanged; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSButtonTitleTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSButtonTitleTargetBinding.cs new file mode 100755 index 000000000..c684d97e2 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSButtonTitleTargetBinding.cs @@ -0,0 +1,49 @@ +// MvxUIButtonTitleTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSButtonTitleTargetBinding : MvxTargetBinding + { + protected NSButton Button + { + get { return base.Target as NSButton; } + } + + public MvxNSButtonTitleTargetBinding(NSButton button) + : base(button) + { + if (button == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, "Error - NSButton is null in MvxNSButtonTitleTargetBinding"); + } + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.OneWay; } + } + + public override System.Type TargetType + { + get { return typeof (string); } + } + + public override void SetValue(object value) + { + var button = Button; + if (button == null) + return; + + button.Title = value as string; + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerDateTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerDateTargetBinding.cs new file mode 100755 index 000000000..dc6d91abc --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerDateTargetBinding.cs @@ -0,0 +1,36 @@ +// MvxUIDatePickerDateTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Reflection; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSDatePickerDateTargetBinding : MvxBaseNSDatePickerTargetBinding + { + public MvxNSDatePickerDateTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + } + + protected override object GetValueFrom(NSDatePicker view) + { + return ((DateTime) view.DateValue).Date; + } + + protected override object MakeSafeValue(object value) + { + if (value == null) + value = DateTime.UtcNow; + var date = (DateTime) value; + NSDate nsDate = date; + return nsDate; + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerTimeTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerTimeTargetBinding.cs new file mode 100755 index 000000000..34aa03fed --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSDatePickerTimeTargetBinding.cs @@ -0,0 +1,53 @@ +// MvxUIDatePickerTimeTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Reflection; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSDatePickerTimeTargetBinding : MvxBaseNSDatePickerTargetBinding + { + public MvxNSDatePickerTimeTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + } + + protected override object GetValueFrom(NSDatePicker view) + { + var components = NSCalendar.CurrentCalendar.Components( + NSCalendarUnit.Hour | NSCalendarUnit.Minute | NSCalendarUnit.Second, + view.DateValue); + return new TimeSpan(components.Hour, components.Minute, components.Second); + } + + public override Type TargetType + { + get { return typeof(TimeSpan); } + } + + protected override object MakeSafeValue(object value) + { + if (value == null) + value = TimeSpan.FromSeconds(0); + var time = (TimeSpan) value; + var now = DateTime.Now; + var date = new DateTime( + now.Year, + now.Month, + now.Day, + time.Hours, + time.Minutes, + time.Seconds, + DateTimeKind.Local); + + return date; + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSearchFieldTextTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSearchFieldTextTargetBinding.cs new file mode 100755 index 000000000..efb60fafe --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSearchFieldTextTargetBinding.cs @@ -0,0 +1,57 @@ +// MvxUISearchBarTextTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; +using MonoMac.Foundation; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSSearchFieldTextTargetBinding : MvxPropertyInfoTargetBinding + { + public MvxNSSearchFieldTextTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var searchField = View; + if (searchField == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, + "Error - NSSearchField is null in MvxNSSearchFieldTextTargetBinding"); + } + else + { + searchField.Action = new MonoMac.ObjCRuntime.Selector ("searchFieldAction:"); + } + } + + [Export("searchFieldAction:")] + private void searchFieldAction() + { + FireValueChanged(View.StringValue); + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var searchBar = View; + if (searchBar != null) + { +// searchBar.TextChanged -= HandleSearchBarValueChanged; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSliderValueTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSliderValueTargetBinding.cs new file mode 100755 index 000000000..0b53fed6a --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSliderValueTargetBinding.cs @@ -0,0 +1,59 @@ +// MvxUISliderValueTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; +using MonoMac.Foundation; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSSliderValueTargetBinding : MvxPropertyInfoTargetBinding + { + public MvxNSSliderValueTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var slider = View; + if (slider == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, "Error - NSSlider is null in MvxNSSliderValueTargetBinding"); + } + else + { + slider.Action = new MonoMac.ObjCRuntime.Selector ("sliderAction:"); + } + } + + [Export("sliderAction:")] + private void sliderAction() + { + var view = View; + if (view == null) + return; + FireValueChanged(view.IntValue); + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var slider = View; + if (slider != null) + { +// slider.ValueChanged -= HandleSliderValueChanged; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSwitchOnTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSwitchOnTargetBinding.cs new file mode 100755 index 000000000..1df966cae --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSSwitchOnTargetBinding.cs @@ -0,0 +1,59 @@ +// MvxUISwitchOnTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; +using MonoMac.Foundation; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSSwitchOnTargetBinding : MvxPropertyInfoTargetBinding + { + public MvxNSSwitchOnTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var checkBox = View; + if (checkBox == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, "Error - NSButton is null in MvxNSSwitchOnTargetBinding"); + } + else + { + checkBox.Action = new MonoMac.ObjCRuntime.Selector ("checkBoxAction:"); + } + } + + [Export("checkBoxAction:")] + private void checkBoxAction() + { + var view = View; + if (view == null) + return; + FireValueChanged(view.State == NSCellStateValue.On); + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var view = View; + if (view != null) + { +// view.ValueChanged -= HandleValueChanged; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextFieldTextTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextFieldTextTargetBinding.cs new file mode 100755 index 000000000..3791d1ff0 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextFieldTextTargetBinding.cs @@ -0,0 +1,57 @@ +// MvxUITextFieldTextTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; +using MonoMac.Foundation; +using System; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSTextFieldTextTargetBinding : MvxPropertyInfoTargetBinding + { + public MvxNSTextFieldTextTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var editText = View; + if (editText == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, + "Error - NSTextField is null in MvxNSTextFieldTextTargetBinding"); + } + else + { + editText.Changed += (object sender, EventArgs e) => { + var view = View; + if (view == null) + return; + FireValueChanged(view.StringValue); + }; + } + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var editText = View; + if (editText != null) + { +// editText.EditingChanged -= HandleEditTextValueChanged; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextViewTextTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextViewTextTargetBinding.cs new file mode 100755 index 000000000..c821d48af --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSTextViewTextTargetBinding.cs @@ -0,0 +1,60 @@ +// MvxUITextViewTextTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Reflection; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSTextViewTextTargetBinding : MvxPropertyInfoTargetBinding + { + public MvxNSTextViewTextTargetBinding(object target, PropertyInfo targetPropertyInfo) + : base(target, targetPropertyInfo) + { + var editText = View; + if (editText == null) + { + MvxBindingTrace.Trace(MvxTraceLevel.Error, + "Error - NSTextView is null in MvxNSTextViewTextTargetBinding"); + } + else + { + // Todo: Perhaps we want to trigger on editing complete rather than didChange + editText.TextDidChange += EditTextDidChange; + } + } + + private void EditTextDidChange(object sender, EventArgs eventArgs) + { + var view = View; + if (view == null) + return; + FireValueChanged(view.TextStorage.ToString()); + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.TwoWay; } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + if (isDisposing) + { + var editText = View; + if (editText != null) + { + editText.TextDidChange -= EditTextDidChange; + } + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibilityTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibilityTargetBinding.cs new file mode 100755 index 000000000..145345941 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibilityTargetBinding.cs @@ -0,0 +1,58 @@ +// MvxNSViewVisibilityTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Contributed by Tim Uy, tim@loqu8.com + +using Cirrious.CrossCore.Platform; +using Cirrious.CrossCore.UI; +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSViewVisibilityTargetBinding : MvxTargetBinding + { + protected NSView View + { + get { return (NSView) Target; } + } + + public MvxNSViewVisibilityTargetBinding(NSView target) + : base(target) + { + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.OneWay; } + } + + public override System.Type TargetType + { + get { return typeof (MvxVisibility); } + } + + public override void SetValue(object value) + { + var view = View; + if (view == null) + return; + + var visibility = (MvxVisibility) value; + switch (visibility) + { + case MvxVisibility.Visible: + view.Hidden = false; + break; + case MvxVisibility.Collapsed: + view.Hidden = true; + break; + default: + MvxBindingTrace.Trace(MvxTraceLevel.Warning, "Visibility out of range {0}", value); + break; + } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibleTargetBinding.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibleTargetBinding.cs new file mode 100755 index 000000000..fbb471bff --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Target/MvxNSViewVisibleTargetBinding.cs @@ -0,0 +1,45 @@ +// MvxUIViewVisibleTargetBinding.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Contributed by Tim Uy, tim@loqu8.com + +using Cirrious.MvvmCross.Binding.Bindings.Target; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Binding.Mac.Target +{ + public class MvxNSViewVisibleTargetBinding : MvxTargetBinding + { + protected NSView View + { + get { return (NSView) Target; } + } + + public MvxNSViewVisibleTargetBinding(NSView target) + : base(target) + { + } + + public override MvxBindingMode DefaultMode + { + get { return MvxBindingMode.OneWay; } + } + + public override System.Type TargetType + { + get { return typeof (bool); } + } + + public override void SetValue(object value) + { + var view = View; + if (view == null) + return; + + var visible = (bool) value; + view.Hidden = !visible; + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/IMvxBindable.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/IMvxBindable.cs new file mode 100644 index 000000000..f6c22825f --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/IMvxBindable.cs @@ -0,0 +1,18 @@ +// IMvxBindable.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.CrossCore.Core; +using Cirrious.MvvmCross.Binding.BindingContext; + +namespace Cirrious.MvvmCross.Binding.Mac.Views +{ + public interface IMvxBindable + : IMvxBindingContextOwner + , IMvxDataConsumer + { + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/MvxView.cs b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/MvxView.cs new file mode 100644 index 000000000..08a7ae958 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Binding.Mac/Views/MvxView.cs @@ -0,0 +1,60 @@ +// MvxView.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Drawing; +using Cirrious.MvvmCross.Binding.BindingContext; +using MonoMac.AppKit; +using MonoMac.Foundation; + +namespace Cirrious.MvvmCross.Binding.Mac.Views +{ + public class MvxView + : NSView + , IMvxBindable + { + public IMvxBindingContext BindingContext { get; set; } + + public MvxView() + { + this.CreateBindingContext(); + } + + public MvxView(IntPtr handle) + : base(handle) + { + this.CreateBindingContext(); + } + + public MvxView(NSCoder coder) + : base(coder) + { + this.CreateBindingContext(); + } + + public MvxView(RectangleF frame) + : base(frame) + { + this.CreateBindingContext(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + BindingContext.ClearAllBindings(); + } + base.Dispose(disposing); + } + + public object DataContext + { + get { return BindingContext.DataContext; } + set { BindingContext.DataContext = value; } + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Cirrious.MvvmCross.Mac.csproj b/Cirrious/Cirrious.MvvmCross.Mac/Cirrious.MvvmCross.Mac.csproj index 245c58ac9..60921a41b 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Cirrious.MvvmCross.Mac.csproj +++ b/Cirrious/Cirrious.MvvmCross.Mac/Cirrious.MvvmCross.Mac.csproj @@ -30,13 +30,12 @@ - + + False + - - - @@ -45,16 +44,29 @@ - - + + + + + + + + + {B6E27475-E7D0-448C-A5CC-5097DCA1E2DD} + Cirrious.MvvmCross + + + {B4789586-AEBB-4597-A849-23F3E45AF421} + Cirrious.MvvmCross.Binding.Mac + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} Cirrious.CrossCore @@ -63,13 +75,9 @@ {64DCD397-9019-41E8-A928-E5F5C5DF185B} Cirrious.MvvmCross.Binding - - {B6E27475-E7D0-448C-A5CC-5097DCA1E2DD} - Cirrious.MvvmCross + + {596C75FB-F491-4037-89F6-B4F34183D83D} + Cirrious.CrossCore.Mac - - - - \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxApplicationDelegate.cs b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxApplicationDelegate.cs index 5c2a23f5d..bf5fd2606 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxApplicationDelegate.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxApplicationDelegate.cs @@ -12,6 +12,7 @@ using System; using Cirrious.MvvmCross.Platform; using MonoMac.AppKit; + namespace Cirrious.MvvmCross.Mac.Platform { public class MvxApplicationDelegate : NSApplicationDelegate diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxDebugTrace.cs b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxDebugTrace.cs index 276a72215..9567fb3b9 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxDebugTrace.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxDebugTrace.cs @@ -9,7 +9,6 @@ using System; -using Cirrious.CrossCore.Interfaces.Platform.Diagnostics; using Cirrious.CrossCore.Platform; @@ -19,14 +18,19 @@ namespace Cirrious.MvvmCross.Mac.Platform { public class MvxDebugTrace : IMvxTrace { - public void Trace(MvxTraceLevel level, string tag, string message) - { - Console.WriteLine(tag + ": " + level + ": " + message); - } + public void Trace(MvxTraceLevel level, string tag, Func message) + { + Console.WriteLine(tag + ":" + level + ":" + message()); + } - public void Trace(MvxTraceLevel level, string tag, string message, params object[] args) - { - Console.WriteLine(tag + ": " + level + ": " + message, args); - } + public void Trace(MvxTraceLevel level, string tag, string message) + { + Console.WriteLine(tag + ": " + level + ": " + message); + } + + public void Trace(MvxTraceLevel level, string tag, string message, params object[] args) + { + Console.WriteLine(tag + ": " + level + ": " + message, args); + } } } \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxMacSetup.cs b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxMacSetup.cs index b3ea6686c..077f5a326 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxMacSetup.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxMacSetup.cs @@ -10,13 +10,21 @@ using System; using System.Collections.Generic; -using Cirrious.MvvmCross.Platform; -using Cirrious.MvvmCross.Mac.Interfaces; -using Cirrious.MvvmCross.Mac.Views; -using Cirrious.MvvmCross.Views; +using System.Reflection; using Cirrious.CrossCore; +using Cirrious.CrossCore.Converters; using Cirrious.CrossCore.Platform; using Cirrious.CrossCore.Plugins; +using Cirrious.MvvmCross.Binding; +using Cirrious.MvvmCross.Binding.Binders; +using Cirrious.MvvmCross.Binding.BindingContext; +using Cirrious.MvvmCross.Binding.Bindings.Target.Construction; +using Cirrious.MvvmCross.Platform; +using Cirrious.MvvmCross.Mac.Views; +using Cirrious.MvvmCross.Views; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Binding.Mac; namespace Cirrious.MvvmCross.Mac.Platform { @@ -24,27 +32,50 @@ namespace Cirrious.MvvmCross.Mac.Platform : MvxSetup { private readonly MvxApplicationDelegate _applicationDelegate; - private readonly IMvxMacViewPresenter _presenter; + private readonly NSWindow _window; + + private IMvxMacViewPresenter _presenter; + + protected MvxMacSetup(MvxApplicationDelegate applicationDelegate, NSWindow window) + { + _window = window; + _applicationDelegate = applicationDelegate; + } protected MvxMacSetup(MvxApplicationDelegate applicationDelegate, IMvxMacViewPresenter presenter) { _presenter = presenter; _applicationDelegate = applicationDelegate; } + + protected NSWindow Window + { + get { return _window; } + } - protected override void InitializeDebugServices() - { + protected MvxApplicationDelegate ApplicationDelegate + { + get { return _applicationDelegate; } + } + + protected override IMvxTrace CreateDebugTrace() + { + return new MvxDebugTrace(); + } + + protected override void InitializeDebugServices() + { Mvx.RegisterSingleton(new MvxDebugTrace()); - base.InitializeDebugServices(); - } + base.InitializeDebugServices(); + } - protected override IMvxPluginManager CreatePluginManager() - { + protected override IMvxPluginManager CreatePluginManager() + { var toReturn = new MvxLoaderPluginManager(); - var registry = new MvxLoaderPluginRegistry(".Mac", toReturn.Loaders); + var registry = new MvxLoaderPluginRegistry(".Mac", toReturn.Finders); AddPluginsLoaders(registry); return toReturn; - } + } protected virtual void AddPluginsLoaders(MvxLoaderPluginRegistry loaders) { @@ -54,13 +85,14 @@ namespace Cirrious.MvvmCross.Mac.Platform protected sealed override MvxViewsContainer CreateViewsContainer() { var container = new MvxMacViewsContainer(); - RegisterTouchViewCreator(container); + RegisterMacViewCreator(container); return container; } - protected void RegisterTouchViewCreator(MvxMacViewsContainer container) + protected void RegisterMacViewCreator(MvxMacViewsContainer container) { Mvx.RegisterSingleton(container); + Mvx.RegisterSingleton(container); } protected override IMvxViewDispatcher CreateViewDispatcher() @@ -68,15 +100,36 @@ namespace Cirrious.MvvmCross.Mac.Platform return new MvxMacViewDispatcher(_presenter); } - protected override void InitializePlatformServices () + protected override void InitializePlatformServices() + { + RegisterPresenter(); + RegisterLifetime(); + } + + protected virtual void RegisterLifetime() { Mvx.RegisterSingleton(_applicationDelegate); } - protected override IDictionary GetViewModelViewLookup() - { - return GetViewModelViewLookup(GetType().Assembly, typeof(IMvxMacView)); - } + protected IMvxMacViewPresenter Presenter + { + get + { + _presenter = _presenter ?? CreatePresenter(); + return _presenter; + } + } + + protected virtual IMvxMacViewPresenter CreatePresenter() + { + return new MvxMacViewPresenter(_applicationDelegate, _window); + } + + protected virtual void RegisterPresenter() + { + var presenter = Presenter; + Mvx.RegisterSingleton(presenter); + } protected override void InitializeLastChance() { @@ -86,31 +139,46 @@ namespace Cirrious.MvvmCross.Mac.Platform protected virtual void InitialiseBindingBuilder() { + RegisterBindingBuilderCallbacks(); var bindingBuilder = CreateBindingBuilder(); bindingBuilder.DoRegistration(); } - + + protected virtual void RegisterBindingBuilderCallbacks() + { + Mvx.CallbackWhenRegistered(FillValueConverters); + Mvx.CallbackWhenRegistered(FillTargetFactories); + Mvx.CallbackWhenRegistered(FillBindingNames); + } + protected virtual MvxBindingBuilder CreateBindingBuilder() { - var bindingBuilder = new MvxMacBindingBuilder(FillTargetFactories, FillValueConverters); + var bindingBuilder = new MvxMacBindingBuilder(); return bindingBuilder; } - + + protected virtual void FillBindingNames (IMvxBindingNameRegistry obj) + { + // this base class does nothing + } + protected virtual void FillValueConverters(IMvxValueConverterRegistry registry) { - var holders = ValueConverterHolders; - if (holders == null) - return; - - var filler = new MvxInstanceBasedValueConverterRegistryFiller(registry); - var staticFiller = new MvxStaticBasedValueConverterRegistryFiller(registry); - foreach (var converterHolder in holders) + registry.Fill(ValueConverterAssemblies); + registry.Fill(ValueConverterHolders); + } + + protected virtual List ValueConverterAssemblies + { + get { - filler.AddFieldConverters(converterHolder); - staticFiller.AddStaticFieldConverters(converterHolder); + var toReturn = new List(); + toReturn.AddRange(GetViewModelAssemblies()); + toReturn.AddRange(GetViewAssemblies()); + return toReturn; } } - + protected virtual IEnumerable ValueConverterHolders { get { return null; } diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxTouchSetup.cs b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxTouchSetup.cs new file mode 100644 index 000000000..347d5e3ac --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Platform/MvxTouchSetup.cs @@ -0,0 +1,132 @@ +// MvxMacSetup.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using System.Collections.Generic; +using System.Reflection; +using Cirrious.CrossCore; +using Cirrious.CrossCore.Converters; +using Cirrious.CrossCore.Platform; +using Cirrious.CrossCore.Plugins; +using Cirrious.MvvmCross.Binding; +using Cirrious.MvvmCross.Binding.Binders; +using Cirrious.MvvmCross.Binding.Bindings.Target.Construction; +using Cirrious.MvvmCross.Binding.Touch; +using Cirrious.MvvmCross.Platform; +using Cirrious.MvvmCross.Mac.Views; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using Cirrious.MvvmCross.Views; +using Cirrious.CrossCore.Mac.Views; + +namespace Cirrious.MvvmCross.Mac.Platform +{ + public abstract class MvxMacSetup + : MvxSetup + { + private readonly MvxApplicationDelegate _applicationDelegate; + private readonly IMvxMacViewPresenter _presenter; + + protected MvxMacSetup(MvxApplicationDelegate applicationDelegate, IMvxMacViewPresenter presenter) + { + _presenter = presenter; + _applicationDelegate = applicationDelegate; + } + + protected override void InitializeDebugServices() + { + Mvx.RegisterSingleton(new MvxDebugTrace()); + base.InitializeDebugServices(); + } + + protected override IMvxPluginManager CreatePluginManager() + { + var toReturn = new MvxLoaderPluginManager(); + var registry = new MvxLoaderPluginRegistry(".Mac", toReturn.Finders); + AddPluginsLoaders(registry); + return toReturn; + } + + protected virtual void AddPluginsLoaders(MvxLoaderPluginRegistry loaders) + { + // none added by default + } + + protected override sealed MvxViewsContainer CreateViewsContainer() + { + var container = new MvxMacViewsContainer(); + RegisterTouchViewCreator(container); + return container; + } + + protected virtual void RegisterTouchViewCreator(MvxMacViewsContainer container) + { + Mvx.RegisterSingleton(container); + Mvx.RegisterSingleton(container); + } + + protected override IMvxViewDispatcher CreateViewDispatcher() + { + return new MvxMacViewDispatcher(_presenter); + } + + protected override void InitializePlatformServices() + { + Mvx.RegisterSingleton(_presenter); + Mvx.RegisterSingleton(_applicationDelegate); + } + + protected override void InitializeLastChance() + { + InitialiseBindingBuilder(); + base.InitializeLastChance(); + } + + protected virtual void InitialiseBindingBuilder() + { + var bindingBuilder = CreateBindingBuilder(); + bindingBuilder.DoRegistration(); + } + + protected virtual MvxBindingBuilder CreateBindingBuilder() + { + var bindingBuilder = new MvxMacBindingBuilder(FillTargetFactories, FillValueConverters, FillBindingNames); + return bindingBuilder; + } + + protected virtual void FillBindingNames (Cirrious.MvvmCross.Binding.BindingContext.IMvxBindingNameRegistry obj) + { + // this base class does nothing + } + + protected virtual void FillValueConverters(IMvxValueConverterRegistry registry) + { + registry.Fill(ValueConverterAssemblies); + registry.Fill(ValueConverterHolders); + } + + protected virtual List ValueConverterHolders + { + get { return new List(); } + } + + protected virtual List ValueConverterAssemblies + { + get + { + var toReturn = new List(); + toReturn.AddRange(GetViewModelAssemblies()); + toReturn.AddRange(GetViewAssemblies()); + return toReturn; + } + } + + protected virtual void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry) + { + // this base class does nothing + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxBindingViewControllerAdapter.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxBindingViewControllerAdapter.cs new file mode 100644 index 000000000..d27a1de3a --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxBindingViewControllerAdapter.cs @@ -0,0 +1,43 @@ +// MvxBindingViewControllerAdapter.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using Cirrious.CrossCore.Platform; +using Cirrious.CrossCore.Mac.Views; +using Cirrious.MvvmCross.Binding.BindingContext; + +namespace Cirrious.MvvmCross.Mac.Views +{ + public class MvxBindingViewControllerAdapter : MvxBaseViewControllerAdapter + { + protected IMvxMacView MacView + { + get { return ViewController as IMvxMacView; } + } + + public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource) + : base(eventSource) + { + if (!(eventSource is IMvxMacView)) + throw new ArgumentException("eventSource", "eventSource should be a IMvxMacView"); + + MacView.BindingContext = new MvxBindingContext(); + } + + public override void HandleDisposeCalled(object sender, EventArgs e) + { + if (MacView == null) + { + MvxTrace.Warning( "MacView is null for clearup of bindings in type {0}", + MacView.GetType().Name); + return; + } + MacView.ClearAllBindings(); + base.HandleDisposeCalled(sender, e); + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewDispatcher.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewDispatcher.cs index 351df291b..27275d0ba 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewDispatcher.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewDispatcher.cs @@ -8,13 +8,10 @@ // Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com using System; -using Cirrious.MvvmCross.Interfaces.ViewModels; -using Cirrious.MvvmCross.Interfaces.Views; -using Cirrious.MvvmCross.Mac.Interfaces; -using Cirrious.MvvmCross.Views; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Mac.Views.Presenters; using Cirrious.MvvmCross.ViewModels; -using Cirrious.CrossCore.Platform.Diagnostics; -using Cirrious.CrossCore; +using Cirrious.MvvmCross.Views; namespace Cirrious.MvvmCross.Mac.Views { @@ -29,21 +26,20 @@ namespace Cirrious.MvvmCross.Mac.Views _presenter = presenter; } - public bool RequestNavigate(MvxViewModelRequest request) - { - Action action = () => - { - Mvx.TaggedTrace("MacNavigation", "Navigate requested"); - _presenter.Show(request); - }; - return RequestMainThreadAction(action); - } - + public bool ShowViewModel(MvxViewModelRequest request) + { + Action action = () => + { + MvxTrace.TaggedTrace("MacNavigation", "Navigate requested"); + _presenter.Show(request); + }; + return RequestMainThreadAction(action); + } public bool ChangePresentation(MvxPresentationHint hint) { Action action = () => { - Mvx.TaggedTrace("MacNavigation", "Change presentation requested"); + MvxTrace.TaggedTrace("MacNavigation", "Change presentation requested"); _presenter.ChangePresentation(hint); }; return RequestMainThreadAction(action); diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewsContainer.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewsContainer.cs index 79befc40f..cd242eeb4 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewsContainer.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxMacViewsContainer.cs @@ -8,7 +8,6 @@ // Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com using System; -using Cirrious.MvvmCross.Mac.Interfaces; using Cirrious.MvvmCross.Views; using Cirrious.MvvmCross.ViewModels; using Cirrious.CrossCore.Exceptions; @@ -16,7 +15,7 @@ using Cirrious.CrossCore.Exceptions; namespace Cirrious.MvvmCross.Mac.Views { public class MvxMacViewsContainer - : MvxViewsContainer, IMvxMacViewCreator + : MvxViewsContainer, IMvxMacViewCreator, IMvxCurrentRequest { public MvxViewModelRequest CurrentRequest { get; private set; } diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewController.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewController.cs index a70d09b73..bfbf4b38e 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewController.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewController.cs @@ -11,15 +11,12 @@ using System; -using Cirrious.MvvmCross.Interfaces.ViewModels; -using Cirrious.MvvmCross.Mac.ExtensionMethods; -using Cirrious.MvvmCross.Mac.Interfaces; -using Cirrious.MvvmCross.Views; -using MonoMac.Foundation; -using Cirrious.MvvmCross.ViewModels; -using Cirrious.MvvmCross.Binding.Interfaces.BindingContext; -using MonoMac.AppKit; +using Cirrious.CrossCore.Mac.Views; using Cirrious.MvvmCross.Binding.BindingContext; +using Cirrious.MvvmCross.Views; +using Cirrious.MvvmCross.ViewModels; +using MonoMac.Foundation; +using MonoMac.AppKit; namespace Cirrious.MvvmCross.Mac.Views diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdapter.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdapter.cs new file mode 100644 index 000000000..19a01e150 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdapter.cs @@ -0,0 +1,40 @@ +// MvxViewControllerAdapter.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using Cirrious.CrossCore.Mac.Views; +using Cirrious.MvvmCross.Views; + +namespace Cirrious.MvvmCross.Mac.Views +{ + public class MvxViewControllerAdapter : MvxBaseViewControllerAdapter + { + protected IMvxMacView MacView + { + get { return base.ViewController as IMvxMacView; } + } + + public MvxViewControllerAdapter(IMvxEventSourceViewController eventSource) + : base(eventSource) + { + if (!(eventSource is IMvxMacView)) + throw new ArgumentException("eventSource", "eventSource should be a IMvxMacView"); + } + + public override void HandleViewDidLoadCalled(object sender, EventArgs e) + { + MacView.OnViewCreate(); + base.HandleViewDidLoadCalled(sender, e); + } + + public override void HandleDisposeCalled(object sender, EventArgs e) + { + MacView.OnViewDestroy(); + base.HandleDisposeCalled(sender, e); + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdaptingExtensions.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdaptingExtensions.cs new file mode 100644 index 000000000..4e43ea283 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerAdaptingExtensions.cs @@ -0,0 +1,20 @@ +// MvxViewControllerAdaptingExtensions.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.CrossCore.Mac.Views; + +namespace Cirrious.MvvmCross.Mac.Views +{ + public static class MvxViewControllerAdaptingExtensions + { + public static void AdaptForBinding(this IMvxEventSourceViewController view) + { + var adapter = new MvxViewControllerAdapter(view); + var binding = new MvxBindingViewControllerAdapter(view); + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerExtensionMethods.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerExtensionMethods.cs new file mode 100644 index 000000000..743c74ec6 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/MvxViewControllerExtensionMethods.cs @@ -0,0 +1,97 @@ +// MvxViewControllerExtensionMethods.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System.Collections.Generic; +using Cirrious.CrossCore.Exceptions; +using Cirrious.CrossCore; +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.Platform; +using Cirrious.MvvmCross.ViewModels; +using Cirrious.MvvmCross.Views; + +namespace Cirrious.MvvmCross.Mac.Views +{ + public static class MvxViewControllerExtensionMethods + { + public static void OnViewCreate(this IMvxMacView macView) + { + //var view = touchView as IMvxView; + macView.OnViewCreate(() => { return macView.LoadViewModel(); }); + } + + private static IMvxViewModel LoadViewModel(this IMvxMacView macView) + { +#warning NullViewModel needed? + // how to do N + //if (typeof (TViewModel) == typeof (MvxNullViewModel)) + // return new MvxNullViewModel() as TViewModel; + + if (macView.Request == null) + { + MvxTrace.Trace( + "Request is null - assuming this is a TabBar type situation where ViewDidLoad is called during construction... patching the request now - but watch out for problems with virtual calls during construction"); + macView.Request = Mvx.Resolve().CurrentRequest; + } + + var instanceRequest = macView.Request as MvxViewModelInstanceRequest; + if (instanceRequest != null) + { + return instanceRequest.ViewModelInstance; + } + + var loader = Mvx.Resolve(); + var viewModel = loader.LoadViewModel(macView.Request, null /* no saved state on iOS currently */); + if (viewModel == null) + throw new MvxException("ViewModel not loaded for " + macView.Request.ViewModelType); + return viewModel; + } + + public static IMvxMacView CreateViewControllerFor(this IMvxMacView view, + object parameterObject) + where TTargetViewModel : class, IMvxViewModel + { + return + view.CreateViewControllerFor(parameterObject == null + ? null + : parameterObject.ToSimplePropertyDictionary()); + } + +#warning TODO - could this move down to IMvxView level? + public static IMvxMacView CreateViewControllerFor( + this IMvxMacView view, + IDictionary parameterValues = null) + where TTargetViewModel : class, IMvxViewModel + { + var parameterBundle = new MvxBundle(parameterValues); + var request = new MvxViewModelRequest(parameterBundle, null, + MvxRequestedBy.UserAction); + return view.CreateViewControllerFor(request); + } + + public static IMvxMacView CreateViewControllerFor( + this IMvxMacView view, + MvxViewModelRequest request) + where TTargetViewModel : class, IMvxViewModel + { + return Mvx.Resolve().CreateView(request); + } + + public static IMvxMacView CreateViewControllerFor( + this IMvxMacView view, + MvxViewModelRequest request) + { + return Mvx.Resolve().CreateView(request); + } + + public static IMvxMacView CreateViewControllerFor( + this IMvxMacView view, + IMvxViewModel viewModel) + { + return Mvx.Resolve().CreateView(viewModel); + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/IMvxMacViewPresenter.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/IMvxMacViewPresenter.cs new file mode 100644 index 000000000..7bf993288 --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/IMvxMacViewPresenter.cs @@ -0,0 +1,17 @@ +// IMvxTouchViewPresenter.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.MvvmCross.ViewModels; +using Cirrious.MvvmCross.Views; + +namespace Cirrious.MvvmCross.Mac.Views.Presenters +{ + public interface IMvxMacViewPresenter + : IMvxViewPresenter + { + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxBaseMacViewPresenter.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxBaseMacViewPresenter.cs new file mode 100644 index 000000000..b44869f8b --- /dev/null +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxBaseMacViewPresenter.cs @@ -0,0 +1,26 @@ +// MvxBaseMacViewPresenter.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using Cirrious.CrossCore.Platform; +using Cirrious.MvvmCross.ViewModels; +using MonoMac.AppKit; + +namespace Cirrious.MvvmCross.Mac.Views.Presenters +{ + public class MvxBaseMacViewPresenter + : IMvxMacViewPresenter + { + public virtual void Show(MvxViewModelRequest view) + { + } + + public virtual void ChangePresentation(MvxPresentationHint hint) + { + MvxTrace.Warning("Hint ignored {0}", hint.GetType().Name); + } + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxMacViewPresenter.cs b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxMacViewPresenter.cs index 175aea83d..a49001123 100644 --- a/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxMacViewPresenter.cs +++ b/Cirrious/Cirrious.MvvmCross.Mac/Views/Presenters/MvxMacViewPresenter.cs @@ -1,72 +1,86 @@ -// -// (c) Copyright Cirrious. http://www.cirrious.com -// This source is subject to the Microsoft Public License (Ms-PL) -// Please see license.txt on http://opensource.org/licenses/ms-pl.html -// All other rights reserved. -// +// MvxTouchViewPresenter.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt // -// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com -using Cirrious.MvvmCross.Interfaces.Views; -using System; +// Project Lead - Stuart Lodge, @slodge, me@slodge.com - -using Cirrious.MvvmCross.Interfaces.ViewModels; -using Cirrious.MvvmCross.Mac.Interfaces; -using Cirrious.MvvmCross.Views; -using MonoMac.AppKit; -using Cirrious.MvvmCross.ViewModels; -using Cirrious.CrossCore.Interfaces.IoC; using Cirrious.CrossCore.Exceptions; -using Cirrious.CrossCore.Platform.Diagnostics; +using Cirrious.CrossCore; +using Cirrious.MvvmCross.ViewModels; +using MonoMac.AppKit; namespace Cirrious.MvvmCross.Mac.Views.Presenters { - public class MvxMacViewPresenter - : MvxBaseViewPresenter + public class MvxMacViewPresenter + : MvxBaseMacViewPresenter { private readonly NSApplicationDelegate _applicationDelegate; - private readonly NSWindow _window; + private readonly NSWindow _window; - protected NSWindow Window{ + protected virtual NSApplicationDelegate ApplicationDelegate{ + get{ + return _applicationDelegate; + } + } + + protected virtual NSWindow Window{ get{ return _window; } } - - public MvxMacViewPresenter (NSApplicationDelegate applicationDelegate, NSWindow window) + + public MvxMacViewPresenter(NSApplicationDelegate applicationDelegate, NSWindow window) { _applicationDelegate = applicationDelegate; - _window = window; - } + _window = window; + } - protected virtual void PlaceView(MvxShowViewModelRequest request, NSViewController viewController) + public override void Show(MvxViewModelRequest request) + { + var view = CreateView(request); + +#warning Need to reinsert ClearTop type functionality here + //if (request.ClearTop) + // ClearBackStack(); + + Show(view, request); + } + + public override void ChangePresentation(MvxPresentationHint hint) + { + if (hint is MvxClosePresentationHint) + { + Close((hint as MvxClosePresentationHint).ViewModelToClose); + return; + } + + base.ChangePresentation(hint); + } + + private IMvxMacView CreateView(MvxViewModelRequest request) + { + return Mvx.Resolve().CreateView(request); + } + + protected virtual void Show(IMvxMacView view, MvxViewModelRequest request) + { + var viewController = view as NSViewController; + if (viewController == null) + throw new MvxException("Passed in IMvxTouchView is not a UIViewController"); + + Show (viewController, request); + } + + protected virtual void Show(NSViewController viewController, MvxViewModelRequest request) { Window.ContentView.AddSubview(viewController.View); } - protected virtual IMvxMacView GetView(MvxShowViewModelRequest request) - { - var creator = Mvx.Resolve(); - return creator.CreateView(request); - } - public override void Show(MvxShowViewModelRequest request) + public virtual void Close(IMvxViewModel toClose) { - try - { - var view = GetView(request); - - var viewController = view as NSViewController; - if (viewController == null) - throw new MvxException("Passed in IMvxTouchView is not a NSViewController"); - - PlaceView(request, viewController); - } - catch (Exception exception) - { - MvxTrace.Trace("Error seen during navigation request to {0} - error {1}", request.ViewModelType.Name, - exception.ToLongString()); - } + Mvx.Error("Sorry - don't know how to close a view!"); } - } -} + } +} \ No newline at end of file diff --git a/Cirrious/Cirrious.MvvmCross/Cirrious.MvvmCross.csproj b/Cirrious/Cirrious.MvvmCross/Cirrious.MvvmCross.csproj index 7455f17fe..6e9b73c19 100644 --- a/Cirrious/Cirrious.MvvmCross/Cirrious.MvvmCross.csproj +++ b/Cirrious/Cirrious.MvvmCross/Cirrious.MvvmCross.csproj @@ -117,12 +117,6 @@ - - - {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} - Cirrious.CrossCore - - + + + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} + Cirrious.CrossCore + + \ No newline at end of file diff --git a/CrossCore/Cirrious.CrossCore.Mac/Cirrious.CrossCore.Mac.csproj b/CrossCore/Cirrious.CrossCore.Mac/Cirrious.CrossCore.Mac.csproj index a0c16f1e7..4130ac898 100644 --- a/CrossCore/Cirrious.CrossCore.Mac/Cirrious.CrossCore.Mac.csproj +++ b/CrossCore/Cirrious.CrossCore.Mac/Cirrious.CrossCore.Mac.csproj @@ -35,15 +35,16 @@ - + + diff --git a/CrossCore/Cirrious.CrossCore.Mac/Properties/AssemblyInfo.cs b/CrossCore/Cirrious.CrossCore.Mac/Properties/AssemblyInfo.cs index fbed660bc..c39bed538 100644 --- a/CrossCore/Cirrious.CrossCore.Mac/Properties/AssemblyInfo.cs +++ b/CrossCore/Cirrious.CrossCore.Mac/Properties/AssemblyInfo.cs @@ -3,20 +3,25 @@ using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. -[assembly: AssemblyTitle ("Cirrious.CrossCore.Mac")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("stuartlodge")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] + +[assembly: AssemblyTitle("Cirrious.CrossCore.Mac")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("stuartlodge")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.*")] + +[assembly: AssemblyVersion("1.0.*")] + // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. + //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] diff --git a/CrossCore/Cirrious.CrossCore.Mac/Views/IMvxEventSourceViewController.cs b/CrossCore/Cirrious.CrossCore.Mac/Views/IMvxEventSourceViewController.cs index 4b3d7b9fa..5931a05e3 100644 --- a/CrossCore/Cirrious.CrossCore.Mac/Views/IMvxEventSourceViewController.cs +++ b/CrossCore/Cirrious.CrossCore.Mac/Views/IMvxEventSourceViewController.cs @@ -13,9 +13,9 @@ namespace Cirrious.CrossCore.Mac.Views public interface IMvxEventSourceViewController : IMvxDisposeSource { event EventHandler ViewDidLoadCalled; - event EventHandler> ViewWillAppearCalled; - event EventHandler> ViewDidAppearCalled; - event EventHandler> ViewDidDisappearCalled; - event EventHandler> ViewWillDisappearCalled; - } +// event EventHandler> ViewWillAppearCalled; +// event EventHandler> ViewDidAppearCalled; +// event EventHandler> ViewDidDisappearCalled; +// event EventHandler> ViewWillDisappearCalled; + } } \ No newline at end of file diff --git a/CrossCore/Cirrious.CrossCore.Mac/Views/MvxBaseViewControllerAdapter.cs b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxBaseViewControllerAdapter.cs index 98e885d59..ca0985762 100644 --- a/CrossCore/Cirrious.CrossCore.Mac/Views/MvxBaseViewControllerAdapter.cs +++ b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxBaseViewControllerAdapter.cs @@ -29,10 +29,10 @@ namespace Cirrious.CrossCore.Mac.Views throw new ArgumentException("eventSource - eventSource should be a NSViewController"); _eventSource = eventSource; - _eventSource.ViewDidAppearCalled += HandleViewDidAppearCalled; - _eventSource.ViewDidDisappearCalled += HandleViewDidDisappearCalled; - _eventSource.ViewWillAppearCalled += HandleViewWillAppearCalled; - _eventSource.ViewWillDisappearCalled += HandleViewWillDisappearCalled; +// _eventSource.ViewDidAppearCalled += HandleViewDidAppearCalled; +// _eventSource.ViewDidDisappearCalled += HandleViewDidDisappearCalled; +// _eventSource.ViewWillAppearCalled += HandleViewWillAppearCalled; +// _eventSource.ViewWillDisappearCalled += HandleViewWillDisappearCalled; _eventSource.DisposeCalled += HandleDisposeCalled; _eventSource.ViewDidLoadCalled += HandleViewDidLoadCalled; } @@ -45,20 +45,20 @@ namespace Cirrious.CrossCore.Mac.Views { } - public virtual void HandleViewWillDisappearCalled(object sender, MvxValueEventArgs e) - { - } - - public virtual void HandleViewWillAppearCalled(object sender, MvxValueEventArgs e) - { - } - - public virtual void HandleViewDidDisappearCalled(object sender, MvxValueEventArgs e) - { - } - - public virtual void HandleViewDidAppearCalled(object sender, MvxValueEventArgs e) - { - } +// public virtual void HandleViewWillDisappearCalled(object sender, MvxValueEventArgs e) +// { +// } +// +// public virtual void HandleViewWillAppearCalled(object sender, MvxValueEventArgs e) +// { +// } +// +// public virtual void HandleViewDidDisappearCalled(object sender, MvxValueEventArgs e) +// { +// } +// +// public virtual void HandleViewDidAppearCalled(object sender, MvxValueEventArgs e) +// { +// } } } \ No newline at end of file diff --git a/CrossCore/Cirrious.CrossCore.Mac/Views/MvxDelegateExtensionMethods.cs b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxDelegateExtensionMethods.cs new file mode 100644 index 000000000..34ddb9eff --- /dev/null +++ b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxDelegateExtensionMethods.cs @@ -0,0 +1,32 @@ +// MvxDelegateExtensionMethods.cs +// (c) Copyright Cirrious Ltd. http://www.cirrious.com +// MvvmCross is licensed using Microsoft Public License (Ms-PL) +// Contributions and inspirations noted in readme.md and license.txt +// +// Project Lead - Stuart Lodge, @slodge, me@slodge.com + +using System; +using Cirrious.CrossCore.Core; + +namespace Cirrious.CrossCore.Mac.Views +{ +#warning Move these extension methods to the main corecross project + public static class MvxDelegateExtensionMethods + { + public static void Raise(this EventHandler eventHandler, object sender) + { + if (eventHandler == null) + return; + + eventHandler(sender, EventArgs.Empty); + } + + public static void Raise(this EventHandler> eventHandler, object sender, T value) + { + if (eventHandler == null) + return; + + eventHandler(sender, new MvxValueEventArgs(value)); + } + } +} \ No newline at end of file diff --git a/CrossCore/Cirrious.CrossCore.Mac/Views/MvxEventSourceViewController.cs b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxEventSourceViewController.cs index a64ffbef9..bfec440d4 100644 --- a/CrossCore/Cirrious.CrossCore.Mac/Views/MvxEventSourceViewController.cs +++ b/CrossCore/Cirrious.CrossCore.Mac/Views/MvxEventSourceViewController.cs @@ -11,7 +11,7 @@ using MonoMac.AppKit; using Cirrious.CrossCore.Mac.Views; using MonoMac.Foundation; -namespace Cirrious.CrossCore.Touch.Views +namespace Cirrious.CrossCore.Mac.Views { public class MvxEventSourceViewController : NSViewController @@ -19,62 +19,81 @@ namespace Cirrious.CrossCore.Touch.Views { protected MvxEventSourceViewController() { + Initialize (); } protected MvxEventSourceViewController(IntPtr handle) : base(handle) { + Initialize (); } + protected MvxEventSourceViewController(NSCoder coder) + : base(coder) + { + Initialize (); + } + protected MvxEventSourceViewController(string nibName, NSBundle bundle) : base(nibName, bundle) - { + { + Initialize (); } + + private void Initialize() + { + } - public override void ViewWillDisappear(bool animated) - { - base.ViewWillDisappear(animated); - ViewWillDisappearCalled.Raise(this, animated); - } + public override void LoadView () + { + base.LoadView (); + ViewDidLoad (); + } - public override void ViewDidAppear(bool animated) - { - base.ViewDidAppear(animated); - ViewDidDisappearCalled.Raise(this, animated); - } - public override void ViewWillAppear(bool animated) + // public override void ViewWillDisappear(bool animated) +// { +// base.ViewWillDisappear(animated); +// ViewWillDisappearCalled.Raise(this, animated); +// } +// +// public override void ViewDidAppear(bool animated) +// { +// base.ViewDidAppear(animated); +// ViewDidDisappearCalled.Raise(this, animated); +// } +// +// public override void ViewWillAppear(bool animated) +// { +// base.ViewWillAppear(animated); +// ViewWillAppearCalled.Raise(this, animated); +// } +// +// public override void ViewDidDisappear(bool animated) +// { +// base.ViewDidDisappear(animated); +// ViewDidAppearCalled.Raise(this, animated); +// } +// + public virtual void ViewDidLoad() { - base.ViewWillAppear(animated); - ViewWillAppearCalled.Raise(this, animated); - } - - public override void ViewDidDisappear(bool animated) - { - base.ViewDidDisappear(animated); - ViewDidAppearCalled.Raise(this, animated); - } - - public override void ViewDidLoad() - { - base.ViewDidLoad(); ViewDidLoadCalled.Raise(this); } - protected override void Dispose(bool disposing) + protected override void Dispose(bool disposing) { - if (disposing) - { - DisposeCalled.Raise(this); - } + if (disposing) + { + DisposeCalled.Raise (this); + } base.Dispose(disposing); } public event EventHandler ViewDidLoadCalled; - public event EventHandler> ViewWillAppearCalled; - public event EventHandler> ViewDidAppearCalled; - public event EventHandler> ViewDidDisappearCalled; - public event EventHandler> ViewWillDisappearCalled; +// public event EventHandler> ViewWillAppearCalled; +// public event EventHandler> ViewDidAppearCalled; +// public event EventHandler> ViewDidDisappearCalled; +// public event EventHandler> ViewWillDisappearCalled; public event EventHandler DisposeCalled; } } \ No newline at end of file diff --git a/CrossUI/CrossUI.Core/CrossUI.Core.csproj b/CrossUI/CrossUI.Core/CrossUI.Core.csproj index dbacd43da..fc5bf07c6 100644 --- a/CrossUI/CrossUI.Core/CrossUI.Core.csproj +++ b/CrossUI/CrossUI.Core/CrossUI.Core.csproj @@ -9,8 +9,8 @@ CrossUI.Core CrossUI.Core v4.0 - Profile104 -512 + Profile104 + 512 {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0.0 2.0 diff --git a/Samples/FirstDemo.Core/App.cs b/Samples/FirstDemo.Core/App.cs new file mode 100644 index 000000000..8de8bae77 --- /dev/null +++ b/Samples/FirstDemo.Core/App.cs @@ -0,0 +1,17 @@ +using Cirrious.CrossCore.IoC; +using FirstDemo.Core.ViewModels; + +namespace FirstDemo.Core +{ + public class App : Cirrious.MvvmCross.ViewModels.MvxApplication + { + public override void Initialize () + { + CreatableTypes () + .EndingWith ("Service") + .AsInterfaces () + .RegisterAsLazySingleton (); + RegisterAppStart (); + } + } +} \ No newline at end of file diff --git a/Samples/FirstDemo.Core/FirstDemo.Core.csproj b/Samples/FirstDemo.Core/FirstDemo.Core.csproj new file mode 100644 index 000000000..a71d57ef0 --- /dev/null +++ b/Samples/FirstDemo.Core/FirstDemo.Core.csproj @@ -0,0 +1,62 @@ + + + + Debug + AnyCPU + 12.0.0 + 2.0 + {E9CAC9B6-5013-4350-B617-77C979166230} + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + FirstDemo.Core + FirstDemo.Core + Profile104 + v4.0 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + full + true + bin\Release + prompt + 4 + false + + + + + + + + + + + + + + + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} + Cirrious.CrossCore + + + {B6E27475-E7D0-448C-A5CC-5097DCA1E2DD} + Cirrious.MvvmCross + + + {D9CBBFFE-57E8-4E97-9E16-C34BC4C52827} + CrossUI.Core + + + + + + \ No newline at end of file diff --git a/Samples/FirstDemo.Core/Properties/AssemblyInfo.cs b/Samples/FirstDemo.Core/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..08beb5e3e --- /dev/null +++ b/Samples/FirstDemo.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,22 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. +[assembly: AssemblyTitle ("FirstDemo.Core")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("Loqu8, Inc.")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("Copyright (c) 2012 Loqu8, Inc. All rights reserved worldwide.")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. +[assembly: AssemblyVersion ("1.0.*")] +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/Samples/FirstDemo.Core/ViewModels/FirstViewModel.cs b/Samples/FirstDemo.Core/ViewModels/FirstViewModel.cs new file mode 100644 index 000000000..f40fb84db --- /dev/null +++ b/Samples/FirstDemo.Core/ViewModels/FirstViewModel.cs @@ -0,0 +1,36 @@ +using Cirrious.MvvmCross.ViewModels; + +namespace FirstDemo.Core.ViewModels +{ + public class FirstViewModel : MvxViewModel + { + public FirstViewModel() + { + } + + private string _firstName = string.Empty; + public string FirstName + { + get { return _firstName; } + set { _firstName = value; + RaisePropertyChanged (() => FirstName); + RaisePropertyChanged (() => FullName); + } + } + + private string _lastName = string.Empty; + public string LastName + { + get { return _lastName; } + set { _lastName = value; + RaisePropertyChanged (() => LastName); + RaisePropertyChanged (() => FullName); + } + } + + public string FullName + { + get { return string.Format ("{0} {1}", _firstName, _lastName); } + } + } +} \ No newline at end of file diff --git a/Samples/FirstDemo.Mac/AppDelegate.cs b/Samples/FirstDemo.Mac/AppDelegate.cs new file mode 100644 index 000000000..f90b2bddc --- /dev/null +++ b/Samples/FirstDemo.Mac/AppDelegate.cs @@ -0,0 +1,37 @@ +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.CrossCore; +using Cirrious.MvvmCross.Mac.Platform; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using Cirrious.MvvmCross.ViewModels; +using System.Drawing; + +namespace FirstDemo.Mac +{ + public partial class AppDelegate : MvxApplicationDelegate + { + NSWindow _window; + + public AppDelegate() + { + } + + public override void FinishedLaunching (NSObject notification) + { + _window = new NSWindow (new RectangleF(200,200,400,400), NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled, + NSBackingStore.Buffered, false, NSScreen.MainScreen); + + var presenter = new MvxMacViewPresenter (this, _window); + var setup = new Setup (this, presenter); + setup.Initialize (); + + var startup = Mvx.Resolve (); + startup.Start (); + + _window.MakeKeyAndOrderFront (this); + + return; + } + } +} + diff --git a/Samples/FirstDemo.Mac/AppDelegate.designer.cs b/Samples/FirstDemo.Mac/AppDelegate.designer.cs new file mode 100644 index 000000000..252f29764 --- /dev/null +++ b/Samples/FirstDemo.Mac/AppDelegate.designer.cs @@ -0,0 +1,10 @@ + +namespace FirstDemo.Mac +{ + // Should subclass MonoMac.AppKit.NSResponder + [MonoMac.Foundation.Register("AppDelegate")] + public partial class AppDelegate + { + } +} + diff --git a/Samples/FirstDemo.Mac/FirstDemo.Mac.csproj b/Samples/FirstDemo.Mac/FirstDemo.Mac.csproj new file mode 100644 index 000000000..359821f7c --- /dev/null +++ b/Samples/FirstDemo.Mac/FirstDemo.Mac.csproj @@ -0,0 +1,139 @@ + + + + Debug + AnyCPU + 12.0.0 + 2.0 + {29B25E31-353C-4715-A58A-7402267A7705} + {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Exe + FirstDemo.Mac + Resources + FirstDemo.Mac + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + false + false + Mac Developer + false + false + + + full + true + bin\Release + prompt + 4 + false + Full + false + true + false + Developer ID Application + true + true + + + full + true + bin\AppStore + prompt + 4 + false + Full + false + true + 3rd Party Mac Developer Installer + true + 3rd Party Mac Developer Application + true + true + + + + + + + + + + + + + + + + + + MainWindow.cs + + + + + AppDelegate.cs + + + + + + FirstView.cs + + + + + + + + + + + + + + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} + Cirrious.CrossCore + + + {596C75FB-F491-4037-89F6-B4F34183D83D} + Cirrious.CrossCore.Mac + + + {B6E27475-E7D0-448C-A5CC-5097DCA1E2DD} + Cirrious.MvvmCross + + + {64DCD397-9019-41E8-A928-E5F5C5DF185B} + Cirrious.MvvmCross.Binding + + + {B4789586-AEBB-4597-A849-23F3E45AF421} + Cirrious.MvvmCross.Binding.Mac + + + {D89351C1-D48F-4AD0-A0B9-353A93425AB7} + Cirrious.MvvmCross.Localization + + + {B3B40D12-3CF1-4BCE-B599-4E3AE438D39F} + Cirrious.MvvmCross.Mac + + + {D9CBBFFE-57E8-4E97-9E16-C34BC4C52827} + CrossUI.Core + + + {E9CAC9B6-5013-4350-B617-77C979166230} + FirstDemo.Core + + + \ No newline at end of file diff --git a/Samples/FirstDemo.Mac/Info.plist b/Samples/FirstDemo.Mac/Info.plist new file mode 100644 index 000000000..5d9aa0ec2 --- /dev/null +++ b/Samples/FirstDemo.Mac/Info.plist @@ -0,0 +1,18 @@ + + + + + CFBundleName + FirstDemo.Mac + CFBundleVersion + 1 + LSMinimumSystemVersion + 10.6 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + CFBundleIdentifier + FirstDemo + + diff --git a/Samples/FirstDemo.Mac/Main.cs b/Samples/FirstDemo.Mac/Main.cs new file mode 100644 index 000000000..350795112 --- /dev/null +++ b/Samples/FirstDemo.Mac/Main.cs @@ -0,0 +1,18 @@ +using System; +using System.Drawing; +using MonoMac.Foundation; +using MonoMac.AppKit; +using MonoMac.ObjCRuntime; + +namespace FirstDemo.Mac +{ + class MainClass + { + static void Main (string[] args) + { + NSApplication.Init (); + NSApplication.Main (args); + } + } +} + diff --git a/Samples/FirstDemo.Mac/MainMenu.xib b/Samples/FirstDemo.Mac/MainMenu.xib new file mode 100644 index 000000000..96e10e56b --- /dev/null +++ b/Samples/FirstDemo.Mac/MainMenu.xib @@ -0,0 +1,4074 @@ + + + + 1060 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + FirstDemo.Mac + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + MacCocoaApp + + YES + + + About FirstDemo.Mac + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide FirstDemo.Mac + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit FirstDemo.Mac + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + Save As… + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + YES + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Writing Direction + + 2147483647 + + + submenuAction: + + Writing Direction + + YES + + + YES + Paragraph + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + YES + Selection + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + FirstDemo.Mac Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + NSFontManager + + + AppDelegate + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + terminate: + + + + 449 + + + + toggleAutomaticSpellingCorrection: + + + + 456 + + + + orderFrontSubstitutionsPanel: + + + + 458 + + + + toggleAutomaticDashSubstitution: + + + + 461 + + + + toggleAutomaticTextReplacement: + + + + 463 + + + + uppercaseWord: + + + + 464 + + + + capitalizeWord: + + + + 467 + + + + lowercaseWord: + + + + 468 + + + + pasteAsPlainText: + + + + 486 + + + + performFindPanelAction: + + + + 487 + + + + performFindPanelAction: + + + + 488 + + + + performFindPanelAction: + + + + 489 + + + + showHelp: + + + + 493 + + + + alignCenter: + + + + 518 + + + + pasteRuler: + + + + 519 + + + + toggleRuler: + + + + 520 + + + + alignRight: + + + + 521 + + + + copyRuler: + + + + 522 + + + + alignJustified: + + + + 523 + + + + alignLeft: + + + + 524 + + + + makeBaseWritingDirectionNatural: + + + + 525 + + + + makeBaseWritingDirectionLeftToRight: + + + + 526 + + + + makeBaseWritingDirectionRightToLeft: + + + + 527 + + + + makeTextWritingDirectionNatural: + + + + 528 + + + + makeTextWritingDirectionLeftToRight: + + + + 529 + + + + makeTextWritingDirectionRightToLeft: + + + + 530 + + + + delegate + + + + 534 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + + + 80 + + + + + 78 + + + + + 72 + + + + + 82 + + + + + 124 + + + YES + + + + + + 77 + + + + + 73 + + + + + 79 + + + + + 112 + + + + + 74 + + + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + 377 + + + YES + + + + + + 388 + + + YES + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + YES + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + YES + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + YES + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + YES + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + 450 + + + YES + + + + + + 451 + + + YES + + + + + + + + 452 + + + + + 453 + + + + + 454 + + + + + 457 + + + + + 459 + + + + + 460 + + + + + 462 + + + + + 465 + + + + + 466 + + + + + 485 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 496 + + + YES + + + + + + 497 + + + YES + + + + + + + + + + + + + + + 498 + + + + + 499 + + + + + 500 + + + + + 501 + + + + + 502 + + + + + 503 + + + YES + + + + + + 504 + + + + + 505 + + + + + 506 + + + + + 507 + + + + + 508 + + + YES + + + + + + + + + + + + + + 509 + + + + + 510 + + + + + 511 + + + + + 512 + + + + + 513 + + + + + 514 + + + + + 515 + + + + + 516 + + + + + 517 + + + + + 533 + + + + + + + YES + + YES + -3.IBPluginDependency + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBEditorWindowLastContentRect + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBEditorWindowLastContentRect + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBEditorWindowLastContentRect + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBEditorWindowLastContentRect + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBEditorWindowLastContentRect + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 375.IBPluginDependency + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 377.IBPluginDependency + 388.IBEditorWindowLastContentRect + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency + 450.IBPluginDependency + 451.IBEditorWindowLastContentRect + 451.IBPluginDependency + 452.IBPluginDependency + 453.IBPluginDependency + 454.IBPluginDependency + 457.IBPluginDependency + 459.IBPluginDependency + 460.IBPluginDependency + 462.IBPluginDependency + 465.IBPluginDependency + 466.IBPluginDependency + 485.IBPluginDependency + 490.IBPluginDependency + 491.IBEditorWindowLastContentRect + 491.IBPluginDependency + 492.IBPluginDependency + 496.IBPluginDependency + 497.IBEditorWindowLastContentRect + 497.IBPluginDependency + 498.IBPluginDependency + 499.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 500.IBPluginDependency + 501.IBPluginDependency + 502.IBPluginDependency + 503.IBPluginDependency + 504.IBPluginDependency + 505.IBPluginDependency + 506.IBPluginDependency + 507.IBPluginDependency + 508.IBEditorWindowLastContentRect + 508.IBPluginDependency + 509.IBPluginDependency + 510.IBPluginDependency + 511.IBPluginDependency + 512.IBPluginDependency + 513.IBPluginDependency + 514.IBPluginDependency + 515.IBPluginDependency + 516.IBPluginDependency + 517.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{753, 187}, {275, 113}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{453, 408}, {254, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{187, 434}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{753, 217}, {238, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{613, 618}, {194, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{346, 722}, {402, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + {{563, 648}, {231, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{746, 287}, {220, 133}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {{497, 648}, {83, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{580, 408}, {175, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{753, 197}, {170, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{684, 668}, {142, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{674, 260}, {204, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{878, 180}, {164, 173}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{355, 508}, {183, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{411, 488}, {196, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 474}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 534 + + + + YES + + AppDelegate + NSResponder + + IBUserSource + + + + + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFontManager + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../MacCocoaApp.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Samples/FirstDemo.Mac/MainWindow.cs b/Samples/FirstDemo.Mac/MainWindow.cs new file mode 100644 index 000000000..9ead6dd3c --- /dev/null +++ b/Samples/FirstDemo.Mac/MainWindow.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace FirstDemo.Mac +{ + public partial class MainWindow : MonoMac.AppKit.NSWindow + { + #region Constructors + // Called when created from unmanaged code + public MainWindow (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public MainWindow (NSCoder coder) : base (coder) + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + } +} + diff --git a/Samples/FirstDemo.Mac/MainWindow.designer.cs b/Samples/FirstDemo.Mac/MainWindow.designer.cs new file mode 100644 index 000000000..d0e6470e9 --- /dev/null +++ b/Samples/FirstDemo.Mac/MainWindow.designer.cs @@ -0,0 +1,15 @@ + +namespace FirstDemo.Mac +{ + // Should subclass MonoMac.AppKit.NSWindow + [MonoMac.Foundation.Register("MainWindow")] + public partial class MainWindow + { + } + // Should subclass MonoMac.AppKit.NSWindowController + [MonoMac.Foundation.Register("MainWindowController")] + public partial class MainWindowController + { + } +} + diff --git a/Samples/FirstDemo.Mac/MainWindow.xib b/Samples/FirstDemo.Mac/MainWindow.xib new file mode 100644 index 000000000..060535b66 --- /dev/null +++ b/Samples/FirstDemo.Mac/MainWindow.xib @@ -0,0 +1,189 @@ + + + + 1060 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + MainWindowController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{131, 74}, {606, 354}} + 611844096 + Window + MainWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + {606, 354} + + + {{0, 0}, {1280, 778}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 6 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 2 + + + YES + + + + + + 3 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 2.IBWindowTemplateEditedContentRect + 2.NSWindowTemplate.visibleAtLaunch + 3.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{319, 371}, {606, 354}} + com.apple.InterfaceBuilder.CocoaPlugin + {{319, 371}, {606, 354}} + + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 6 + + + + YES + + MainWindow + NSWindow + + IBUserSource + + + + + MainWindowController + NSWindowController + + IBUserSource + + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Samples/FirstDemo.Mac/MainWindowController.cs b/Samples/FirstDemo.Mac/MainWindowController.cs new file mode 100644 index 000000000..169eee3c3 --- /dev/null +++ b/Samples/FirstDemo.Mac/MainWindowController.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace FirstDemo.Mac +{ + public partial class MainWindowController : MonoMac.AppKit.NSWindowController + { + #region Constructors + // Called when created from unmanaged code + public MainWindowController (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public MainWindowController (NSCoder coder) : base (coder) + { + Initialize (); + } + // Call to load from the XIB/NIB file + public MainWindowController () : base ("MainWindow") + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + //strongly typed window accessor + public new MainWindow Window { + get { + return (MainWindow)base.Window; + } + } + } +} + diff --git a/Samples/FirstDemo.Mac/Setup.cs b/Samples/FirstDemo.Mac/Setup.cs new file mode 100644 index 000000000..7440f927b --- /dev/null +++ b/Samples/FirstDemo.Mac/Setup.cs @@ -0,0 +1,23 @@ +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Mac.Platform; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using Cirrious.MvvmCross.ViewModels; + +namespace FirstDemo.Mac +{ + public class Setup : MvxMacSetup + { + public Setup (MvxApplicationDelegate applicationDelegate, IMvxMacViewPresenter presenter) + : base(applicationDelegate, presenter) + { + + } + + protected override IMvxApplication CreateApp () + { + return new FirstDemo.Core.App (); + } + } +} + diff --git a/Samples/FirstDemo.Mac/Views/FirstView.cs b/Samples/FirstDemo.Mac/Views/FirstView.cs new file mode 100644 index 000000000..5a5c2db32 --- /dev/null +++ b/Samples/FirstDemo.Mac/Views/FirstView.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Binding.Mac.Views; + +namespace FirstDemo.Mac +{ + public partial class FirstView : MvxView + { + #region Constructors + // Called when created from unmanaged code + public FirstView (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public FirstView (NSCoder coder) : base (coder) + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + } +} + diff --git a/Samples/FirstDemo.Mac/Views/FirstView.designer.cs b/Samples/FirstDemo.Mac/Views/FirstView.designer.cs new file mode 100644 index 000000000..ea2c3e31d --- /dev/null +++ b/Samples/FirstDemo.Mac/Views/FirstView.designer.cs @@ -0,0 +1,15 @@ + +namespace FirstDemo.Mac +{ + // Should subclass MonoMac.AppKit.NSView + [MonoMac.Foundation.Register("FirstView")] + public partial class FirstView + { + } + // Should subclass MonoMac.AppKit.NSViewController + [MonoMac.Foundation.Register("FirstViewController")] + public partial class FirstViewController + { + } +} + diff --git a/Samples/FirstDemo.Mac/Views/FirstView.xib b/Samples/FirstDemo.Mac/Views/FirstView.xib new file mode 100644 index 000000000..2d0048ae5 --- /dev/null +++ b/Samples/FirstDemo.Mac/Views/FirstView.xib @@ -0,0 +1,166 @@ + + + + 1060 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + FirstViewController + + + FirstResponder + + + NSApplication + + + + 268 + {470, 296} + + FirstView + + + + + YES + + + view + + + + 17 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 4 + + + YES + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 4.IBEditorWindowLastContentRect + 4.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{380, 424}, {470, 296}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 17 + + + + YES + + FirstView + NSView + + IBUserSource + + + + + FirstViewController + NSViewController + + IBUserSource + + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Samples/FirstDemo.Mac/Views/FirstViewController.cs b/Samples/FirstDemo.Mac/Views/FirstViewController.cs new file mode 100644 index 000000000..8600fe08a --- /dev/null +++ b/Samples/FirstDemo.Mac/Views/FirstViewController.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Mac.Views; +using Cirrious.MvvmCross.Binding.BindingContext; +using FirstDemo.Core.ViewModels; + +namespace FirstDemo.Mac +{ + public partial class FirstViewController : MvxViewController + { + #region Constructors + // Called when created from unmanaged code + public FirstViewController (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public FirstViewController (NSCoder coder) : base (coder) + { + Initialize (); + } + // Call to load from the XIB/NIB file + public FirstViewController () : base ("FirstView", NSBundle.MainBundle) + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + //strongly typed view accessor + public new FirstView View { + get { + return (FirstView)base.View; + } + } + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + + var textEditFirst = new NSTextField(new System.Drawing.RectangleF(0,0,320,40)); + View.AddSubview (textEditFirst); + var textEditSecond = new NSTextField(new System.Drawing.RectangleF(0,50,320,40)); + View.AddSubview(textEditSecond); + var labelFull = new NSTextField(new System.Drawing.RectangleF(0,100,320,40)); + View.AddSubview (labelFull); + + var set = this.CreateBindingSet (); + set.Bind (textEditFirst).For(v => v.StringValue).To (vm => vm.FirstName); + set.Bind (textEditSecond).For(v => v.StringValue).To (vm => vm.LastName); + set.Bind (labelFull).For(v => v.StringValue).To (vm => vm.FullName); + set.Apply (); + } + } +} + diff --git a/Samples/FirstDemo2.Mac/AppDelegate.cs b/Samples/FirstDemo2.Mac/AppDelegate.cs new file mode 100644 index 000000000..22d25b47b --- /dev/null +++ b/Samples/FirstDemo2.Mac/AppDelegate.cs @@ -0,0 +1,37 @@ +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.CrossCore; +using Cirrious.MvvmCross.Mac.Platform; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using Cirrious.MvvmCross.ViewModels; +using System.Drawing; + +namespace FirstDemo2.Mac +{ + public partial class AppDelegate : MvxApplicationDelegate + { + NSWindow _window; + + public AppDelegate() + { + } + + public override void FinishedLaunching (NSObject notification) + { + _window = new NSWindow (new RectangleF(200,200,400,400), NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled, + NSBackingStore.Buffered, false, NSScreen.MainScreen); + + var presenter = new MvxMacViewPresenter (this, _window); + var setup = new Setup (this, presenter); + setup.Initialize (); + + var startup = Mvx.Resolve (); + startup.Start (); + + _window.MakeKeyAndOrderFront (this); + + return; + } + } +} + diff --git a/Samples/FirstDemo2.Mac/AppDelegate.designer.cs b/Samples/FirstDemo2.Mac/AppDelegate.designer.cs new file mode 100644 index 000000000..cbfec7131 --- /dev/null +++ b/Samples/FirstDemo2.Mac/AppDelegate.designer.cs @@ -0,0 +1,10 @@ + +namespace FirstDemo2.Mac +{ + // Should subclass MonoMac.AppKit.NSResponder + [MonoMac.Foundation.Register("AppDelegate")] + public partial class AppDelegate + { + } +} + diff --git a/Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-all-target-headers.hmap b/Samples/FirstDemo2.Mac/Build/Intermediates/FirstDemo2.Mac.build/MonoMac/FirstDemo2.Mac.build/FirstDemo2.Mac-all-target-headers.hmap new file mode 100644 index 0000000000000000000000000000000000000000..5d74c43a95f00b611e8c37c40fb62cc2fe185bed GIT binary patch literal 793 ecmXR&%*|kAU|^771`8LQqW%-fTF_tvY-DN6Tz>`oC%w51k;+}jK vti~~H6N_N&LL5kN*Coj%1zr@D^T@XzFP0Q+*OpKxNtL0gKgnSW|zY&YHiZqmMa-Xg + + + Debug + AnyCPU + 12.0.0 + 2.0 + {17E01863-3054-4933-887B-3F1EB04A4EAC} + {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Exe + FirstDemo2.Mac + Resources + FirstDemo2.Mac + True + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + false + false + Mac Developer + false + false + + + full + true + bin\Release + prompt + 4 + false + Full + false + true + false + Developer ID Application + true + true + + + full + true + bin\AppStore + prompt + 4 + false + Full + false + true + 3rd Party Mac Developer Installer + true + 3rd Party Mac Developer Application + true + true + + + + + + + + + + + + + + + + + + AppDelegate.cs + + + + FirstView.cs + + + + + + + + + + + + + + + + + + + + + + {CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB} + Cirrious.CrossCore + + + {B3B40D12-3CF1-4BCE-B599-4E3AE438D39F} + Cirrious.MvvmCross.Mac + + + {B6E27475-E7D0-448C-A5CC-5097DCA1E2DD} + Cirrious.MvvmCross + + + {596C75FB-F491-4037-89F6-B4F34183D83D} + Cirrious.CrossCore.Mac + + + {64DCD397-9019-41E8-A928-E5F5C5DF185B} + Cirrious.MvvmCross.Binding + + + {B4789586-AEBB-4597-A849-23F3E45AF421} + Cirrious.MvvmCross.Binding.Mac + + + {D89351C1-D48F-4AD0-A0B9-353A93425AB7} + Cirrious.MvvmCross.Localization + + + {E9CAC9B6-5013-4350-B617-77C979166230} + FirstDemo.Core + + + \ No newline at end of file diff --git a/Samples/FirstDemo2.Mac/Info.plist b/Samples/FirstDemo2.Mac/Info.plist new file mode 100644 index 000000000..2edecddcd --- /dev/null +++ b/Samples/FirstDemo2.Mac/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleName + FirstDemo2.Mac + CFBundleVersion + 1 + LSMinimumSystemVersion + 10.6 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + CFBundleIdentifier + FirstDemo2 + LSApplicationCategoryType + public.app-category.business + + diff --git a/Samples/FirstDemo2.Mac/Main.cs b/Samples/FirstDemo2.Mac/Main.cs new file mode 100644 index 000000000..d86e0e390 --- /dev/null +++ b/Samples/FirstDemo2.Mac/Main.cs @@ -0,0 +1,18 @@ +using System; +using System.Drawing; +using MonoMac.Foundation; +using MonoMac.AppKit; +using MonoMac.ObjCRuntime; + +namespace FirstDemo2.Mac +{ + class MainClass + { + static void Main (string[] args) + { + NSApplication.Init (); + NSApplication.Main (args); + } + } +} + diff --git a/Samples/FirstDemo2.Mac/MainMenu.xib b/Samples/FirstDemo2.Mac/MainMenu.xib new file mode 100644 index 000000000..e1360a788 --- /dev/null +++ b/Samples/FirstDemo2.Mac/MainMenu.xib @@ -0,0 +1,4074 @@ + + + + 1060 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + FirstDemo2.Mac + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + MacCocoaApp + + YES + + + About FirstDemo2.Mac + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide FirstDemo2.Mac + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit FirstDemo2.Mac + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + Save As… + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + YES + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Writing Direction + + 2147483647 + + + submenuAction: + + Writing Direction + + YES + + + YES + Paragraph + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + YES + Selection + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + FirstDemo2.Mac Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + NSFontManager + + + AppDelegate + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + terminate: + + + + 449 + + + + toggleAutomaticSpellingCorrection: + + + + 456 + + + + orderFrontSubstitutionsPanel: + + + + 458 + + + + toggleAutomaticDashSubstitution: + + + + 461 + + + + toggleAutomaticTextReplacement: + + + + 463 + + + + uppercaseWord: + + + + 464 + + + + capitalizeWord: + + + + 467 + + + + lowercaseWord: + + + + 468 + + + + pasteAsPlainText: + + + + 486 + + + + performFindPanelAction: + + + + 487 + + + + performFindPanelAction: + + + + 488 + + + + performFindPanelAction: + + + + 489 + + + + showHelp: + + + + 493 + + + + alignCenter: + + + + 518 + + + + pasteRuler: + + + + 519 + + + + toggleRuler: + + + + 520 + + + + alignRight: + + + + 521 + + + + copyRuler: + + + + 522 + + + + alignJustified: + + + + 523 + + + + alignLeft: + + + + 524 + + + + makeBaseWritingDirectionNatural: + + + + 525 + + + + makeBaseWritingDirectionLeftToRight: + + + + 526 + + + + makeBaseWritingDirectionRightToLeft: + + + + 527 + + + + makeTextWritingDirectionNatural: + + + + 528 + + + + makeTextWritingDirectionLeftToRight: + + + + 529 + + + + makeTextWritingDirectionRightToLeft: + + + + 530 + + + + delegate + + + + 534 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + + + 80 + + + + + 78 + + + + + 72 + + + + + 82 + + + + + 124 + + + YES + + + + + + 77 + + + + + 73 + + + + + 79 + + + + + 112 + + + + + 74 + + + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + 377 + + + YES + + + + + + 388 + + + YES + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + YES + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + YES + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + YES + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + YES + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + 450 + + + YES + + + + + + 451 + + + YES + + + + + + + + 452 + + + + + 453 + + + + + 454 + + + + + 457 + + + + + 459 + + + + + 460 + + + + + 462 + + + + + 465 + + + + + 466 + + + + + 485 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 496 + + + YES + + + + + + 497 + + + YES + + + + + + + + + + + + + + + 498 + + + + + 499 + + + + + 500 + + + + + 501 + + + + + 502 + + + + + 503 + + + YES + + + + + + 504 + + + + + 505 + + + + + 506 + + + + + 507 + + + + + 508 + + + YES + + + + + + + + + + + + + + 509 + + + + + 510 + + + + + 511 + + + + + 512 + + + + + 513 + + + + + 514 + + + + + 515 + + + + + 516 + + + + + 517 + + + + + 533 + + + + + + + YES + + YES + -3.IBPluginDependency + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBEditorWindowLastContentRect + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBEditorWindowLastContentRect + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBEditorWindowLastContentRect + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBEditorWindowLastContentRect + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBEditorWindowLastContentRect + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 375.IBPluginDependency + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 377.IBPluginDependency + 388.IBEditorWindowLastContentRect + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency + 450.IBPluginDependency + 451.IBEditorWindowLastContentRect + 451.IBPluginDependency + 452.IBPluginDependency + 453.IBPluginDependency + 454.IBPluginDependency + 457.IBPluginDependency + 459.IBPluginDependency + 460.IBPluginDependency + 462.IBPluginDependency + 465.IBPluginDependency + 466.IBPluginDependency + 485.IBPluginDependency + 490.IBPluginDependency + 491.IBEditorWindowLastContentRect + 491.IBPluginDependency + 492.IBPluginDependency + 496.IBPluginDependency + 497.IBEditorWindowLastContentRect + 497.IBPluginDependency + 498.IBPluginDependency + 499.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 500.IBPluginDependency + 501.IBPluginDependency + 502.IBPluginDependency + 503.IBPluginDependency + 504.IBPluginDependency + 505.IBPluginDependency + 506.IBPluginDependency + 507.IBPluginDependency + 508.IBEditorWindowLastContentRect + 508.IBPluginDependency + 509.IBPluginDependency + 510.IBPluginDependency + 511.IBPluginDependency + 512.IBPluginDependency + 513.IBPluginDependency + 514.IBPluginDependency + 515.IBPluginDependency + 516.IBPluginDependency + 517.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{753, 187}, {275, 113}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{453, 408}, {254, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{187, 434}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{753, 217}, {238, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{613, 618}, {194, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{346, 722}, {402, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + {{563, 648}, {231, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{746, 287}, {220, 133}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {{497, 648}, {83, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{580, 408}, {175, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{753, 197}, {170, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{684, 668}, {142, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{674, 260}, {204, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{878, 180}, {164, 173}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{355, 508}, {183, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{411, 488}, {196, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 474}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 534 + + + + YES + + AppDelegate + NSResponder + + IBUserSource + + + + + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFontManager + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../MacCocoaApp.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Samples/FirstDemo2.Mac/Setup.cs b/Samples/FirstDemo2.Mac/Setup.cs new file mode 100644 index 000000000..511a308e6 --- /dev/null +++ b/Samples/FirstDemo2.Mac/Setup.cs @@ -0,0 +1,23 @@ +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Mac.Platform; +using Cirrious.MvvmCross.Mac.Views.Presenters; +using Cirrious.MvvmCross.ViewModels; + +namespace FirstDemo2.Mac +{ + public class Setup : MvxMacSetup + { + public Setup (MvxApplicationDelegate applicationDelegate, IMvxMacViewPresenter presenter) + : base(applicationDelegate, presenter) + { + + } + + protected override IMvxApplication CreateApp () + { + return new FirstDemo.Core.App (); + } + } +} + diff --git a/Samples/FirstDemo2.Mac/Views/FirstView.cs b/Samples/FirstDemo2.Mac/Views/FirstView.cs new file mode 100644 index 000000000..dbb31ea6c --- /dev/null +++ b/Samples/FirstDemo2.Mac/Views/FirstView.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Binding.Mac.Views; + +namespace FirstDemo2.Mac +{ + public partial class FirstView : MvxView + { + #region Constructors + // Called when created from unmanaged code + public FirstView (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public FirstView (NSCoder coder) : base (coder) + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + } +} + diff --git a/Samples/FirstDemo2.Mac/Views/FirstView.designer.cs b/Samples/FirstDemo2.Mac/Views/FirstView.designer.cs new file mode 100644 index 000000000..3f34ae83f --- /dev/null +++ b/Samples/FirstDemo2.Mac/Views/FirstView.designer.cs @@ -0,0 +1,15 @@ + +namespace FirstDemo2.Mac +{ + // Should subclass MonoMac.AppKit.NSView + [MonoMac.Foundation.Register("FirstView")] + public partial class FirstView + { + } + // Should subclass MonoMac.AppKit.NSViewController + [MonoMac.Foundation.Register("FirstViewController")] + public partial class FirstViewController + { + } +} + diff --git a/Samples/FirstDemo2.Mac/Views/FirstView.xib b/Samples/FirstDemo2.Mac/Views/FirstView.xib new file mode 100644 index 000000000..2d0048ae5 --- /dev/null +++ b/Samples/FirstDemo2.Mac/Views/FirstView.xib @@ -0,0 +1,166 @@ + + + + 1060 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + FirstViewController + + + FirstResponder + + + NSApplication + + + + 268 + {470, 296} + + FirstView + + + + + YES + + + view + + + + 17 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 4 + + + YES + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 4.IBEditorWindowLastContentRect + 4.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{380, 424}, {470, 296}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 17 + + + + YES + + FirstView + NSView + + IBUserSource + + + + + FirstViewController + NSViewController + + IBUserSource + + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Samples/FirstDemo2.Mac/Views/FirstViewController.cs b/Samples/FirstDemo2.Mac/Views/FirstViewController.cs new file mode 100644 index 000000000..c03387988 --- /dev/null +++ b/Samples/FirstDemo2.Mac/Views/FirstViewController.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; +using Cirrious.MvvmCross.Mac.Views; +using Cirrious.MvvmCross.Binding.BindingContext; +using FirstDemo.Core.ViewModels; + +namespace FirstDemo2.Mac +{ + public partial class FirstViewController : MvxViewController + { + #region Constructors + // Called when created from unmanaged code + public FirstViewController (IntPtr handle) : base (handle) + { + Initialize (); + } + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public FirstViewController (NSCoder coder) : base (coder) + { + Initialize (); + } + // Call to load from the XIB/NIB file + public FirstViewController () : base ("FirstView", NSBundle.MainBundle) + { + Initialize (); + } + // Shared initialization code + void Initialize () + { + } + #endregion + //strongly typed view accessor + public new FirstView View { + get { + return (FirstView)base.View; + } + } + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + + var textEditFirst = new NSTextField(new System.Drawing.RectangleF(0,0,320,40)); + View.AddSubview (textEditFirst); + var textEditSecond = new NSTextField(new System.Drawing.RectangleF(0,50,320,40)); + View.AddSubview(textEditSecond); + var labelFull = new NSTextField(new System.Drawing.RectangleF(0,100,320,40)); + View.AddSubview (labelFull); + + var set = this.CreateBindingSet (); + set.Bind (textEditFirst).For(v => v.StringValue).To (vm => vm.FirstName); + set.Bind (textEditSecond).For(v => v.StringValue).To (vm => vm.LastName); + set.Bind (labelFull).For(v => v.StringValue).To (vm => vm.FullName); + set.Apply (); + } + } +} +