From 265c34a5cc5f7f77d722d29f2a6c1fb5d18a3968 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Sat, 21 Oct 2023 01:46:05 -0400 Subject: [PATCH] ISelfController --- .../Am/Ipc/Controllers/SelfController.cs | 248 ++++++++++++++++++ .../Am/Ipc/Proxies/ApplicationProxy.cs | 13 +- .../Am/Ipc/Proxies/LibraryAppletProxy.cs | 13 +- .../Am/Ipc/Proxies/OverlayAppletProxy.cs | 13 +- .../Am/Ipc/Proxies/SystemAppletProxy.cs | 8 +- .../Sdk/Am/IApplicationProxy.cs | 4 +- .../Sdk/Am/ILibraryAppletProxy.cs | 4 +- .../Sdk/Am/IOverlayAppletProxy.cs | 4 +- src/Ryujinx.Horizon/Sdk/Am/ISelfController.cs | 56 ++++ .../Sdk/Am/ISystemAppletProxy.cs | 4 +- 10 files changed, 344 insertions(+), 23 deletions(-) create mode 100644 src/Ryujinx.Horizon/Am/Ipc/Controllers/SelfController.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Am/ISelfController.cs diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/SelfController.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/SelfController.cs new file mode 100644 index 000000000..9a972b875 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/SelfController.cs @@ -0,0 +1,248 @@ +using Ryujinx.Horizon.Common; +using Ryujinx.Horizon.Sdk.Am; + +namespace Ryujinx.Horizon.Am.Ipc.Controllers +{ + partial class SelfController : ISelfController + { + public Result Exit() + { + throw new System.NotImplementedException(); + } + + public Result LockExit() + { + throw new System.NotImplementedException(); + } + + public Result UnlockExit() + { + throw new System.NotImplementedException(); + } + + public Result EnterFatalSection() + { + throw new System.NotImplementedException(); + } + + public Result LeaveFatalSection() + { + throw new System.NotImplementedException(); + } + + public Result GetLibraryAppletLaunchableEvent() + { + throw new System.NotImplementedException(); + } + + public Result SetScreenShotPermission() + { + throw new System.NotImplementedException(); + } + + public Result SetOperationModeChangedNotification() + { + throw new System.NotImplementedException(); + } + + public Result SetPerformanceModeChangedNotification() + { + throw new System.NotImplementedException(); + } + + public Result SetFocusHandlingMode() + { + throw new System.NotImplementedException(); + } + + public Result SetRestartMessageEnabled() + { + throw new System.NotImplementedException(); + } + + public Result SetScreenShotAppletIdentityInfo() + { + throw new System.NotImplementedException(); + } + + public Result SetOutOfFocusSuspendingEnabled() + { + throw new System.NotImplementedException(); + } + + public Result SetControllerFirmwareUpdateSection() + { + throw new System.NotImplementedException(); + } + + public Result SetRequiresCaptureButtonShortPressedMessage() + { + throw new System.NotImplementedException(); + } + + public Result SetAlbumImageOrientation() + { + throw new System.NotImplementedException(); + } + + public Result SetDesirableKeyboardLayout() + { + throw new System.NotImplementedException(); + } + + public Result GetScreenShotProgramId() + { + throw new System.NotImplementedException(); + } + + public Result CreateManagedDisplayLayer() + { + throw new System.NotImplementedException(); + } + + public Result IsSystemBufferSharingEnabled() + { + throw new System.NotImplementedException(); + } + + public Result GetSystemSharedLayerHandle() + { + throw new System.NotImplementedException(); + } + + public Result GetSystemSharedBufferHandle() + { + throw new System.NotImplementedException(); + } + + public Result CreateManagedDisplaySeparableLayer() + { + throw new System.NotImplementedException(); + } + + public Result SetManagedDisplayLayerSeparationMode() + { + throw new System.NotImplementedException(); + } + + public Result SetRecordingLayerCompositionEnabled() + { + throw new System.NotImplementedException(); + } + + public Result SetHandlesRequestToDisplay() + { + throw new System.NotImplementedException(); + } + + public Result ApproveToDisplay() + { + throw new System.NotImplementedException(); + } + + public Result OverrideAutoSleepTimeAndDimmingTime() + { + throw new System.NotImplementedException(); + } + + public Result SetMediaPlaybackState() + { + throw new System.NotImplementedException(); + } + + public Result SetIdleTimeDetectionExtension() + { + throw new System.NotImplementedException(); + } + + public Result GetIdleTimeDetectionExtension() + { + throw new System.NotImplementedException(); + } + + public Result SetInputDetectionSourceSet() + { + throw new System.NotImplementedException(); + } + + public Result ReportUserIsActive() + { + throw new System.NotImplementedException(); + } + + public Result GetCurrentIlluminance() + { + throw new System.NotImplementedException(); + } + + public Result IsIlluminanceAvailable() + { + throw new System.NotImplementedException(); + } + + public Result SetAutoSleepDisabled() + { + throw new System.NotImplementedException(); + } + + public Result IsAutoSleepDisabled() + { + throw new System.NotImplementedException(); + } + + public Result ReportMultimediaError() + { + throw new System.NotImplementedException(); + } + + public Result GetCurrentIlluminanceEx() + { + throw new System.NotImplementedException(); + } + + public Result SetInputDetectionPolicy() + { + throw new System.NotImplementedException(); + } + + public Result SetWirelessPriorityMode() + { + throw new System.NotImplementedException(); + } + + public Result GetAccumulatedSuspendedTickValue() + { + throw new System.NotImplementedException(); + } + + public Result GetAccumulatedSuspendedTickChangedEvent() + { + throw new System.NotImplementedException(); + } + + public Result SetAlbumImageTakenNotificationEnabled() + { + throw new System.NotImplementedException(); + } + + public Result SetApplicationAlbumUserData() + { + throw new System.NotImplementedException(); + } + + public Result SaveCurrentScreenshot() + { + throw new System.NotImplementedException(); + } + + public Result SetRecordVolumeMuted() + { + throw new System.NotImplementedException(); + } + + public Result GetDebugStorageChannel() + { + throw new System.NotImplementedException(); + } + } +} diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/ApplicationProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/ApplicationProxy.cs index c4bea7ca3..114075c03 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/ApplicationProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/ApplicationProxy.cs @@ -1,3 +1,4 @@ +using Ryujinx.Horizon.Am.Ipc.Controllers; using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Sdk.Am; using Ryujinx.Horizon.Sdk.Sf; @@ -7,15 +8,19 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies partial class ApplicationProxy : IApplicationProxy { [CmifCommand(0)] - public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid) + public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter) { - throw new System.NotImplementedException(); + commonStateGetter = new CommonStateGetter(); + + return Result.Success; } [CmifCommand(1)] - public Result GetSelfController() + public Result GetSelfController(out ISelfController selfController) { - throw new System.NotImplementedException(); + selfController = new SelfController(); + + return Result.Success; } [CmifCommand(2)] diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs index 0f4a843fb..38d0af67d 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs @@ -1,3 +1,4 @@ +using Ryujinx.Horizon.Am.Ipc.Controllers; using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Sdk.Am; using Ryujinx.Horizon.Sdk.Sf; @@ -7,15 +8,19 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies partial class LibraryAppletProxy : ILibraryAppletProxy { [CmifCommand(0)] - public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid) + public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter) { - throw new System.NotImplementedException(); + commonStateGetter = new CommonStateGetter(); + + return Result.Success; } [CmifCommand(1)] - public Result GetSelfController() + public Result GetSelfController(out ISelfController selfController) { - throw new System.NotImplementedException(); + selfController = new SelfController(); + + return Result.Success; } [CmifCommand(2)] diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs index 926161b65..8ec6000d1 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs @@ -1,3 +1,4 @@ +using Ryujinx.Horizon.Am.Ipc.Controllers; using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Sdk.Am; using Ryujinx.Horizon.Sdk.Sf; @@ -7,15 +8,19 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies partial class OverlayAppletProxy : IOverlayAppletProxy { [CmifCommand(0)] - public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid) + public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter) { - throw new System.NotImplementedException(); + commonStateGetter = new CommonStateGetter(); + + return Result.Success; } [CmifCommand(1)] - public Result GetSelfController() + public Result GetSelfController(out ISelfController selfController) { - throw new System.NotImplementedException(); + selfController = new SelfController(); + + return Result.Success; } [CmifCommand(2)] diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/SystemAppletProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/SystemAppletProxy.cs index 54142aa20..e8387417c 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/SystemAppletProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/SystemAppletProxy.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies partial class SystemAppletProxy : ISystemAppletProxy { [CmifCommand(0)] - public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid) + public Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter) { commonStateGetter = new CommonStateGetter(); @@ -16,9 +16,11 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies } [CmifCommand(1)] - public Result GetSelfController() + public Result GetSelfController(out ISelfController selfController) { - throw new System.NotImplementedException(); + selfController = new SelfController(); + + return Result.Success; } [CmifCommand(2)] diff --git a/src/Ryujinx.Horizon/Sdk/Am/IApplicationProxy.cs b/src/Ryujinx.Horizon/Sdk/Am/IApplicationProxy.cs index 232a4238a..4c9a16952 100644 --- a/src/Ryujinx.Horizon/Sdk/Am/IApplicationProxy.cs +++ b/src/Ryujinx.Horizon/Sdk/Am/IApplicationProxy.cs @@ -4,8 +4,8 @@ namespace Ryujinx.Horizon.Sdk.Am { public interface IApplicationProxy { - Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid); - Result GetSelfController(); + Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter); + Result GetSelfController(out ISelfController selfController); Result GetWindowController(); Result GetAudioController(); Result GetDisplayController(); diff --git a/src/Ryujinx.Horizon/Sdk/Am/ILibraryAppletProxy.cs b/src/Ryujinx.Horizon/Sdk/Am/ILibraryAppletProxy.cs index 593f30f42..869edcd0d 100644 --- a/src/Ryujinx.Horizon/Sdk/Am/ILibraryAppletProxy.cs +++ b/src/Ryujinx.Horizon/Sdk/Am/ILibraryAppletProxy.cs @@ -4,8 +4,8 @@ namespace Ryujinx.Horizon.Sdk.Am { public interface ILibraryAppletProxy { - Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid); - Result GetSelfController(); + Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter); + Result GetSelfController(out ISelfController selfController); Result GetWindowController(); Result GetAudioController(); Result GetDisplayController(); diff --git a/src/Ryujinx.Horizon/Sdk/Am/IOverlayAppletProxy.cs b/src/Ryujinx.Horizon/Sdk/Am/IOverlayAppletProxy.cs index f18ae7839..cc79229d2 100644 --- a/src/Ryujinx.Horizon/Sdk/Am/IOverlayAppletProxy.cs +++ b/src/Ryujinx.Horizon/Sdk/Am/IOverlayAppletProxy.cs @@ -4,8 +4,8 @@ namespace Ryujinx.Horizon.Sdk.Am { public interface IOverlayAppletProxy { - Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid); - Result GetSelfController(); + Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter); + Result GetSelfController(out ISelfController selfController); Result GetWindowController(); Result GetAudioController(); Result GetDisplayController(); diff --git a/src/Ryujinx.Horizon/Sdk/Am/ISelfController.cs b/src/Ryujinx.Horizon/Sdk/Am/ISelfController.cs new file mode 100644 index 000000000..18c84c0ba --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/ISelfController.cs @@ -0,0 +1,56 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am +{ + public interface ISelfController + { + Result Exit(); + Result LockExit(); + Result UnlockExit(); + Result EnterFatalSection(); + Result LeaveFatalSection(); + Result GetLibraryAppletLaunchableEvent(); + Result SetScreenShotPermission(); + Result SetOperationModeChangedNotification(); + Result SetPerformanceModeChangedNotification(); + Result SetFocusHandlingMode(); + Result SetRestartMessageEnabled(); + Result SetScreenShotAppletIdentityInfo(); + Result SetOutOfFocusSuspendingEnabled(); + Result SetControllerFirmwareUpdateSection(); + Result SetRequiresCaptureButtonShortPressedMessage(); + Result SetAlbumImageOrientation(); + Result SetDesirableKeyboardLayout(); + Result GetScreenShotProgramId(); + Result CreateManagedDisplayLayer(); + Result IsSystemBufferSharingEnabled(); + Result GetSystemSharedLayerHandle(); + Result GetSystemSharedBufferHandle(); + Result CreateManagedDisplaySeparableLayer(); + Result SetManagedDisplayLayerSeparationMode(); + Result SetRecordingLayerCompositionEnabled(); + Result SetHandlesRequestToDisplay(); + Result ApproveToDisplay(); + Result OverrideAutoSleepTimeAndDimmingTime(); + Result SetMediaPlaybackState(); + Result SetIdleTimeDetectionExtension(); + Result GetIdleTimeDetectionExtension(); + Result SetInputDetectionSourceSet(); + Result ReportUserIsActive(); + Result GetCurrentIlluminance(); + Result IsIlluminanceAvailable(); + Result SetAutoSleepDisabled(); + Result IsAutoSleepDisabled(); + Result ReportMultimediaError(); + Result GetCurrentIlluminanceEx(); + Result SetInputDetectionPolicy(); + Result SetWirelessPriorityMode(); + Result GetAccumulatedSuspendedTickValue(); + Result GetAccumulatedSuspendedTickChangedEvent(); + Result SetAlbumImageTakenNotificationEnabled(); + Result SetApplicationAlbumUserData(); + Result SaveCurrentScreenshot(); + Result SetRecordVolumeMuted(); + Result GetDebugStorageChannel(); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/ISystemAppletProxy.cs b/src/Ryujinx.Horizon/Sdk/Am/ISystemAppletProxy.cs index 0e9dd7937..8c2fd7e0d 100644 --- a/src/Ryujinx.Horizon/Sdk/Am/ISystemAppletProxy.cs +++ b/src/Ryujinx.Horizon/Sdk/Am/ISystemAppletProxy.cs @@ -4,8 +4,8 @@ namespace Ryujinx.Horizon.Sdk.Am { public interface ISystemAppletProxy { - Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter, ulong pid); - Result GetSelfController(); + Result GetCommonStateGetter(out ICommonStateGetter commonStateGetter); + Result GetSelfController(out ISelfController selfController); Result GetWindowController(); Result GetAudioController(); Result GetDisplayController();