am.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include "core/hle/service/service.h"
  7. namespace Kernel {
  8. class Event;
  9. }
  10. namespace Service {
  11. namespace NVFlinger {
  12. class NVFlinger;
  13. }
  14. namespace AM {
  15. enum SystemLanguage {
  16. Japanese = 0,
  17. English = 1, // en-US
  18. French = 2,
  19. German = 3,
  20. Italian = 4,
  21. Spanish = 5,
  22. Chinese = 6,
  23. Korean = 7,
  24. Dutch = 8,
  25. Portuguese = 9,
  26. Russian = 10,
  27. Taiwanese = 11,
  28. BritishEnglish = 12, // en-GB
  29. CanadianFrench = 13,
  30. LatinAmericanSpanish = 14, // es-419
  31. // 4.0.0+
  32. SimplifiedChinese = 15,
  33. TraditionalChinese = 16,
  34. };
  35. class IWindowController final : public ServiceFramework<IWindowController> {
  36. public:
  37. IWindowController();
  38. private:
  39. void GetAppletResourceUserId(Kernel::HLERequestContext& ctx);
  40. void AcquireForegroundRights(Kernel::HLERequestContext& ctx);
  41. };
  42. class IAudioController final : public ServiceFramework<IAudioController> {
  43. public:
  44. IAudioController();
  45. private:
  46. void SetExpectedMasterVolume(Kernel::HLERequestContext& ctx);
  47. void GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx);
  48. void GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx);
  49. u32 volume{100};
  50. };
  51. class IDisplayController final : public ServiceFramework<IDisplayController> {
  52. public:
  53. IDisplayController();
  54. };
  55. class IDebugFunctions final : public ServiceFramework<IDebugFunctions> {
  56. public:
  57. IDebugFunctions();
  58. };
  59. class ISelfController final : public ServiceFramework<ISelfController> {
  60. public:
  61. explicit ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
  62. private:
  63. void SetFocusHandlingMode(Kernel::HLERequestContext& ctx);
  64. void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx);
  65. void SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx);
  66. void SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx);
  67. void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx);
  68. void LockExit(Kernel::HLERequestContext& ctx);
  69. void UnlockExit(Kernel::HLERequestContext& ctx);
  70. void GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx);
  71. void SetScreenShotImageOrientation(Kernel::HLERequestContext& ctx);
  72. void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx);
  73. void SetScreenShotPermission(Kernel::HLERequestContext& ctx);
  74. void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx);
  75. std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
  76. Kernel::SharedPtr<Kernel::Event> launchable_event;
  77. };
  78. class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
  79. public:
  80. ICommonStateGetter();
  81. private:
  82. enum class FocusState : u8 {
  83. InFocus = 1,
  84. NotInFocus = 2,
  85. };
  86. enum class OperationMode : u8 {
  87. Handheld = 0,
  88. Docked = 1,
  89. };
  90. void GetEventHandle(Kernel::HLERequestContext& ctx);
  91. void ReceiveMessage(Kernel::HLERequestContext& ctx);
  92. void GetCurrentFocusState(Kernel::HLERequestContext& ctx);
  93. void GetOperationMode(Kernel::HLERequestContext& ctx);
  94. void GetPerformanceMode(Kernel::HLERequestContext& ctx);
  95. Kernel::SharedPtr<Kernel::Event> event;
  96. };
  97. class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
  98. public:
  99. ILibraryAppletCreator();
  100. private:
  101. void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
  102. void CreateStorage(Kernel::HLERequestContext& ctx);
  103. };
  104. class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
  105. public:
  106. IApplicationFunctions();
  107. private:
  108. void PopLaunchParameter(Kernel::HLERequestContext& ctx);
  109. void CreateApplicationAndRequestToStartForQuest(Kernel::HLERequestContext& ctx);
  110. void EnsureSaveData(Kernel::HLERequestContext& ctx);
  111. void SetTerminateResult(Kernel::HLERequestContext& ctx);
  112. void GetDisplayVersion(Kernel::HLERequestContext& ctx);
  113. void GetDesiredLanguage(Kernel::HLERequestContext& ctx);
  114. void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx);
  115. void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx);
  116. void NotifyRunning(Kernel::HLERequestContext& ctx);
  117. void GetPseudoDeviceId(Kernel::HLERequestContext& ctx);
  118. };
  119. class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
  120. public:
  121. IHomeMenuFunctions();
  122. private:
  123. void RequestToGetForeground(Kernel::HLERequestContext& ctx);
  124. };
  125. class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {
  126. public:
  127. IGlobalStateController();
  128. };
  129. class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
  130. public:
  131. IApplicationCreator();
  132. };
  133. class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
  134. public:
  135. IProcessWindingController();
  136. };
  137. /// Registers all AM services with the specified service manager.
  138. void InstallInterfaces(SM::ServiceManager& service_manager,
  139. std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
  140. } // namespace AM
  141. } // namespace Service