├── 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 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/86BoxManager.Common/CommonExecutor.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using _86BoxManager.API;
3 |
4 | namespace _86BoxManager.Common
5 | {
6 | public abstract class CommonExecutor : IExecutor
7 | {
8 | public virtual ProcessStartInfo BuildStartInfo(IExecVars args)
9 | {
10 | var info = new ProcessStartInfo(args.FileName);
11 | var ops = info.ArgumentList;
12 | if (!string.IsNullOrWhiteSpace(args.RomPath))
13 | {
14 | ops.Add("-R");
15 | ops.Add(args.RomPath);
16 | }
17 | if (!string.IsNullOrWhiteSpace(args.LogFile))
18 | {
19 | ops.Add("-L");
20 | ops.Add(args.LogFile);
21 | }
22 | ops.Add("-P");
23 | ops.Add(args.VmPath);
24 | ops.Add("-V");
25 | ops.Add(args.Vm.Name);
26 | return info;
27 | }
28 |
29 | public virtual ProcessStartInfo BuildConfigInfo(IExecVars args)
30 | {
31 | var info = new ProcessStartInfo(args.FileName);
32 | var ops = info.ArgumentList;
33 | ops.Add("--settings");
34 | ops.Add("-P");
35 | ops.Add(args.VmPath);
36 | return info;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/86BoxManager/App.axaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/86BoxManager.Gtk/86BoxManager.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | _86BoxManager
6 | 86Manager
7 |
8 | net6.0
9 | false
10 |
11 | Resources\86Box-gray.ico
12 |
13 |
14 |
15 |
16 |
17 | %(Filename)%(Extension)
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | Always
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/86BoxManager.Mac/MacManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using _86BoxManager.API;
5 | using _86BoxManager.Common;
6 | using _86BoxManager.Unix;
7 | using E = System.Environment;
8 |
9 | namespace _86BoxManager.Mac
10 | {
11 | public sealed class MacManager : UnixManager
12 | {
13 | public MacManager() : base(GetTmpDir()) { }
14 |
15 | public override IVerInfo GetBoxVersion(string exeDir)
16 | {
17 | var info = Path.Combine(exeDir, "..", "Info.plist");
18 | if (!File.Exists(info))
19 | {
20 | // Not found!
21 | return null;
22 | }
23 | var text = File.ReadAllText(info);
24 | var bip = text.Split("CFBundleVersion", 2);
25 | var bit = bip.Last().Split("", 2);
26 | var bi = bit.Last().Split("", 2).First();
27 | var bv = Version.Parse(bi);
28 | return new CommonVerInfo
29 | {
30 | FileMajorPart = bv.Major,
31 | FileMinorPart = bv.Minor,
32 | FileBuildPart = bv.Build,
33 | FilePrivatePart = bv.Revision
34 | };
35 | }
36 |
37 | public static string GetTmpDir() => E.GetEnvironmentVariable("TMPDIR");
38 | }
39 | }
--------------------------------------------------------------------------------
/86BoxManager.Linux/LinuxEnv.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using _86BoxManager.API;
4 |
5 | namespace _86BoxManager.Linux
6 | {
7 | public sealed class LinuxEnv : IEnv
8 | {
9 | public LinuxEnv()
10 | {
11 | MyComputer = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
12 | Desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
13 | UserProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
14 |
15 | var fakeDoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
16 | MyDocuments = Path.Combine(fakeDoc, "Documents");
17 |
18 | ExeNames = new[] { "86Box" };
19 | }
20 |
21 | public string[] ExeNames { get; }
22 | public string MyComputer { get; }
23 | public string UserProfile { get; }
24 | public string MyDocuments { get; }
25 | public string Desktop { get; }
26 |
27 | public string[] GetProgramFiles(string appName)
28 | {
29 | var folders = new[]
30 | {
31 | Path.Combine(UserProfile, "Portable", appName),
32 | Path.Combine("/opt", appName),
33 | "/usr/local/bin",
34 | "/usr/bin"
35 | };
36 | return folders;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/86BoxManager.Core/Xplat/Platforms.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using _86BoxManager.API;
4 | using _86BoxManager.Linux;
5 | using _86BoxManager.Mac;
6 | using _86BoxManager.Windows;
7 |
8 | namespace _86BoxManager.Xplat
9 | {
10 | public static class Platforms
11 | {
12 | public static readonly IShell Shell;
13 | public static readonly IManager Manager;
14 | public static readonly IEnv Env;
15 |
16 | static Platforms()
17 | {
18 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
19 | {
20 | Shell = new LinuxShell();
21 | Manager = new LinuxManager();
22 | Env = new LinuxEnv();
23 | return;
24 | }
25 |
26 | if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
27 | {
28 | Shell = new MacShell();
29 | Manager = new MacManager();
30 | Env = new MacEnv();
31 | return;
32 | }
33 |
34 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
35 | {
36 | Shell = new WinShell();
37 | Manager = new WinManager();
38 | Env = new WinEnv();
39 | return;
40 | }
41 |
42 | throw new InvalidOperationException("Not supported OS! Sorry!");
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/86BoxManager.Linux/LinuxManager.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Linq;
3 | using _86BoxManager.API;
4 | using _86BoxManager.Common;
5 | using _86BoxManager.Unix;
6 |
7 | namespace _86BoxManager.Linux
8 | {
9 | public sealed class LinuxManager : UnixManager
10 | {
11 | public LinuxManager() : base(GetTmpDir()) { }
12 |
13 | public override IVerInfo GetBoxVersion(string exeDir)
14 | {
15 | if (string.IsNullOrWhiteSpace(exeDir) || !Directory.Exists(exeDir))
16 | {
17 | // Not found!
18 | return null;
19 | }
20 | var info = new CommonVerInfo();
21 | var appImage = Directory.GetFiles(exeDir, "86Box-*.AppImage").FirstOrDefault();
22 | if (appImage != null)
23 | {
24 | var full = Path.GetFileNameWithoutExtension(appImage);
25 | var build = full.Split('-').LastOrDefault();
26 |
27 | // HACK: Set version because we can't read the ELF version
28 | if (build == "b4311")
29 | {
30 | info.FilePrivatePart = int.Parse(build.TrimStart('b'));
31 | info.FileMinorPart = 11;
32 | info.FileMajorPart = 3;
33 | info.FileBuildPart = 0;
34 | }
35 | }
36 | return info;
37 | }
38 |
39 | public static string GetTmpDir() => "/tmp";
40 | }
41 | }
--------------------------------------------------------------------------------
/86BoxManager.Windows/WinEnv.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using _86BoxManager.API;
4 |
5 | namespace _86BoxManager.Windows
6 | {
7 | public sealed class WinEnv : IEnv
8 | {
9 | public WinEnv()
10 | {
11 | MyComputer = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
12 | Desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
13 | UserProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
14 |
15 | MyDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
16 |
17 | ExeNames = new[] { "86Box.exe" };
18 | }
19 |
20 | public string[] ExeNames { get; }
21 | public string MyComputer { get; }
22 | public string UserProfile { get; }
23 | public string MyDocuments { get; }
24 | public string Desktop { get; }
25 |
26 | public string[] GetProgramFiles(string appName)
27 | {
28 | var folders = new[]
29 | {
30 | Path.Combine(UserProfile, "Portable", appName),
31 | Path.Combine("C:\\Portable", appName),
32 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), appName),
33 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), appName)
34 | };
35 | return folders;
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/86BoxManager/App.axaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using _86BoxManager.ViewModels;
3 | using _86BoxManager.Views;
4 | using Avalonia;
5 | using Avalonia.Controls.ApplicationLifetimes;
6 | using Avalonia.Markup.Xaml;
7 |
8 | namespace _86BoxManager
9 | {
10 | public partial class App : Application
11 | {
12 | public override void Initialize()
13 | {
14 | AvaloniaXamlLoader.Load(this);
15 | }
16 |
17 | public override void OnFrameworkInitializationCompleted()
18 | {
19 | if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
20 | {
21 | desktop.MainWindow = new frmMain
22 | {
23 | DataContext = new MainModel()
24 | };
25 | }
26 |
27 | base.OnFrameworkInitializationCompleted();
28 | }
29 |
30 | private void open86BoxManagerToolStripMenuItem_Click(object sender, EventArgs e)
31 | => Program.Root.open86BoxManagerToolStripMenuItem_Click(sender, e);
32 |
33 | private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
34 | => Program.Root.settingsToolStripMenuItem_Click(sender, e);
35 |
36 | private void exitToolStripMenuItem_Click(object sender, EventArgs e)
37 | => Program.Root.exitToolStripMenuItem_Click(sender, e);
38 |
39 | private void trayIcon_MouseClick(object sender, EventArgs e)
40 | => Program.Root.trayIcon_MouseClick(sender, e);
41 | }
42 | }
--------------------------------------------------------------------------------
/86BoxManager.Mac/MacEnv.cs:
--------------------------------------------------------------------------------
1 | using _86BoxManager.API;
2 | using System;
3 | using System.IO;
4 |
5 | namespace _86BoxManager.Mac
6 | {
7 | public sealed class MacEnv : IEnv
8 | {
9 | public MacEnv()
10 | {
11 | MyComputer = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
12 | Desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
13 | UserProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
14 |
15 | var fakeDoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
16 | MyDocuments = Path.Combine(fakeDoc, "Documents");
17 |
18 | ExeNames = new[] { "86Box" };
19 | }
20 |
21 | public string[] ExeNames { get; }
22 | public string MyComputer { get; }
23 | public string UserProfile { get; }
24 | public string MyDocuments { get; }
25 | public string Desktop { get; }
26 |
27 | public string[] GetProgramFiles(string a)
28 | {
29 | var folders = new[]
30 | {
31 | Path.Combine(UserProfile, "Portable", a, a + ".app", "Contents", "MacOS"),
32 | Path.Combine(UserProfile, "Applications", a + ".app", "Contents", "MacOS"),
33 | Path.Combine("/Applications", a + ".app", "Contents", "MacOS"),
34 | Path.Combine("/opt", a),
35 | "/usr/local/bin",
36 | "/usr/bin"
37 | };
38 | return folders;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/86BoxManager.Gtk/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("86Box Manager")]
8 | [assembly: AssemblyDescription("A configuration manager for 86Box emulator")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("David Simunič and others")]
11 | [assembly: AssemblyProduct("86Box Manager")]
12 | [assembly: AssemblyCopyright("Copyright © 2018-2023 David Simunič and others")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("559f81b9-d1a5-45fc-aa69-e98f3b3926bb")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 |
34 | [assembly: AssemblyVersion("1.7.6.0")]
35 | [assembly: AssemblyFileVersion("1.7.6.0")]
--------------------------------------------------------------------------------
/86BoxManager/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("86Box Manager")]
8 | [assembly: AssemblyDescription("A configuration manager for 86Box emulator")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("David Simunič and others")]
11 | [assembly: AssemblyProduct("86Box Manager")]
12 | [assembly: AssemblyCopyright("Copyright © 2018-2023 David Simunič and others")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("559f81b9-d1a5-45fc-aa69-e98f3b3926bb")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 |
34 | [assembly: AssemblyVersion("1.7.6.0")]
35 | [assembly: AssemblyFileVersion("1.7.6.0")]
--------------------------------------------------------------------------------
/86BoxManager/Views/dlgCloneVM.axaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/86BoxManager/Tools/Compat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Avalonia;
3 | using Avalonia.Controls;
4 | using Avalonia.Controls.Primitives;
5 | using Avalonia.Input;
6 | using Avalonia.Media;
7 |
8 | namespace _86BoxManager.Tools
9 | {
10 | public static class Compat
11 | {
12 | public static bool IsActive(this ToggleButton toggle)
13 | => toggle.IsChecked == true;
14 |
15 | public static bool IsEditable(this TextBox box, bool value)
16 | {
17 | box.IsReadOnly = !value;
18 | return value;
19 | }
20 |
21 | public static void Iconify(this Window window)
22 | {
23 | window.WindowState = WindowState.Minimized;
24 | }
25 |
26 | public static void EnableGridLines(this DataGrid view, bool value)
27 | {
28 | view.GridLinesVisibility = value
29 | ? DataGridGridLinesVisibility.All
30 | : DataGridGridLinesVisibility.None;
31 | }
32 |
33 | public static void SetColorTxt(this ContentControl label, ISolidColorBrush color,
34 | FontWeight weight, string text)
35 | {
36 | label.Foreground = color;
37 | label.FontWeight = weight;
38 | label.Content = text;
39 | }
40 |
41 | public static void OnTextChanged(this TextBox txtBox, Action