diff --git a/Mac/AppDelegate.cs b/Mac/AppDelegate.cs index bf5b294..643074c 100644 --- a/Mac/AppDelegate.cs +++ b/Mac/AppDelegate.cs @@ -18,12 +18,148 @@ namespace NBTExplorer { mainWindowController = new MainWindowController (); mainWindowController.Window.MakeKeyAndOrderFront (this); + mainWindowController.Window.AppDelegate = this; + } + + public NSMenuItem MenuAbout + { + get { return _menuAbout; } + } + + public NSMenuItem MenuQuit + { + get { return _menuQuit; } + } + + public NSMenuItem MenuOpen + { + get { return _menuOpen; } + } + + public NSMenuItem MenuOpenFolder + { + get { return _menuOpenFolder; } + } + + public NSMenuItem MenuOpenMinecraft + { + get { return _menuOpenMinecraft; } + } + + public NSMenuItem MenuSave + { + get { return _menuSave; } + } + + public NSMenuItem MenuCut + { + get { return _menuCut; } + } + + public NSMenuItem MenuCopy + { + get { return _menuCopy; } + } + + public NSMenuItem MenuPaste + { + get { return _menuPaste; } + } + + public NSMenuItem MenuRename + { + get { return _menuRename; } + } + + public NSMenuItem MenuEditValue + { + get { return _menuEditValue; } + } + + public NSMenuItem MenuDelete + { + get { return _menuDelete; } + } + + public NSMenuItem MenuFind + { + get { return _menuFind; } + } + + public NSMenuItem MenuFindNext + { + get { return _menuFindNext; } + } + + public NSMenuItem MenuInsertByte + { + get { return _menuInsertByte; } + } + + public NSMenuItem MenuInsertShort + { + get { return _menuInsertShort; } + } + + public NSMenuItem MenuInsertInt + { + get { return _menuInsertInt; } + } + + public NSMenuItem MenuInsertLong + { + get { return _menuInsertLong; } + } + + public NSMenuItem MenuInsertFloat + { + get { return _menuInsertFloat; } + } + + public NSMenuItem MenuInsertDouble + { + get { return _menuInsertDouble; } + } + + public NSMenuItem MenuInsertByteArray + { + get { return _menuInsertByteArray; } + } + + public NSMenuItem MenuInsertIntArray + { + get { return _menuInsertIntArray; } + } + + public NSMenuItem MenuInsertString + { + get { return _menuInsertString; } + } + + public NSMenuItem MenuInsertList + { + get { return _menuInsertList; } + } + + public NSMenuItem MenuInsertCompound + { + get { return _menuInsertCompound; } } partial void ActionRename (NSObject sender) + { + mainWindowController.Window.ActionRenameValue(); + } + + partial void ActionEditValue (NSObject sender) { mainWindowController.Window.ActionEditValue(); } + + partial void ActionDelete (NSObject sender) + { + mainWindowController.Window.ActionDeleteValue(); + } } } diff --git a/Mac/AppDelegate.designer.cs b/Mac/AppDelegate.designer.cs index 79392b8..4ad7e8c 100644 --- a/Mac/AppDelegate.designer.cs +++ b/Mac/AppDelegate.designer.cs @@ -11,6 +11,81 @@ namespace NBTExplorer [Register ("AppDelegate")] partial class AppDelegate { + [Outlet] + MonoMac.AppKit.NSMenuItem _menuAbout { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuQuit { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuOpen { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuOpenFolder { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuOpenMinecraft { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuSave { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuCut { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuCopy { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuPaste { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuRename { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuEditValue { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuDelete { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuFind { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuFindNext { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertByte { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertShort { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertInt { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertLong { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertFloat { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertDouble { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertByteArray { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertIntArray { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertString { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertList { get; set; } + + [Outlet] + MonoMac.AppKit.NSMenuItem _menuInsertCompound { get; set; } + [Action ("ActionRename:")] partial void ActionRename (MonoMac.Foundation.NSObject sender); @@ -22,6 +97,130 @@ namespace NBTExplorer void ReleaseDesignerOutlets () { + if (_menuAbout != null) { + _menuAbout.Dispose (); + _menuAbout = null; + } + + if (_menuQuit != null) { + _menuQuit.Dispose (); + _menuQuit = null; + } + + if (_menuOpen != null) { + _menuOpen.Dispose (); + _menuOpen = null; + } + + if (_menuOpenFolder != null) { + _menuOpenFolder.Dispose (); + _menuOpenFolder = null; + } + + if (_menuOpenMinecraft != null) { + _menuOpenMinecraft.Dispose (); + _menuOpenMinecraft = null; + } + + if (_menuSave != null) { + _menuSave.Dispose (); + _menuSave = null; + } + + if (_menuCut != null) { + _menuCut.Dispose (); + _menuCut = null; + } + + if (_menuCopy != null) { + _menuCopy.Dispose (); + _menuCopy = null; + } + + if (_menuPaste != null) { + _menuPaste.Dispose (); + _menuPaste = null; + } + + if (_menuRename != null) { + _menuRename.Dispose (); + _menuRename = null; + } + + if (_menuEditValue != null) { + _menuEditValue.Dispose (); + _menuEditValue = null; + } + + if (_menuDelete != null) { + _menuDelete.Dispose (); + _menuDelete = null; + } + + if (_menuFind != null) { + _menuFind.Dispose (); + _menuFind = null; + } + + if (_menuFindNext != null) { + _menuFindNext.Dispose (); + _menuFindNext = null; + } + + if (_menuInsertByte != null) { + _menuInsertByte.Dispose (); + _menuInsertByte = null; + } + + if (_menuInsertShort != null) { + _menuInsertShort.Dispose (); + _menuInsertShort = null; + } + + if (_menuInsertInt != null) { + _menuInsertInt.Dispose (); + _menuInsertInt = null; + } + + if (_menuInsertLong != null) { + _menuInsertLong.Dispose (); + _menuInsertLong = null; + } + + if (_menuInsertFloat != null) { + _menuInsertFloat.Dispose (); + _menuInsertFloat = null; + } + + if (_menuInsertDouble != null) { + _menuInsertDouble.Dispose (); + _menuInsertDouble = null; + } + + if (_menuInsertByteArray != null) { + _menuInsertByteArray.Dispose (); + _menuInsertByteArray = null; + } + + if (_menuInsertIntArray != null) { + _menuInsertIntArray.Dispose (); + _menuInsertIntArray = null; + } + + if (_menuInsertString != null) { + _menuInsertString.Dispose (); + _menuInsertString = null; + } + + if (_menuInsertList != null) { + _menuInsertList.Dispose (); + _menuInsertList = null; + } + + if (_menuInsertCompound != null) { + _menuInsertCompound.Dispose (); + _menuInsertCompound = null; + } } } } diff --git a/Mac/EditNameWindow.cs b/Mac/EditNameWindow.cs new file mode 100644 index 0000000..0a8bc07 --- /dev/null +++ b/Mac/EditNameWindow.cs @@ -0,0 +1,35 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace NBTExplorer.Mac +{ + public partial class EditNameWindow : MonoMac.AppKit.NSWindow + { + #region Constructors + + // Called when created from unmanaged code + public EditNameWindow (IntPtr handle) : base (handle) + { + Initialize (); + } + + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public EditNameWindow (NSCoder coder) : base (coder) + { + Initialize (); + } + + // Shared initialization code + void Initialize () + { + } + + #endregion + } +} + diff --git a/Mac/EditNameWindow.designer.cs b/Mac/EditNameWindow.designer.cs new file mode 100644 index 0000000..d5506dc --- /dev/null +++ b/Mac/EditNameWindow.designer.cs @@ -0,0 +1,40 @@ +// WARNING +// +// This file has been generated automatically by MonoDevelop to store outlets and +// actions made in the Xcode designer. If it is removed, they will be lost. +// Manual changes to this file may not be handled correctly. +// +using MonoMac.Foundation; + +namespace NBTExplorer.Mac +{ + [Register ("EditNameWindowController")] + partial class EditNameWindowController + { + [Outlet] + MonoMac.AppKit.NSTextField _textField { get; set; } + + [Action ("OkayAction:")] + partial void OkayAction (MonoMac.Foundation.NSObject sender); + + [Action ("CancelAction:")] + partial void CancelAction (MonoMac.Foundation.NSObject sender); + + void ReleaseDesignerOutlets () + { + if (_textField != null) { + _textField.Dispose (); + _textField = null; + } + } + } + + [Register ("EditNameWindow")] + partial class EditNameWindow + { + + void ReleaseDesignerOutlets () + { + } + } +} diff --git a/Mac/EditNameWindow.xib b/Mac/EditNameWindow.xib new file mode 100644 index 0000000..830a66f --- /dev/null +++ b/Mac/EditNameWindow.xib @@ -0,0 +1,406 @@ + + + + 1080 + 12B2080 + 2844 + 1187 + 624.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + YES + NSButton + NSButtonCell + NSCustomObject + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + EditNameWindowController + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{131, 74}, {271, 91}} + 611844096 + Edit Name... + EditNameWindow + + + + + 256 + + YES + + + 268 + {{20, 49}, {231, 22}} + + + _NS:9 + YES + + -1804599231 + 272630784 + + + LucidaGrande + 13 + 1044 + + _NS:9 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + NO + + + + 268 + {{175, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + OK + + _NS:9 + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + + 268 + {{93, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + Cancel + + _NS:9 + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {271, 91} + + + + {{0, 0}, {1600, 1178}} + {10000000000000, 10000000000000} + YES + + + + + YES + + + window + + + + 6 + + + + _textField + + + + 13 + + + + OkayAction: + + + + 14 + + + + CancelAction: + + + + 15 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + YES + + + + + + 12 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 2.IBPluginDependency + 2.IBWindowTemplateEditedContentRect + 2.NSWindowTemplate.visibleAtLaunch + 3.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + 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 + {{319, 371}, {606, 354}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 15 + + + + YES + + EditNameWindow + NSWindow + + IBProjectSource + ./Classes/EditNameWindow.h + + + + EditNameWindowController + NSWindowController + + YES + + YES + CancelAction: + OkayAction: + + + YES + id + id + + + + YES + + YES + CancelAction: + OkayAction: + + + YES + + CancelAction: + id + + + OkayAction: + id + + + + + _textField + NSTextField + + + _textField + + _textField + NSTextField + + + + IBProjectSource + ./Classes/EditNameWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/Mac/EditNameWindowController.cs b/Mac/EditNameWindowController.cs new file mode 100644 index 0000000..472bdba --- /dev/null +++ b/Mac/EditNameWindowController.cs @@ -0,0 +1,125 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace NBTExplorer.Mac +{ + public partial class EditNameWindowController : NSWindowController + { + private string _originalName; + private string _name; + + private List _invalidNames = new List(); + + #region Constructors + + // Called when created from unmanaged code + public EditNameWindowController (IntPtr handle) : base (handle) + { + Initialize (); + } + + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public EditNameWindowController (NSCoder coder) : base (coder) + { + Initialize (); + } + + // Call to load from the XIB/NIB file + public EditNameWindowController () : base ("EditNameWindow") + { + Initialize (); + } + + // Shared initialization code + void Initialize () + { + } + + public override void AwakeFromNib () + { + base.AwakeFromNib (); + _textField.StringValue = _name; + } + + #endregion + + public string OriginalName + { + get { return _originalName; } + set { + _originalName = value; + TagName = value; + } + } + + public string TagName + { + get { return _name; } + set { + _name = value; + if (_textField != null) + _textField.StringValue = _name; + } + } + + public List InvalidNames + { + get { return _invalidNames; } + } + + public bool IsModified + { + get { return _name != _originalName; } + } + + private void Apply () + { + if (ValidateInput()) { + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.OK); + return; + } + } + + private bool ValidateInput () + { + return ValidateNameInput(); + } + + private bool ValidateNameInput () + { + string text = _textField.StringValue.Trim(); + + if (text != _originalName && _invalidNames.Contains(text)) { + NSAlert.WithMessage("Duplicate name provided.", "OK", null, null, "Duplicate name provided.").RunModal(); + return false; + } + + _name = _textField.StringValue.Trim(); + return true; + } + + partial void OkayAction (MonoMac.Foundation.NSObject sender) + { + Apply (); + } + + partial void CancelAction (MonoMac.Foundation.NSObject sender) + { + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.Cancel); + } + + //strongly typed window accessor + public new EditNameWindow Window + { + get { + return (EditNameWindow)base.Window; + } + } + } +} + diff --git a/Mac/EditStringWindow.cs b/Mac/EditStringWindow.cs new file mode 100644 index 0000000..501bf8c --- /dev/null +++ b/Mac/EditStringWindow.cs @@ -0,0 +1,35 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace NBTExplorer.Mac +{ + public partial class EditStringWindow : MonoMac.AppKit.NSWindow + { + #region Constructors + + // Called when created from unmanaged code + public EditStringWindow (IntPtr handle) : base (handle) + { + Initialize (); + } + + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public EditStringWindow (NSCoder coder) : base (coder) + { + Initialize (); + } + + // Shared initialization code + void Initialize () + { + } + + #endregion + } +} + diff --git a/Mac/EditStringWindow.designer.cs b/Mac/EditStringWindow.designer.cs new file mode 100644 index 0000000..72a6590 --- /dev/null +++ b/Mac/EditStringWindow.designer.cs @@ -0,0 +1,40 @@ +// WARNING +// +// This file has been generated automatically by MonoDevelop to store outlets and +// actions made in the Xcode designer. If it is removed, they will be lost. +// Manual changes to this file may not be handled correctly. +// +using MonoMac.Foundation; + +namespace NBTExplorer.Mac +{ + [Register ("EditStringWindowController")] + partial class EditStringWindowController + { + [Outlet] + MonoMac.AppKit.NSTextView _textView { get; set; } + + [Action ("ActionOK:")] + partial void ActionOK (MonoMac.Foundation.NSObject sender); + + [Action ("ActionCancel:")] + partial void ActionCancel (MonoMac.Foundation.NSObject sender); + + void ReleaseDesignerOutlets () + { + if (_textView != null) { + _textView.Dispose (); + _textView = null; + } + } + } + + [Register ("EditStringWindow")] + partial class EditStringWindow + { + + void ReleaseDesignerOutlets () + { + } + } +} diff --git a/Mac/EditStringWindow.xib b/Mac/EditStringWindow.xib new file mode 100644 index 0000000..feea0c6 --- /dev/null +++ b/Mac/EditStringWindow.xib @@ -0,0 +1,721 @@ + + + + 1080 + 12B2080 + 2844 + 1187 + 624.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + YES + NSButton + NSButtonCell + NSCustomObject + NSScrollView + NSScroller + NSTextView + NSView + NSWindowTemplate + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + EditStringWindowController + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{131, 74}, {380, 190}} + 611844096 + Edit String... + EditStringWindow + + + + + 256 + + YES + + + 256 + + YES + + + 2304 + + YES + + + 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + + {338, 107} + + + + _NS:13 + + + + + + + + + + YES + + + 166 + + + + 338 + 1 + + + 67121123 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 1 + + 6 + {463, 10000000} + + + + {{1, 1}, {338, 107}} + + + + _NS:11 + + + + {4, 5} + + 12582912 + + YES + + YES + + + + TU0AKgAAEAj///8A////qwAAAP8AAAD/AwMD/BYWFtIFBQVuAAAABv///wD///8E6+vrTGhoaLYtLS3p +BAQE/QAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/AAAA/wAAAP8EBATSX19fK9HR0ZciIiLv +AAAA/wAAAP8AAAD/AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////CsPDw0CRkZG1FxcX9AAAAP8bGxvr +ICAg8AAAAP8ICAjlFRUVVQAAAA////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wrm5uab +FxcX9AAAAP8AAAD/AQEB3wAAAA////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///zaXl5fGAAAA/wAAAP8AAABR////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////CO7u7q8AAAD/AAAA/wAAAAz///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/ +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+r +AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/AAAA/wAAAP8AAAD/ +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/ +AAAA/wAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/ +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+r +AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////CO7u7q8AAAD/AAAA/wAAAAz///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///80mpqaxQAAAP8AAAD/AAAATv///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////CuXl5ZYeHh7xAAAA/wAAAP8CAgLXAAAAD////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////EKurq0mOjo63FxcX9AAAAP8bGxvrICAg8AAAAP8ICAjlHh4eXAAAABj///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qwAAAP8AAAD/AAAA/wAAAP8AAAD/BAQE1V9fXyvS0tKZICAg8AAAAP8AAAD/ +AAAA/wAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/FBQU1AUFBXEAAAAG////AP///wTr6+tO +ZWVluC4uLuoAAAD/AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8AABABAAADAAAAAQAgAAABAQADAAAAAQAgAAABAgADAAAABAAA +EM4BAwADAAAAAQABAAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAE +AAABFgADAAAAAQAgAAABFwAEAAAAAQAAEAABGgAFAAAAAQAAENYBGwAFAAAAAQAAEN4BHAADAAAAAQAB +AAABKAADAAAAAQACAAABUgADAAAAAQACAAABUwADAAAABAAAEOYAAAAAAAgACAAIAAgSAAAAACAAABIA +AAAAIAAAAAEAAQABAAE + + + + + YES + + + + TU0AKgAABAj///9VQ0ND/wAAAP////8A////AP///6pDQ0P/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+qAAAA/////6oAAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///6oAAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+qAAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6oAAAD/////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+qAAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP////8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP8AAAD/ +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+q +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////qgAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///6oAAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///+qAAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qgAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qgAAAP////+qAAAA/////wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///9VQ0ND/wAAAP////8A////AP///6pDQ0P/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8AAA4BAAADAAAAAQAQAAABAQADAAAAAQAQAAABAgADAAAABAAABLYBAwADAAAAAQAB +AAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAEAAABFgADAAAAAQAQ +AAABFwAEAAAAAQAABAABHAADAAAAAQABAAABUgADAAAAAQACAAABUwADAAAABAAABL6HcwAHAAAHqAAA +BMYAAAAAAAgACAAIAAgAAQABAAEAAQAAB6hhcHBsAiAAAG1udHJSR0IgWFlaIAfZAAIAGQALABoAC2Fj +c3BBUFBMAAAAAGFwcGwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC2Rlc2MAAAEIAAAAb2RzY20AAAF4AAAFbGNw +cnQAAAbkAAAAOHd0cHQAAAccAAAAFHJYWVoAAAcwAAAAFGdYWVoAAAdEAAAAFGJYWVoAAAdYAAAAFHJU +UkMAAAdsAAAADmNoYWQAAAd8AAAALGJUUkMAAAdsAAAADmdUUkMAAAdsAAAADmRlc2MAAAAAAAAAFEdl +bmVyaWMgUkdCIFByb2ZpbGUAAAAAAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAB4AAAAMc2tTSwAA +ACgAAAF4aHJIUgAAACgAAAGgY2FFUwAAACQAAAHIcHRCUgAAACYAAAHsdWtVQQAAACoAAAISZnJGVQAA +ACgAAAI8emhUVwAAABYAAAJkaXRJVAAAACgAAAJ6bmJOTwAAACYAAAKia29LUgAAABYAAALIY3NDWgAA +ACIAAALeaGVJTAAAAB4AAAMAZGVERQAAACwAAAMeaHVIVQAAACgAAANKc3ZTRQAAACYAAAKiemhDTgAA +ABYAAANyamFKUAAAABoAAAOIcm9STwAAACQAAAOiZWxHUgAAACIAAAPGcHRQTwAAACYAAAPobmxOTAAA +ACgAAAQOZXNFUwAAACYAAAPodGhUSAAAACQAAAQ2dHJUUgAAACIAAARaZmlGSQAAACgAAAR8cGxQTAAA +ACwAAASkcnVSVQAAACIAAATQYXJFRwAAACYAAATyZW5VUwAAACYAAAUYZGFESwAAAC4AAAU+AFYBYQBl +AG8AYgBlAGMAbgD9ACAAUgBHAEIAIABwAHIAbwBmAGkAbABHAGUAbgBlAHIAaQENAGsAaQAgAFIARwBC +ACAAcAByAG8AZgBpAGwAUABlAHIAZgBpAGwAIABSAEcAQgAgAGcAZQBuAOgAcgBpAGMAUABlAHIAZgBp +AGwAIABSAEcAQgAgAEcAZQBuAOkAcgBpAGMAbwQXBDAEMwQwBDsETAQ9BDgEOQAgBD8EQAQ+BEQEMAQ5 +BDsAIABSAEcAQgBQAHIAbwBmAGkAbAAgAGcA6QBuAOkAcgBpAHEAdQBlACAAUgBWAEKQGnUoACAAUgBH +AEIAIIJyX2ljz4/wAFAAcgBvAGYAaQBsAG8AIABSAEcAQgAgAGcAZQBuAGUAcgBpAGMAbwBHAGUAbgBl +AHIAaQBzAGsAIABSAEcAQgAtAHAAcgBvAGYAaQBsx3y8GAAgAFIARwBCACDVBLhc0wzHfABPAGIAZQBj +AG4A/QAgAFIARwBCACAAcAByAG8AZgBpAGwF5AXoBdUF5AXZBdwAIABSAEcAQgAgBdsF3AXcBdkAQQBs +AGwAZwBlAG0AZQBpAG4AZQBzACAAUgBHAEIALQBQAHIAbwBmAGkAbADBAGwAdABhAGwA4QBuAG8AcwAg +AFIARwBCACAAcAByAG8AZgBpAGxmbpAaACAAUgBHAEIAIGPPj/Blh072TgCCLAAgAFIARwBCACAw1zDt +MNUwoTCkMOsAUAByAG8AZgBpAGwAIABSAEcAQgAgAGcAZQBuAGUAcgBpAGMDkwO1A70DuQO6A8wAIAPA +A8EDvwPGA68DuwAgAFIARwBCAFAAZQByAGYAaQBsACAAUgBHAEIAIABnAGUAbgDpAHIAaQBjAG8AQQBs +AGcAZQBtAGUAZQBuACAAUgBHAEIALQBwAHIAbwBmAGkAZQBsDkIOGw4jDkQOHw4lDkwAIABSAEcAQgAg +DhcOMQ5IDicORA4bAEcAZQBuAGUAbAAgAFIARwBCACAAUAByAG8AZgBpAGwAaQBZAGwAZQBpAG4AZQBu +ACAAUgBHAEIALQBwAHIAbwBmAGkAaQBsAGkAVQBuAGkAdwBlAHIAcwBhAGwAbgB5ACAAcAByAG8AZgBp +AGwAIABSAEcAQgQeBDEESQQ4BDkAIAQ/BEAEPgREBDgEOwRMACAAUgBHAEIGRQZEBkEAIAYqBjkGMQZK +BkEAIABSAEcAQgAgBicGRAY5BicGRQBHAGUAbgBlAHIAaQBjACAAUgBHAEIAIABQAHIAbwBmAGkAbABl +AEcAZQBuAGUAcgBlAGwAIABSAEcAQgAtAGIAZQBzAGsAcgBpAHYAZQBsAHMAZXRleHQAAAAAQ29weXJp +Z2h0IDIwMDcgQXBwbGUgSW5jLiwgYWxsIHJpZ2h0cyByZXNlcnZlZC4AWFlaIAAAAAAAAPNSAAEAAAAB +Fs9YWVogAAAAAAAAdE0AAD3uAAAD0FhZWiAAAAAAAABadQAArHMAABc0WFlaIAAAAAAAACgaAAAVnwAA +uDZjdXJ2AAAAAAAAAAEBzQAAc2YzMgAAAAAAAQxCAAAF3v//8yYAAAeSAAD9kf//+6L///2jAAAD3AAA +wGw + + + + + + 3 + MCAwAA + + + + 4 + + + + -2147483392 + {{324, 1}, {15, 81}} + + + _NS:83 + NO + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + + _NS:33 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{20, 61}, {340, 109}} + + + + _NS:9 + 133650 + + + + 0.25 + 4 + 1 + + + + 268 + {{284, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + _NS:9 + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + + 268 + {{202, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + Cancel + + _NS:9 + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {380, 190} + + + + {{0, 0}, {1600, 1178}} + {10000000000000, 10000000000000} + YES + + + + + YES + + + window + + + + 6 + + + + _textView + + + + 15 + + + + ActionOK: + + + + 16 + + + + ActionCancel: + + + + 18 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + + + 7 + + + YES + + + + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + YES + + + + + + 12 + + + + + 13 + + + YES + + + + + + 14 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 2.IBPluginDependency + 2.IBWindowTemplateEditedContentRect + 2.NSWindowTemplate.visibleAtLaunch + 3.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + 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 + {{319, 371}, {606, 354}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 18 + + + + YES + + EditStringWindow + NSWindow + + IBProjectSource + ./Classes/EditStringWindow.h + + + + EditStringWindowController + NSWindowController + + YES + + YES + ActionCancel: + ActionOK: + + + YES + id + id + + + + YES + + YES + ActionCancel: + ActionOK: + + + YES + + ActionCancel: + id + + + ActionOK: + id + + + + + _textView + NSTextView + + + _textView + + _textView + NSTextView + + + + IBProjectSource + ./Classes/EditStringWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/Mac/EditStringWindowController.cs b/Mac/EditStringWindowController.cs new file mode 100644 index 0000000..f21cc63 --- /dev/null +++ b/Mac/EditStringWindowController.cs @@ -0,0 +1,96 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.Foundation; +using MonoMac.AppKit; + +namespace NBTExplorer.Mac +{ + public partial class EditStringWindowController : NSWindowController + { + private string _string; + + #region Constructors + + // Called when created from unmanaged code + public EditStringWindowController (IntPtr handle) : base (handle) + { + Initialize (); + } + + // Called when created directly from a XIB file + [Export ("initWithCoder:")] + public EditStringWindowController (NSCoder coder) : base (coder) + { + Initialize (); + } + + // Call to load from the XIB/NIB file + public EditStringWindowController () : base ("EditStringWindow") + { + Initialize (); + } + + // Shared initialization code + void Initialize () + { + } + + public override void AwakeFromNib () + { + base.AwakeFromNib (); + _textView.Value = _string; + } + + #endregion + + //strongly typed window accessor + public new EditStringWindow Window + { + get { + return (EditStringWindow)base.Window; + } + } + + public string StringValue + { + get { return _string; } + set { + _string = value; + if (_textView != null) + _textView.Value = _string; + } + } + + private void Apply () + { + if (ValidateInput()) { + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.OK); + return; + } + } + + private bool ValidateInput () + { + return ValidateStringInput(); + } + + private bool ValidateStringInput () + { + _string = _textView.Value.Trim(); + return true; + } + + partial void ActionOK (NSObject sender) + { + Apply (); + } + + partial void ActionCancel (NSObject sender) + { + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.Cancel); + } + } +} + diff --git a/Mac/EditValue.cs b/Mac/EditValue.cs index 7bb94d6..76f213c 100644 --- a/Mac/EditValue.cs +++ b/Mac/EditValue.cs @@ -10,14 +10,7 @@ namespace NBTExplorer.Mac { public partial class EditValue : MonoMac.AppKit.NSWindow { - public enum DialogResult - { - OK, - Cancel, - } - private TagNode _tag; - private DialogResult _result; #region Constructors @@ -41,18 +34,22 @@ namespace NBTExplorer.Mac _tag = tag; if (tag == null) { - _result = DialogResult.Cancel; - Close(); + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.Cancel); return; } - - _valueField.StringValue = _tag.ToString(); } // Shared initialization code void Initialize () { } + + public override void AwakeFromNib () + { + base.AwakeFromNib (); + if (_tag != null) + _valueField.StringValue = _tag.ToString(); + } #endregion @@ -61,9 +58,14 @@ namespace NBTExplorer.Mac get { return _tag; } } - public DialogResult Result + partial void ActionOK (MonoMac.Foundation.NSObject sender) { - get { return _result; } + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.OK); + } + + partial void ActionCancel (MonoMac.Foundation.NSObject sender) + { + NSApplication.SharedApplication.StopModalWithCode((int)ModalResult.Cancel); } /*private TagNode _tag; diff --git a/Mac/FormHandlers.cs b/Mac/FormHandlers.cs new file mode 100644 index 0000000..6c6a6a7 --- /dev/null +++ b/Mac/FormHandlers.cs @@ -0,0 +1,109 @@ +using System; +using MonoMac.AppKit; + +namespace NBTExplorer.Mac +{ + public static class FormHandlers + { + public static void Register () + { + //FormRegistry.EditByteArray = EditByteArrayHandler; + FormRegistry.EditString = EditStringHandler; + FormRegistry.EditTagScalar = EditTagScalarValueHandler; + FormRegistry.RenameTag = RenameTagHandler; + //FormRegistry.CreateNode = CreateNodeHandler; + + FormRegistry.MessageBox = MessageBoxHandler; + } + + private static ModalResult RunWindow (NSWindowController controller) + { + NSApplication.SharedApplication.BeginSheet (controller.Window, NSApplication.SharedApplication.MainWindow); + int response = NSApplication.SharedApplication.RunModalForWindow (controller.Window); + + NSApplication.SharedApplication.EndSheet(controller.Window); + controller.Window.Close(); + controller.Window.OrderOut(null); + + if (!Enum.IsDefined(typeof(ModalResult), response)) + response = 0; + + return (ModalResult)response; + } + + public static void MessageBoxHandler (string message) + { + NSAlert.WithMessage(message, "OK", null, null, null).RunModal(); + } + + public static bool EditStringHandler (StringFormData data) + { + EditStringWindowController form = new EditStringWindowController (); + form.StringValue = data.Value; + + if (RunWindow (form) == ModalResult.OK) { + data.Value = form.StringValue; + return true; + } + else + return false; + } + + public static bool RenameTagHandler (RestrictedStringFormData data) + { + EditNameWindowController form = new EditNameWindowController (); + form.OriginalName = data.Value; + form.InvalidNames.AddRange (data.RestrictedValues); + + if (RunWindow (form) == ModalResult.OK) { + data.Value = form.TagName; + return true; + } + else + return false; + } + + public static bool EditTagScalarValueHandler (TagScalarFormData data) + { + EditValue form = new EditValue(data.Tag); + + NSApplication.SharedApplication.BeginSheet(form, NSApplication.SharedApplication.MainWindow); + NSApplication.SharedApplication.RunModalForWindow(form); + NSApplication.SharedApplication.EndSheet(form); + + form.Close (); + form.OrderOut(null); + + //if (form.ShowDialog() == DialogResult.OK) + // return true; + //else + return false; + } + + /*public static bool EditByteArrayHandler (ByteArrayFormData data) + { + HexEditor form = new HexEditor(data.NodeName, data.Data, data.BytesPerElement); + if (form.ShowDialog() == DialogResult.OK && form.Modified) { + Array.Copy(form.Data, data.Data, data.Data.Length); + return true; + } + else + return false; + } + + public static bool CreateNodeHandler (CreateTagFormData data) + { + CreateNodeForm form = new CreateNodeForm(data.TagType, data.HasName); + form.InvalidNames.AddRange(data.RestrictedNames); + + if (form.ShowDialog() == DialogResult.OK) { + data.TagNode = form.TagNode; + data.TagName = form.TagName; + return true; + } + else + return false; + }*/ + } +} + diff --git a/Mac/ImageAndTextCell.cs b/Mac/ImageAndTextCell.cs index d3e0aaa..f6e3489 100644 --- a/Mac/ImageAndTextCell.cs +++ b/Mac/ImageAndTextCell.cs @@ -19,6 +19,7 @@ namespace NBTExplorer.Mac public ImageAndTextCell () { + Initialize(); } public ImageAndTextCell (IntPtr handle) @@ -39,6 +40,8 @@ namespace NBTExplorer.Mac { LineBreakMode = NSLineBreakMode.TruncatingTail; Selectable = true; + + PeriodicCleanup(); } protected override void Dispose (bool disposing) @@ -53,6 +56,127 @@ namespace NBTExplorer.Mac base.Dispose (disposing); } + static List _refPool = new List(); + + // Method 1 + + /*static IntPtr selRetain = Selector.GetHandle ("retain"); + + [Export("copyWithZone:")] + public virtual NSObject CopyWithZone(IntPtr zone) { + ImageAndTextCell cell = new ImageAndTextCell() { + Title = Title, + Image = Image, + }; + + Messaging.void_objc_msgSend (cell.Handle, selRetain); + + return cell; + }*/ + + // Method 2 + + /*[Export("copyWithZone:")] + public virtual NSObject CopyWithZone(IntPtr zone) { + ImageAndTextCell cell = new ImageAndTextCell() { + Title = Title, + Image = Image, + }; + + _refPool.Add(cell); + + return cell; + } + + [Export("dealloc")] + public void Dealloc () + { + _refPool.Remove(this); + this.Dispose(); + } + + // Method 3 + + static IntPtr selRetain = Selector.GetHandle ("retain"); + + [Export("copyWithZone:")] + public virtual NSObject CopyWithZone(IntPtr zone) { + ImageAndTextCell cell = new ImageAndTextCell() { + Title = Title, + Image = Image, + }; + + _refPool.Add(cell); + Messaging.void_objc_msgSend (cell.Handle, selRetain); + + return cell; + } + + // Method 4 + + static IntPtr selRetain = Selector.GetHandle ("retain"); + static IntPtr selRetainCount = Selector.GetHandle("retainCount"); + + [Export("copyWithZone:")] + public virtual NSObject CopyWithZone (IntPtr zone) + { + ImageAndTextCell cell = new ImageAndTextCell () { + Title = Title, + Image = Image, + }; + + _refPool.Add (cell); + Messaging.void_objc_msgSend (cell.Handle, selRetain); + + return cell; + }*/ + + static IntPtr selRetain = Selector.GetHandle ("retain"); + static IntPtr selRetainCount = Selector.GetHandle("retainCount"); + + public void PeriodicCleanup () + { + List markedForDelete = new List (); + + foreach (ImageAndTextCell cell in _refPool) { + uint count = Messaging.UInt32_objc_msgSend (cell.Handle, selRetainCount); + if (count == 1) + markedForDelete.Add (cell); + } + + foreach (ImageAndTextCell cell in markedForDelete) { + _refPool.Remove (cell); + cell.Dispose (); + } + } + + // Method 5 + + static IntPtr selCopyWithZone = Selector.GetHandle("copyWithZone:"); + static IntPtr selDealloc = Selector.GetHandle("dealloc"); + + [Export("copyWithZone:")] + public virtual NSObject CopyWithZone(IntPtr zone) { + IntPtr copyHandle = Messaging.IntPtr_objc_msgSendSuper_IntPtr(SuperHandle, selCopyWithZone, zone); + ImageAndTextCell cell = new ImageAndTextCell(copyHandle) { + Image = Image, + }; + + _refPool.Add(cell); + + return cell; + } + + /*[Export("dealloc")] + public void Dealloc () + { + //_refPool.Remove(this); + //Messaging.void_objc_msgSendSuper(SuperHandle, selDealloc); + }*/ + + + + /*[Export("copyWithZone:")] public virtual NSObject CopyWithZone(IntPtr zone) { ImageAndTextCell cell = new ImageAndTextCell() { @@ -63,14 +187,14 @@ namespace NBTExplorer.Mac return cell; }*/ - static List _refPool = new List(); + //static List _refPool = new List(); //static IntPtr selRetain = Selector.GetHandle ("retain"); //static IntPtr selAutoRelease = Selector.GetHandle("autorelease"); //static IntPtr selRelease = Selector.GetHandle("release"); //static IntPtr selCopyWithZone = Selector.GetHandle("copyWithZone:"); - [Export("copyWithZone:")] + /*[Export("copyWithZone:")] public NSObject CopyWithZone (IntPtr zone) { //IntPtr copy = Messaging.IntPtr_objc_msgSendSuper_IntPtr(SuperHandle, selCopyWithZone, zone); @@ -99,7 +223,7 @@ namespace NBTExplorer.Mac _refPool.Remove(this); //Messaging.void_objc_msgSendSuper(SuperHandle, selDealloc); - } + }*/ public new NSImage Image { diff --git a/Mac/MainMenu.xib b/Mac/MainMenu.xib index d8693c3..84f1bf7 100644 --- a/Mac/MainMenu.xib +++ b/Mac/MainMenu.xib @@ -292,7 +292,8 @@ Find Next - + g + 1048576 2147483647 @@ -334,22 +335,182 @@ - + - Window - - 1048576 - 2147483647 - - - - - - Help + Insert 2147483647 + submenuAction: + + Insert + + YES + + + Byte Tag + + 2147483647 + + NSImage + document-attribute-b + + + + + + + Short Tag + + 2147483647 + + NSImage + document-attribute-s + + + + + + + Int Tag + + 2147483647 + + NSImage + document-attribute-i + + + + + + + Long Tag + + 2147483647 + + NSImage + document-attribute-l + + + + + + + YES + YES + + + 2147483647 + + + + + + Float Tag + + 2147483647 + + NSImage + document-attribute-f + + + + + + + Double Tag + + 2147483647 + + NSImage + document-attribute-d + + + + + + + YES + YES + + + 2147483647 + + + + + + Byte Array Tag + + 2147483647 + + NSImage + edit-code + + + + + + + Int Array Tag + + 2147483647 + + NSImage + edit-code-i + + + + + + + YES + YES + + + 2147483647 + + + + + + String Tag + + 2147483647 + + NSImage + edit-small-caps + + + + + + + List Tag + + 2147483647 + + NSImage + edit-list + + + + + + + Compound Tag + + 2147483647 + + NSImage + box + + + + + + _NSMainMenu @@ -468,6 +629,206 @@ 548 + + + _menuRename + + + + 549 + + + + _menuEditValue + + + + 550 + + + + _menuDelete + + + + 551 + + + + _menuCut + + + + 574 + + + + _menuCopy + + + + 575 + + + + _menuPaste + + + + 576 + + + + _menuFind + + + + 577 + + + + _menuFindNext + + + + 578 + + + + _menuAbout + + + + 579 + + + + _menuQuit + + + + 580 + + + + _menuOpen + + + + 581 + + + + _menuOpenFolder + + + + 582 + + + + _menuOpenMinecraft + + + + 583 + + + + _menuSave + + + + 584 + + + + _menuInsertByte + + + + 585 + + + + _menuInsertShort + + + + 586 + + + + _menuInsertInt + + + + 587 + + + + _menuInsertLong + + + + 588 + + + + _menuInsertFloat + + + + 589 + + + + _menuInsertDouble + + + + 590 + + + + _menuInsertByteArray + + + + 591 + + + + _menuInsertIntArray + + + + 592 + + + + _menuInsertString + + + + 593 + + + + _menuInsertList + + + + 594 + + + + _menuInsertCompound + + + + 595 + @@ -503,23 +864,14 @@ YES - - + - - 19 - - - YES - - - 56 @@ -698,14 +1050,6 @@ - - 490 - - - YES - - - 533 @@ -768,6 +1112,107 @@ + + 558 + + + YES + + + + + + 559 + + + YES + + + + + + + + + + + + + + + + + + + 560 + + + + + 561 + + + + + 562 + + + + + 563 + + + + + 564 + + + + + 565 + + + + + 566 + + + + + 567 + + + + + 568 + + + + + 569 + + + + + 570 + + + + + 571 + + + + + 572 + + + + + 573 + + + @@ -780,7 +1225,6 @@ 124.IBPluginDependency 125.IBPluginDependency 136.IBPluginDependency - 19.IBPluginDependency 197.IBPluginDependency 199.IBPluginDependency 202.IBPluginDependency @@ -795,7 +1239,6 @@ 297.IBPluginDependency 298.IBPluginDependency 420.IBPluginDependency - 490.IBPluginDependency 533.IBPluginDependency 535.IBPluginDependency 536.IBPluginDependency @@ -807,8 +1250,24 @@ 543.IBPluginDependency 544.IBPluginDependency 545.IBPluginDependency + 558.IBPluginDependency + 559.IBPluginDependency 56.IBPluginDependency + 560.IBPluginDependency + 561.IBPluginDependency + 562.IBPluginDependency + 563.IBPluginDependency + 564.IBPluginDependency + 565.IBPluginDependency + 566.IBPluginDependency + 567.IBPluginDependency + 568.IBPluginDependency + 569.IBPluginDependency 57.IBPluginDependency + 570.IBPluginDependency + 571.IBPluginDependency + 572.IBPluginDependency + 573.IBPluginDependency 58.IBPluginDependency 72.IBPluginDependency 75.IBPluginDependency @@ -859,6 +1318,20 @@ 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 @@ -873,7 +1346,7 @@ - 548 + 595 @@ -920,6 +1393,199 @@ + + YES + + YES + _menuAbout + _menuCopy + _menuCut + _menuDelete + _menuEditValue + _menuFind + _menuFindNext + _menuInsertByte + _menuInsertByteArray + _menuInsertCompound + _menuInsertDouble + _menuInsertFloat + _menuInsertInt + _menuInsertIntArray + _menuInsertList + _menuInsertLong + _menuInsertShort + _menuInsertString + _menuOpen + _menuOpenFolder + _menuOpenMinecraft + _menuPaste + _menuQuit + _menuRename + _menuSave + + + YES + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + + + + YES + + YES + _menuAbout + _menuCopy + _menuCut + _menuDelete + _menuEditValue + _menuFind + _menuFindNext + _menuInsertByte + _menuInsertByteArray + _menuInsertCompound + _menuInsertDouble + _menuInsertFloat + _menuInsertInt + _menuInsertIntArray + _menuInsertList + _menuInsertLong + _menuInsertShort + _menuInsertString + _menuOpen + _menuOpenFolder + _menuOpenMinecraft + _menuPaste + _menuQuit + _menuRename + _menuSave + + + YES + + _menuAbout + NSMenuItem + + + _menuCopy + NSMenuItem + + + _menuCut + NSMenuItem + + + _menuDelete + NSMenuItem + + + _menuEditValue + NSMenuItem + + + _menuFind + NSMenuItem + + + _menuFindNext + NSMenuItem + + + _menuInsertByte + NSMenuItem + + + _menuInsertByteArray + NSMenuItem + + + _menuInsertCompound + NSMenuItem + + + _menuInsertDouble + NSMenuItem + + + _menuInsertFloat + NSMenuItem + + + _menuInsertInt + NSMenuItem + + + _menuInsertIntArray + NSMenuItem + + + _menuInsertList + NSMenuItem + + + _menuInsertLong + NSMenuItem + + + _menuInsertShort + NSMenuItem + + + _menuInsertString + NSMenuItem + + + _menuOpen + NSMenuItem + + + _menuOpenFolder + NSMenuItem + + + _menuOpenMinecraft + NSMenuItem + + + _menuPaste + NSMenuItem + + + _menuQuit + NSMenuItem + + + _menuRename + NSMenuItem + + + _menuSave + NSMenuItem + + + IBProjectSource ./Classes/AppDelegate.h @@ -941,11 +1607,33 @@ YES NSMenuCheckmark NSMenuMixedState + box + document-attribute-b + document-attribute-d + document-attribute-f + document-attribute-i + document-attribute-l + document-attribute-s + edit-code + edit-code-i + edit-list + edit-small-caps YES {11, 11} {10, 3} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} + {16, 16} diff --git a/Mac/MainWindow.cs b/Mac/MainWindow.cs index ff31d6e..996ae3d 100644 --- a/Mac/MainWindow.cs +++ b/Mac/MainWindow.cs @@ -7,6 +7,7 @@ using MonoMac.AppKit; using NBTExplorer.Mac; using System.IO; using NBTExplorer.Model; +using Substrate.Nbt; namespace NBTExplorer { @@ -31,8 +32,11 @@ namespace NBTExplorer void Initialize () { InitializeIconRegistry(); + FormHandlers.Register(); } + private AppDelegate _appDelegate; + private NBTExplorer.Mac.IconRegistry _iconRegistry; private void InitializeIconRegistry () @@ -57,6 +61,12 @@ namespace NBTExplorer _iconRegistry.Register(typeof(NbtFileDataNode), NSImage.ImageNamed("wooden-box.png")); _iconRegistry.Register(typeof(TagIntArrayDataNode), NSImage.ImageNamed("edit-code-i.png")); } + + public AppDelegate AppDelegate + { + get { return _appDelegate; } + set { _appDelegate = value; } + } #endregion @@ -162,7 +172,7 @@ namespace NBTExplorer OpenPaths(new string[] { opanel.DirectoryUrl.Path }); } - //UpdateUI(); + UpdateUI(); } private void OpenMinecraftDirectory () @@ -192,7 +202,7 @@ namespace NBTExplorer } } - //UpdateUI(); + UpdateUI(); } private void OpenPaths (string[] paths) @@ -217,7 +227,7 @@ namespace NBTExplorer _mainOutlineView.ReloadData(); - // UpdateUI(); + UpdateUI(); // UpdateOpenMenu(); /*_nodeTree.Nodes.Clear(); @@ -268,7 +278,7 @@ namespace NBTExplorer foreach (DataNode child in backNode.Nodes) { if (child != null) { - node.Nodes.Add (new TreeDataNode (child)); + node.AddNode (new TreeDataNode (child)); } } } @@ -297,6 +307,20 @@ namespace NBTExplorer EditNode(node); } + public void ActionRenameValue () + { + TreeDataNode node = _mainOutlineView.ItemAtRow(_mainOutlineView.SelectedRow) as TreeDataNode; + if (node != null) + RenameNode(node); + } + + public void ActionDeleteValue () + { + TreeDataNode node = _mainOutlineView.ItemAtRow(_mainOutlineView.SelectedRow) as TreeDataNode; + if (node != null) + DeleteNode(node); + } + private void EditNode (TreeDataNode node) { if (node == null) @@ -305,13 +329,86 @@ namespace NBTExplorer if (!node.Data.CanEditNode) return; - //NBTExplorer.Mac.EditValue form = new NBTExplorer.Mac.EditValue(node.Data); + if (node.Data.EditNode()) { + //node.Text = node.Data.NodeDisplay; + UpdateUI(node.Data); + } + } - - //if (node.Data.EditNode()) { + private void RenameNode (TreeDataNode node) + { + if (node == null) + return; + + if (!node.Data.CanRenameNode) + return; + + if (node.Data.RenameNode()) { //node.Text = dataNode.NodeDisplay; - //UpdateUI(dataNode); - //} + UpdateUI(node.Data); + } + } + + private void DeleteNode (TreeDataNode node) + { + if (node == null) + return; + + if (!node.Data.CanDeleteNode) + return; + + if (node.Data.DeleteNode()) { + UpdateUI(node.Parent.Data); + //UpdateNodeText(node.Parent); + TreeDataNode parent = node.Parent; + node.Remove(); + + _mainOutlineView.ReloadItem(parent, true); + } + } + + private void UpdateUI () + { + if (_appDelegate == null) + return; + + TreeDataNode selected = _mainOutlineView.ItemAtRow(_mainOutlineView.SelectedRow) as TreeDataNode; + if (selected != null) { + UpdateUI(selected.Data); + } + else { + //_appDelegate.MenuSave.Enabled = CheckModifications(); + _appDelegate.MenuFind.Enabled = false; + //_appDelegate.MenuFindNext.Enabled = _searchState != null; + } + } + + private void UpdateUI (DataNode node) + { + if (_appDelegate == null || node == null) + return; + + _appDelegate.MenuInsertByte.Enabled = node.CanCreateTag(TagType.TAG_BYTE); + _appDelegate.MenuInsertShort.Enabled = node.CanCreateTag(TagType.TAG_SHORT); + _appDelegate.MenuInsertInt.Enabled = node.CanCreateTag(TagType.TAG_INT); + _appDelegate.MenuInsertLong.Enabled = node.CanCreateTag(TagType.TAG_LONG); + _appDelegate.MenuInsertFloat.Enabled = node.CanCreateTag(TagType.TAG_FLOAT); + _appDelegate.MenuInsertDouble.Enabled = node.CanCreateTag(TagType.TAG_DOUBLE); + _appDelegate.MenuInsertByteArray.Enabled = node.CanCreateTag(TagType.TAG_BYTE_ARRAY); + _appDelegate.MenuInsertIntArray.Enabled = node.CanCreateTag(TagType.TAG_INT_ARRAY); + _appDelegate.MenuInsertString.Enabled = node.CanCreateTag(TagType.TAG_STRING); + _appDelegate.MenuInsertList.Enabled = node.CanCreateTag(TagType.TAG_LIST); + _appDelegate.MenuInsertCompound.Enabled = node.CanCreateTag(TagType.TAG_COMPOUND); + + //_appDelegate.MenuSave.Enabled = CheckModifications(); + _appDelegate.MenuCopy.Enabled = node.CanCopyNode; + _appDelegate.MenuCut.Enabled = node.CanCutNode; + _appDelegate.MenuPaste.Enabled = node.CanPasteIntoNode; + _appDelegate.MenuDelete.Enabled = node.CanDeleteNode; + _appDelegate.MenuEditValue.Enabled = node.CanEditNode; + _appDelegate.MenuRename.Enabled = node.CanRenameNode; + _appDelegate.MenuFind.Enabled = node.CanSearchNode; + //_appDelegate.MenuFindNext.Enabled = _searchState != null; } } } diff --git a/Mac/MainWindow.xib b/Mac/MainWindow.xib index 85a490d..3860231 100644 --- a/Mac/MainWindow.xib +++ b/Mac/MainWindow.xib @@ -270,7 +270,6 @@ 3 YES - YES @@ -337,7 +336,6 @@ {{1, 544}, {776, 15}} - _NS:60 NO 1 diff --git a/Mac/ModalResult.cs b/Mac/ModalResult.cs new file mode 100644 index 0000000..37a0e23 --- /dev/null +++ b/Mac/ModalResult.cs @@ -0,0 +1,12 @@ +using System; + +namespace NBTExplorer.Mac +{ + public enum ModalResult + { + Unknown = 0, + OK = 1, + Cancel = 2, + } +} + diff --git a/Mac/Scratch.cs b/Mac/Scratch.cs index 3313185..1ce0e99 100644 --- a/Mac/Scratch.cs +++ b/Mac/Scratch.cs @@ -6,6 +6,8 @@ namespace NBTExplorer.Mac.Test { // ... + + [Outlet] MonoMac.AppKit.NSOutlineView _mainOutlineView { get; set; } diff --git a/Mac/TreeDataNode.cs b/Mac/TreeDataNode.cs index 6349bf0..4f48e18 100644 --- a/Mac/TreeDataNode.cs +++ b/Mac/TreeDataNode.cs @@ -8,6 +8,7 @@ namespace NBTExplorer.Mac { public class TreeDataNode : NSObject { + private TreeDataNode _parent; private DataNode _dataNode; private List _children; private bool _expanded; @@ -39,11 +40,36 @@ namespace NBTExplorer.Mac set { _expanded = value; } } + public void Remove () + { + if (_parent != null) + _parent.RemoveNode(this); + } + + public TreeDataNode Parent + { + get { return _parent; } + } + public bool HasChildren { get { return _children.Count > 0 || _dataNode.HasUnexpandedChildren; } } + public void AddNode (TreeDataNode node) + { + node._parent = this; + _children.Add(node); + } + + public void RemoveNode (TreeDataNode node) + { + if (_children.Contains (node)) { + _children.Remove(node); + node._parent = null; + } + } + public List Nodes { get { return _children; } diff --git a/Model/FileTypeRegistry.cs b/Model/FileTypeRegistry.cs index 64e746b..c2d2cef 100644 --- a/Model/FileTypeRegistry.cs +++ b/Model/FileTypeRegistry.cs @@ -62,7 +62,7 @@ namespace NBTExplorer.Model }); } catch (Exception e) { - Program.StaticInitFailure(e); + //Program.StaticInitFailure(e); } } } diff --git a/NBTExplorer.sln b/NBTExplorer.sln index 78d48a1..b3475a7 100644 --- a/NBTExplorer.sln +++ b/NBTExplorer.sln @@ -46,7 +46,7 @@ Global {8A458245-8176-4599-95CD-3CA39F2435CE}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = NBTExplorer.csproj + StartupItem = NBTExplorerMac.csproj EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NBTExplorerMac.csproj b/NBTExplorerMac.csproj index 76bad5d..603f387 100644 --- a/NBTExplorerMac.csproj +++ b/NBTExplorerMac.csproj @@ -164,6 +164,19 @@ + + + + + + EditStringWindow.cs + + + + + + EditNameWindow.cs + @@ -190,22 +203,6 @@ - - - - - - - - - - - - - - - - @@ -217,10 +214,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/24/cross.png b/Resources/24/cross-24.png similarity index 100% rename from Resources/24/cross.png rename to Resources/24/cross-24.png diff --git a/Resources/24/document.png b/Resources/24/document-24.png similarity index 100% rename from Resources/24/document.png rename to Resources/24/document-24.png diff --git a/Resources/24/document-b.png b/Resources/24/document-b-24.png similarity index 100% rename from Resources/24/document-b.png rename to Resources/24/document-b-24.png diff --git a/Resources/24/document-d.png b/Resources/24/document-d-24.png similarity index 100% rename from Resources/24/document-d.png rename to Resources/24/document-d-24.png diff --git a/Resources/24/document-f.png b/Resources/24/document-f-24.png similarity index 100% rename from Resources/24/document-f.png rename to Resources/24/document-f-24.png diff --git a/Resources/24/document-i.png b/Resources/24/document-i-24.png similarity index 100% rename from Resources/24/document-i.png rename to Resources/24/document-i-24.png diff --git a/Resources/24/document-l.png b/Resources/24/document-l-24.png similarity index 100% rename from Resources/24/document-l.png rename to Resources/24/document-l-24.png diff --git a/Resources/24/document-s.png b/Resources/24/document-s-24.png similarity index 100% rename from Resources/24/document-s.png rename to Resources/24/document-s-24.png diff --git a/Resources/24/edit-code.png b/Resources/24/edit-code-24.png similarity index 100% rename from Resources/24/edit-code.png rename to Resources/24/edit-code-24.png diff --git a/Resources/24/edit-code-i.png b/Resources/24/edit-code-i-24.png similarity index 100% rename from Resources/24/edit-code-i.png rename to Resources/24/edit-code-i-24.png diff --git a/Resources/24/edit-list.png b/Resources/24/edit-list-24.png similarity index 100% rename from Resources/24/edit-list.png rename to Resources/24/edit-list-24.png diff --git a/Resources/24/edit-smallcaps.png b/Resources/24/edit-small-caps-24.png similarity index 100% rename from Resources/24/edit-smallcaps.png rename to Resources/24/edit-small-caps-24.png diff --git a/Resources/24/pencil.png b/Resources/24/pencil-24.png similarity index 100% rename from Resources/24/pencil.png rename to Resources/24/pencil-24.png diff --git a/Resources/24/scissors.png b/Resources/24/scissors-24.png similarity index 100% rename from Resources/24/scissors.png rename to Resources/24/scissors-24.png diff --git a/Resources/24/selection-input.png b/Resources/24/selection-input-24.png similarity index 100% rename from Resources/24/selection-input.png rename to Resources/24/selection-input-24.png