├── 86BoxManager ├── Assets │ ├── 86Box-gray.ico │ ├── 86Box-gray.png │ ├── 86Box-gray.ma.png │ └── 86Box-gray.sm.png ├── Resources │ ├── vm-paused.png │ ├── vm-running.png │ ├── vm-stopped.png │ └── vm-waiting.png ├── app.manifest ├── Tools │ ├── ToolTips.cs │ ├── Trays.cs │ ├── Resources.cs │ ├── Lifetimes.cs │ ├── Compat.cs │ └── Dialogs.cs ├── ViewModels │ ├── MainModel.cs │ └── VMRow.cs ├── Views │ ├── dlgEditVM.axaml │ ├── dlgCloneVM.axaml │ ├── dlgAddVM.axaml │ ├── dlgEditVM.axaml.cs │ ├── dlgCloneVM.axaml.cs │ ├── dlgAddVM.axaml.cs │ ├── frmMain.axaml │ └── dlgSettings.axaml ├── App.axaml ├── App.axaml.cs ├── Properties │ └── AssemblyInfo.cs ├── Models │ └── Cache.cs ├── 86BoxManager.csproj ├── Program.cs └── Core │ └── VMWatch.cs ├── 86BoxManager.Gtk ├── Resources │ ├── 86Box-gray.ico │ ├── 86Box-gray.png │ ├── vm-paused.png │ ├── vm-running.png │ ├── vm-stopped.png │ ├── vm-waiting.png │ ├── 86Box-gray.ma.png │ └── 86Box-gray.sm.png ├── Tools │ ├── Trays.cs │ ├── ToolTips.cs │ ├── Resources.cs │ └── Dialogs.cs ├── View │ ├── dlgEditVM.Designer.cs │ ├── dlgCloneVM.Designer.cs │ ├── dlgAddVM.Designer.cs │ ├── dlgSettings.Designer.cs │ ├── dlgEditVM.cs │ ├── dlgCloneVM.cs │ ├── dlgAddVM.cs │ ├── frmMain.Designer.cs │ ├── dlgEditVM.glade │ ├── dlgCloneVM.glade │ └── dlgAddVM.glade ├── 86BoxManager.Gtk.csproj ├── Properties │ └── AssemblyInfo.cs ├── Model │ ├── VMRow.cs │ └── Cache.cs ├── Program.cs └── Core │ └── VMWatch.cs ├── 86BoxManager.Windows ├── lib │ └── Interop.IWshRuntimeLibrary.dll ├── 86BoxManager.Windows.csproj ├── Internal │ ├── WinVerInfo.cs │ ├── WinExecutor.cs │ ├── Win32Imports.cs │ └── WinLoop.cs ├── WinShell.cs ├── WinEnv.cs └── WinManager.cs ├── 86BoxManager.Core ├── Model │ ├── SortType.cs │ └── VM.cs ├── Registry │ ├── ValueKind.cs │ ├── Settings.cs │ ├── ConfigKey.cs │ └── Configs.cs ├── 86BoxManager.Core.csproj ├── Core │ └── Serializer.cs └── Xplat │ ├── CurrentApp.cs │ ├── Search.cs │ └── Platforms.cs ├── 86BoxManager.API ├── IMessageLoop.cs ├── 86BoxManager.API.csproj ├── IExecutor.cs ├── IVerInfo.cs ├── IExecVars.cs ├── IEnv.cs ├── IShell.cs ├── IMessageReceiver.cs ├── IMessageSender.cs ├── IManager.cs └── IVm.cs ├── .github ├── ISSUE_TEMPLATE │ ├── question-or-other.md │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── dotnet.yml ├── AUTHORS ├── 86BoxManager.Mac ├── 86BoxManager.Mac.csproj ├── MacShell.cs ├── MacManager.cs └── MacEnv.cs ├── 86BoxManager.Common ├── 86BoxManager.Common.csproj ├── CommonVerInfo.cs ├── CommonExecVars.cs ├── CommonShell.cs ├── CommonExecutor.cs └── CommonManager.cs ├── 86BoxManager.Linux ├── 86BoxManager.Linux.csproj ├── LinuxShell.cs ├── LinuxEnv.cs └── LinuxManager.cs ├── 86BoxManager.Unix ├── 86BoxManager.Unix.csproj ├── UnixManager.cs ├── UnixExecutor.cs └── UnixLoop.cs ├── LICENSE ├── README.md ├── .gitignore └── 86BoxManager.sln /86BoxManager/Assets/86Box-gray.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Assets/86Box-gray.ico -------------------------------------------------------------------------------- /86BoxManager/Assets/86Box-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Assets/86Box-gray.png -------------------------------------------------------------------------------- /86BoxManager/Resources/vm-paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Resources/vm-paused.png -------------------------------------------------------------------------------- /86BoxManager/Assets/86Box-gray.ma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Assets/86Box-gray.ma.png -------------------------------------------------------------------------------- /86BoxManager/Assets/86Box-gray.sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Assets/86Box-gray.sm.png -------------------------------------------------------------------------------- /86BoxManager/Resources/vm-running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Resources/vm-running.png -------------------------------------------------------------------------------- /86BoxManager/Resources/vm-stopped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Resources/vm-stopped.png -------------------------------------------------------------------------------- /86BoxManager/Resources/vm-waiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager/Resources/vm-waiting.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/86Box-gray.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/86Box-gray.ico -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/86Box-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/86Box-gray.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/vm-paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/vm-paused.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/vm-running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/vm-running.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/vm-stopped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/vm-stopped.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/vm-waiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/vm-waiting.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/86Box-gray.ma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/86Box-gray.ma.png -------------------------------------------------------------------------------- /86BoxManager.Gtk/Resources/86Box-gray.sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Gtk/Resources/86Box-gray.sm.png -------------------------------------------------------------------------------- /86BoxManager.Windows/lib/Interop.IWshRuntimeLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RetBox/86BoxManagerX/HEAD/86BoxManager.Windows/lib/Interop.IWshRuntimeLibrary.dll -------------------------------------------------------------------------------- /86BoxManager.Core/Model/SortType.cs: -------------------------------------------------------------------------------- 1 | namespace _86BoxManager.Models 2 | { 3 | public enum SortType 4 | { 5 | Ascending = 0, 6 | 7 | Descending 8 | } 9 | } -------------------------------------------------------------------------------- /86BoxManager.API/IMessageLoop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IMessageLoop 6 | { 7 | IntPtr GetHandle(); 8 | } 9 | } -------------------------------------------------------------------------------- /86BoxManager.API/86BoxManager.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.API 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /86BoxManager.Core/Registry/ValueKind.cs: -------------------------------------------------------------------------------- 1 | namespace _86BoxManager.Registry 2 | { 3 | public enum ValueKind 4 | { 5 | Unknown = 0, 6 | 7 | DWord, 8 | 9 | String, 10 | 11 | Binary 12 | } 13 | } -------------------------------------------------------------------------------- /86BoxManager.API/IExecutor.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IExecutor 6 | { 7 | ProcessStartInfo BuildStartInfo(IExecVars args); 8 | 9 | ProcessStartInfo BuildConfigInfo(IExecVars args); 10 | } 11 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question-or-other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question or other 3 | about: Use this template only for questions or other kinds of issues. Do NOT use for 4 | bug reports or feature requests. 5 | title: '' 6 | labels: '' 7 | assignees: daviunic 8 | 9 | --- 10 | 11 | Ask away. 12 | -------------------------------------------------------------------------------- /86BoxManager.API/IVerInfo.cs: -------------------------------------------------------------------------------- 1 | namespace _86BoxManager.API 2 | { 3 | public interface IVerInfo 4 | { 5 | int FilePrivatePart { get; } 6 | 7 | int FileMajorPart { get; } 8 | 9 | int FileMinorPart { get; } 10 | 11 | int FileBuildPart { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The following individuals or organizations have contributed at least some code to the 86Box Manager project: 2 | 3 | David Simunič (@daviunic) 4 | David Lee (@DL444) 5 | FolderSelectDialog class by ErikE from stackOverflow 6 | David Hrdlička (@dhrdlicka) 7 | Teemu Korhonen (@ts-korhonen) 8 | Port by @xafero 9 | -------------------------------------------------------------------------------- /86BoxManager.API/IExecVars.cs: -------------------------------------------------------------------------------- 1 | namespace _86BoxManager.API 2 | { 3 | public interface IExecVars 4 | { 5 | string FileName { get; } 6 | 7 | string RomPath { get; } 8 | 9 | string LogFile { get; } 10 | 11 | string VmPath { get; } 12 | 13 | IVm Vm { get; } 14 | 15 | (string id, string hWnd)? Handle { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /86BoxManager.Mac/86BoxManager.Mac.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.Mac 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /86BoxManager.API/IEnv.cs: -------------------------------------------------------------------------------- 1 | namespace _86BoxManager.API 2 | { 3 | public interface IEnv 4 | { 5 | string MyComputer { get; } 6 | 7 | string UserProfile { get; } 8 | 9 | string[] ExeNames { get; } 10 | 11 | string MyDocuments { get; } 12 | 13 | string Desktop { get; } 14 | 15 | string[] GetProgramFiles(string appName); 16 | } 17 | } -------------------------------------------------------------------------------- /86BoxManager.Common/86BoxManager.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.Common 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /86BoxManager.Linux/86BoxManager.Linux.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.Linux 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /86BoxManager.Common/CommonVerInfo.cs: -------------------------------------------------------------------------------- 1 | using _86BoxManager.API; 2 | 3 | namespace _86BoxManager.Common 4 | { 5 | public sealed class CommonVerInfo : IVerInfo 6 | { 7 | public int FilePrivatePart { get; set; } 8 | 9 | public int FileMajorPart { get; set; } 10 | 11 | public int FileMinorPart { get; set; } 12 | 13 | public int FileBuildPart { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /86BoxManager.API/IShell.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IShell 6 | { 7 | void CreateShortcut(string address, string name, string desc, string startup); 8 | 9 | void PushToForeground(IntPtr window); 10 | 11 | void PrepareAppId(string appId); 12 | 13 | void OpenFolder(string folder); 14 | 15 | void EditFile(string file); 16 | } 17 | } -------------------------------------------------------------------------------- /86BoxManager/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /86BoxManager/Tools/ToolTips.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | 3 | namespace _86BoxManager.Tools 4 | { 5 | public static class ToolTips 6 | { 7 | public static void SetToolTip(this Control widget, string text) 8 | { 9 | ToolTip.SetTip(widget, text); 10 | } 11 | 12 | public static void UnsetToolTip(this Control widget) 13 | { 14 | ToolTip.SetTip(widget, null); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /86BoxManager.Gtk/Tools/Trays.cs: -------------------------------------------------------------------------------- 1 | using Gdk; 2 | using Gtk; 3 | 4 | #pragma warning disable CS0612 5 | 6 | namespace _86BoxManager.Tools 7 | { 8 | public static class Trays 9 | { 10 | public static void ApplyIcon(this StatusIcon trayIcon, Pixbuf pix) 11 | { 12 | trayIcon.Icon = pix; 13 | } 14 | 15 | public static void MakeVisible(this StatusIcon trayIcon, bool value) 16 | { 17 | trayIcon.Visible = value; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /86BoxManager/Tools/Trays.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Media.Imaging; 3 | 4 | namespace _86BoxManager.Tools 5 | { 6 | public static class Trays 7 | { 8 | public static void ApplyIcon(this TrayIcon trayIcon, Bitmap pix) 9 | { 10 | trayIcon.Icon = new WindowIcon(pix); 11 | } 12 | 13 | public static void MakeVisible(this TrayIcon trayIcon, bool value) 14 | { 15 | trayIcon.IsVisible = value; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /86BoxManager.API/IMessageReceiver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IMessageReceiver 6 | { 7 | void OnEmulatorInit(IntPtr hWnd, uint vmId); 8 | void OnEmulatorShutdown(IntPtr hWnd); 9 | 10 | void OnVmPaused(IntPtr hWnd); 11 | void OnVmResumed(IntPtr hWnd); 12 | 13 | void OnDialogOpened(IntPtr hWnd); 14 | void OnDialogClosed(IntPtr hWnd); 15 | 16 | void OnManagerStartVm(string vmName); 17 | } 18 | } -------------------------------------------------------------------------------- /86BoxManager.Common/CommonExecVars.cs: -------------------------------------------------------------------------------- 1 | using _86BoxManager.API; 2 | 3 | namespace _86BoxManager.Common 4 | { 5 | public sealed class CommonExecVars : IExecVars 6 | { 7 | public string FileName { get; set; } 8 | 9 | public string RomPath { get; set; } 10 | 11 | public string LogFile { get; set; } 12 | 13 | public string VmPath { get; set; } 14 | 15 | public IVm Vm { get; set; } 16 | 17 | public (string id, string hWnd)? Handle { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /86BoxManager.Unix/86BoxManager.Unix.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.Unix 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /86BoxManager.API/IMessageSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IMessageSender 6 | { 7 | void DoVmRequestStop(IVm vm); 8 | void DoVmForceStop(IVm vm); 9 | 10 | void DoVmPause(IVm vm); 11 | void DoVmResume(IVm vm); 12 | 13 | void DoVmCtrlAltDel(IVm vm); 14 | void DoVmHardReset(IVm vm); 15 | 16 | void DoVmConfigure(IVm vm); 17 | 18 | void DoManagerStartVm(IntPtr hWnd, string vmName); 19 | } 20 | } -------------------------------------------------------------------------------- /86BoxManager.API/IManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _86BoxManager.API 4 | { 5 | public interface IManager 6 | { 7 | bool IsFirstInstance(string name); 8 | 9 | IntPtr RestoreAndFocus(string title, string handleTitle); 10 | 11 | bool IsProcessRunning(string name); 12 | 13 | IVerInfo GetBoxVersion(string exeDir); 14 | 15 | IMessageLoop GetLoop(IMessageReceiver callback); 16 | 17 | IMessageSender GetSender(); 18 | 19 | IExecutor GetExecutor(); 20 | } 21 | } -------------------------------------------------------------------------------- /86BoxManager.Gtk/Tools/ToolTips.cs: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | 3 | namespace _86BoxManager.Tools 4 | { 5 | public static class ToolTips 6 | { 7 | public static void SetToolTip(this Widget widget, string text) 8 | { 9 | widget.TooltipText = text; 10 | widget.HasTooltip = true; 11 | } 12 | 13 | public static void UnsetToolTip(this Widget widget) 14 | { 15 | widget.TooltipText = string.Empty; 16 | widget.HasTooltip = false; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /86BoxManager.Windows/86BoxManager.Windows.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager.Windows 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | lib\Interop.IWshRuntimeLibrary.dll 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /86BoxManager/ViewModels/MainModel.cs: -------------------------------------------------------------------------------- 1 | using ReactiveUI; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace _86BoxManager.ViewModels 5 | { 6 | internal class MainModel : ReactiveObject 7 | { 8 | public ObservableCollection Machines { get; } = new(); 9 | 10 | private string _vmCount = "# of virtual machines:"; 11 | 12 | public string VmCount 13 | { 14 | get => _vmCount; 15 | set 16 | { 17 | _vmCount = value; 18 | this.RaisePropertyChanged(); 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /86BoxManager.API/IVm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | // ReSharper disable InconsistentNaming 4 | 5 | namespace _86BoxManager.API 6 | { 7 | public interface IVm 8 | { 9 | /// 10 | /// Name of the virtual machine 11 | /// 12 | string Name { get; } 13 | 14 | /// 15 | /// Window handle for the VM once it's started 16 | /// 17 | IntPtr hWnd { get; } 18 | 19 | /// 20 | /// Callback to invoke when VM is gone 21 | /// 22 | Action OnExit { set; } 23 | } 24 | } -------------------------------------------------------------------------------- /86BoxManager.Core/86BoxManager.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | _86BoxManager 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /86BoxManager.Gtk/View/dlgEditVM.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using _86BoxManager.Tools; 3 | using Gtk; 4 | using UI = Gtk.Builder.ObjectAttribute; 5 | using IOPath = System.IO.Path; 6 | 7 | namespace _86BoxManager.View 8 | { 9 | partial class dlgEditVM 10 | { 11 | private void InitializeComponent() 12 | { 13 | Shown += dlgEditVM_Load; 14 | txtName.Changed += txtName_TextChanged; 15 | btnApply.Clicked += btnApply_Click; 16 | } 17 | 18 | [UI] private Entry txtName = null; 19 | [UI] private Entry txtDesc = null; 20 | [UI] private Label lblPath1 = null; 21 | [UI] private Button btnApply = null; 22 | } 23 | } -------------------------------------------------------------------------------- /86BoxManager.Windows/Internal/WinVerInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using _86BoxManager.API; 3 | 4 | namespace _86BoxManager.Windows.Internal 5 | { 6 | internal sealed class WinVerInfo : IVerInfo 7 | { 8 | private readonly FileVersionInfo _info; 9 | 10 | public WinVerInfo(FileVersionInfo info) 11 | { 12 | _info = info; 13 | } 14 | 15 | public int FilePrivatePart => _info.FilePrivatePart; 16 | public int FileMajorPart => _info.FileMajorPart; 17 | public int FileMinorPart => _info.FileMinorPart; 18 | public int FileBuildPart => _info.FileBuildPart; 19 | 20 | public override string ToString() => _info.ToString(); 21 | } 22 | } -------------------------------------------------------------------------------- /86BoxManager.Windows/Internal/WinExecutor.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using _86BoxManager.API; 3 | using _86BoxManager.Common; 4 | 5 | namespace _86BoxManager.Windows.Internal 6 | { 7 | internal sealed class WinExecutor : CommonExecutor 8 | { 9 | public override ProcessStartInfo BuildStartInfo(IExecVars args) 10 | { 11 | var info = base.BuildStartInfo(args); 12 | var ops = info.ArgumentList; 13 | if (args.Handle != null) 14 | { 15 | ops.Add("--hwnd"); 16 | var (idString, hWndHex) = args.Handle.Value; 17 | ops.Add($"{idString},{hWndHex}"); 18 | } 19 | return info; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Use this template only for feature requests. 4 | title: "[Feature]" 5 | labels: enhancement 6 | assignees: daviunic 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /86BoxManager/Tools/Resources.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Avalonia.Media.Imaging; 3 | 4 | namespace _86BoxManager.Tools 5 | { 6 | internal static class Resources 7 | { 8 | public static Bitmap LoadImage(Stream stream) 9 | { 10 | var bitmap = new Bitmap(stream); 11 | return bitmap; 12 | } 13 | 14 | public static Stream FindResource(string path) 15 | { 16 | const string n = $".{nameof(Resources)}"; 17 | var type = typeof(Program); 18 | var dll = type.Assembly; 19 | var prefix = type.FullName?.Replace(".Program", n); 20 | var fullName = prefix + path.Replace('/', '.'); 21 | var resource = dll.GetManifestResourceStream(fullName); 22 | return resource; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /86BoxManager/Tools/Lifetimes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Avalonia.Controls.ApplicationLifetimes; 3 | using Avalonia.Controls; 4 | 5 | namespace _86BoxManager.Tools 6 | { 7 | internal static class Lifetimes 8 | { 9 | public static (T builder, Func after) SetupWithClassicDesktopLifetime( 10 | this T builder, string[] args, ShutdownMode shutdownMode = ShutdownMode.OnLastWindowClose) 11 | where T : AppBuilderBase, new() 12 | { 13 | var lifetime = new ClassicDesktopStyleApplicationLifetime 14 | { 15 | Args = args, 16 | ShutdownMode = shutdownMode 17 | }; 18 | builder.SetupWithLifetime(lifetime); 19 | int After() => lifetime.Start(args); 20 | return (builder, After); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /86BoxManager.Gtk/View/dlgCloneVM.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using _86BoxManager.Tools; 3 | using Gtk; 4 | using UI = Gtk.Builder.ObjectAttribute; 5 | using IOPath = System.IO.Path; 6 | 7 | namespace _86BoxManager.View 8 | { 9 | partial class dlgCloneVM 10 | { 11 | private void InitializeComponent() 12 | { 13 | Shown += dlgCloneVM_Load; 14 | txtName.Changed += txtName_TextChanged; 15 | btnClone.Clicked += btnClone_Click; 16 | } 17 | 18 | [UI] private Label lblPath1 = null; 19 | [UI] private Label lblOldVM = null; 20 | [UI] private Entry txtName = null; 21 | [UI] private Entry txtDescription = null; 22 | [UI] private Button btnClone = null; 23 | [UI] private CheckButton cbxOpenCFG = null; 24 | [UI] private CheckButton cbxStartVM = null; 25 | } 26 | } -------------------------------------------------------------------------------- /86BoxManager.Core/Core/Serializer.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Runtime.Serialization.Formatters.Binary; 3 | 4 | #pragma warning disable SYSLIB0011 5 | 6 | namespace _86BoxManager.Core 7 | { 8 | public static class Serializer 9 | { 10 | private static readonly BinaryFormatter Bf = new(); 11 | 12 | public static T Read(byte[] array) 13 | { 14 | using var ms = new MemoryStream(array); 15 | var res = (T)Bf.Deserialize(ms); 16 | ms.Close(); 17 | return res; 18 | } 19 | 20 | public static byte[] Write(object obj) 21 | { 22 | using var ms = new MemoryStream(); 23 | var formatter = new BinaryFormatter(); 24 | formatter.Serialize(ms, obj); 25 | var data = ms.ToArray(); 26 | return data; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /86BoxManager.Unix/UnixManager.cs: -------------------------------------------------------------------------------- 1 | using _86BoxManager.API; 2 | using _86BoxManager.Common; 3 | 4 | namespace _86BoxManager.Unix 5 | { 6 | public abstract class UnixManager : CommonManager 7 | { 8 | private readonly UnixExecutor _exec; 9 | 10 | protected UnixManager(string tempDir) 11 | { 12 | _exec = new UnixExecutor(tempDir); 13 | } 14 | 15 | public override IMessageLoop GetLoop(IMessageReceiver callback) 16 | { 17 | var loop = new UnixLoop(callback, _exec); 18 | return loop; 19 | } 20 | 21 | public override IMessageSender GetSender() 22 | { 23 | var loop = new UnixLoop(null, _exec); 24 | return loop; 25 | } 26 | 27 | public override IExecutor GetExecutor() 28 | { 29 | return _exec; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /86BoxManager.Gtk/Tools/Resources.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Gdk; 3 | 4 | namespace _86BoxManager.Tools 5 | { 6 | internal static class Resources 7 | { 8 | public static Pixbuf LoadImage(Stream stream, int? size = null) 9 | { 10 | var res = new Pixbuf(stream); 11 | if (size == null) 12 | return res; 13 | 14 | var px = size.Value; 15 | return res.ScaleSimple(px, px, InterpType.Bilinear); 16 | } 17 | 18 | public static Stream FindResource(string path) 19 | { 20 | const string n = $".{nameof(Resources)}"; 21 | var type = typeof(Program); 22 | var dll = type.Assembly; 23 | var prefix = type.FullName?.Replace(".Program", n); 24 | var fullName = prefix + path.Replace('/', '.'); 25 | var resource = dll.GetManifestResourceStream(fullName); 26 | return resource; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /86BoxManager.Core/Xplat/CurrentApp.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Reflection; 3 | 4 | namespace _86BoxManager.Xplat 5 | { 6 | public static class CurrentApp 7 | { 8 | public static string ProductVersion { get; } = ReadVersion(); 9 | 10 | public static string StartupPath { get; } = ReadStartup(); 11 | 12 | private static Assembly GetEntryAss() 13 | { 14 | return Assembly.GetEntryAssembly() ?? typeof(CurrentApp).Assembly; 15 | } 16 | 17 | private static string ReadStartup() 18 | { 19 | var ass = GetEntryAss(); 20 | var path = Path.GetFullPath(ass.Location); 21 | var dir = Path.GetDirectoryName(path); 22 | return dir; 23 | } 24 | 25 | private static string ReadVersion() 26 | { 27 | var ass = GetEntryAss(); 28 | var ver = ass.GetName().Version; 29 | return ver?.ToString(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /86BoxManager.Core/Xplat/Search.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace _86BoxManager.Xplat 4 | { 5 | public static class Search 6 | { 7 | public static string Find(string[] folders, string[] exeNames) 8 | { 9 | foreach (var folder in folders) 10 | foreach (var exeName in exeNames) 11 | { 12 | var exePath = Path.Combine(folder, exeName); 13 | if (!File.Exists(exePath)) 14 | continue; 15 | return folder; 16 | } 17 | return null; 18 | } 19 | 20 | public static string CheckTrail(this string path) 21 | { 22 | //To make sure there's a trailing backslash at the end, as other code using these strings expects it! 23 | if (!path.EndsWith(Path.DirectorySeparatorChar)) 24 | { 25 | path += Path.DirectorySeparatorChar; 26 | } 27 | return path; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Use this template only for bug reports. 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: daviunic 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment (please complete the following information):** 27 | - Host OS: [e.g. WIndows 10 version 2004] 28 | - 86Box build number and type [e.g. 2529 regular, 2515 dev, etc.] 29 | - 86Box Manager Version [e.g. 1.7.1] 30 | - VM config file (86box.cfg) if applicable 31 | - VM name and full path if applicable 32 | 33 | **Additional context** 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /86BoxManager.Common/CommonShell.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using _86BoxManager.API; 4 | 5 | namespace _86BoxManager.Common 6 | { 7 | public abstract class CommonShell : IShell 8 | { 9 | public abstract void CreateShortcut(string address, string name, string desc, string startup); 10 | 11 | public virtual void PushToForeground(IntPtr window) 12 | { 13 | // NO-OP 14 | } 15 | 16 | public virtual void PrepareAppId(string appId) 17 | { 18 | // NO-OP 19 | } 20 | 21 | public virtual void OpenFolder(string folder) 22 | { 23 | Process.Start(new ProcessStartInfo(folder) 24 | { 25 | UseShellExecute = true 26 | }); 27 | } 28 | 29 | public virtual void EditFile(string file) 30 | { 31 | Process.Start(new ProcessStartInfo(file) 32 | { 33 | UseShellExecute = true 34 | }); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | tags: [ "v*" ] 7 | pull_request: 8 | branches: [ "master" ] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v3 18 | 19 | - name: Setup .NET 20 | uses: actions/setup-dotnet@v3 21 | with: 22 | dotnet-version: 6.0.x 23 | 24 | - name: Restore dependencies 25 | run: dotnet restore 26 | 27 | - name: Build 28 | run: dotnet build --no-restore 29 | 30 | - name: Test 31 | run: dotnet test --no-build --verbosity normal 32 | 33 | - name: Publish 34 | if: startsWith(github.ref, 'refs/tags/') 35 | run: | 36 | sudo apt-get install -y zip 37 | ./build.sh 38 | 39 | - name: Release 40 | uses: softprops/action-gh-release@v1 41 | if: startsWith(github.ref, 'refs/tags/') 42 | with: 43 | files: pub/*.* 44 | -------------------------------------------------------------------------------- /86BoxManager.Gtk/View/dlgAddVM.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using _86BoxManager.Tools; 3 | using Gtk; 4 | using UI = Gtk.Builder.ObjectAttribute; 5 | using IOPath = System.IO.Path; 6 | 7 | namespace _86BoxManager.View 8 | { 9 | partial class dlgAddVM 10 | { 11 | private void InitializeComponent() 12 | { 13 | Shown += dlgAddVM_Load; 14 | cbxImport.Toggled += cbxImport_CheckedChanged; 15 | btnBrowse.Clicked += btnBrowse_Click; 16 | txtName.Changed += txtName_TextChanged; 17 | btnAdd.Clicked += btnAdd_Click; 18 | } 19 | 20 | [UI] private Label lblPath1 = null; 21 | [UI] private Entry txtName = null; 22 | [UI] private Entry txtDescription = null; 23 | [UI] private Entry txtImportPath = null; 24 | [UI] private CheckButton cbxOpenCFG = null; 25 | [UI] private CheckButton cbxStartVM = null; 26 | [UI] private CheckButton cbxImport = null; 27 | [UI] private Button btnBrowse = null; 28 | [UI] private Button btnAdd = null; 29 | } 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2022 David Simunič 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /86BoxManager.Mac/MacShell.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.IO; 3 | using System.Text; 4 | using _86BoxManager.Common; 5 | 6 | namespace _86BoxManager.Mac 7 | { 8 | public sealed class MacShell : CommonShell 9 | { 10 | public override void CreateShortcut(string address, string name, string desc, string startup) 11 | { 12 | var fileName = address.Replace(".lnk", ".sh"); 13 | var myExe = Path.Combine(startup, "86Manager"); 14 | var lines = new[] 15 | { 16 | "#!/bin/sh", 17 | @$"echo ""Name : {name}""", 18 | @$"echo ""Comment : {desc}""", 19 | @$"""{myExe}"" -S ""{name}"" &" 20 | }; 21 | var bom = new UTF8Encoding(false); 22 | File.WriteAllLines(fileName, lines, bom); 23 | Process.Start(new ProcessStartInfo("chmod", @$"+x ""{fileName}""")); 24 | } 25 | 26 | public override void OpenFolder(string folder) 27 | { 28 | var start = new ProcessStartInfo("open"); 29 | start.ArgumentList.Add(folder); 30 | Process.Start(start); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /86BoxManager.Linux/LinuxShell.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Text; 3 | using _86BoxManager.Common; 4 | 5 | namespace _86BoxManager.Linux 6 | { 7 | public sealed class LinuxShell : CommonShell 8 | { 9 | public override void CreateShortcut(string address, string name, string desc, string startup) 10 | { 11 | var fileName = address.Replace(".lnk", ".desktop"); 12 | var myExe = Path.Combine(startup, "86Manager"); 13 | var myIcon = Path.Combine(startup, "Resources", "86Box-gray.svg"); 14 | var lines = new[] 15 | { 16 | "[Desktop Entry]", 17 | "Version=1.0", 18 | "Type=Application", 19 | $"Name={name}", 20 | @$"Exec=""{myExe}"" -S ""{name}""", 21 | $"Icon={myIcon}", 22 | $"Comment={desc}", 23 | "Terminal=false", 24 | "Categories=Game;Emulator;", 25 | "StartupWMClass=86box-vm", 26 | "StartupNotify=true" 27 | }; 28 | var bom = new UTF8Encoding(false); 29 | File.WriteAllLines(fileName, lines, bom); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /86BoxManager.Windows/WinShell.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using _86BoxManager.Common; 4 | using IWshRuntimeLibrary; 5 | using static _86BoxManager.Windows.Internal.Win32Imports; 6 | 7 | namespace _86BoxManager.Windows 8 | { 9 | public sealed class WinShell : CommonShell 10 | { 11 | public override void CreateShortcut(string address, string name, string desc, string startup) 12 | { 13 | dynamic shell = new WshShell(); 14 | dynamic shortcut = (IWshShortcut)shell.CreateShortcut(address); 15 | shortcut.Description = desc; 16 | shortcut.IconLocation = $"{Path.Combine(startup, "86manager.exe")},0"; 17 | shortcut.TargetPath = Path.Combine(startup, "86manager.exe"); 18 | shortcut.Arguments = $@"-S ""{name}"""; 19 | shortcut.Save(); 20 | } 21 | 22 | public override void PushToForeground(IntPtr hWnd) 23 | { 24 | SetForegroundWindow(hWnd); 25 | } 26 | 27 | public override void PrepareAppId(string appId) 28 | { 29 | if (Environment.OSVersion.Version.Major >= 6) 30 | SetProcessDPIAware(); 31 | 32 | SetCurrentProcessExplicitAppUserModelID(appId); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /86BoxManager/Views/dlgEditVM.axaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |