am.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. 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 CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx);
  72. void SetScreenShotPermission(Kernel::HLERequestContext& ctx);
  73. void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx);
  74. std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
  75. Kernel::SharedPtr<Kernel::Event> launchable_event;
  76. };
  77. class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
  78. public:
  79. ICommonStateGetter();
  80. private:
  81. enum class FocusState : u8 {
  82. InFocus = 1,
  83. NotInFocus = 2,
  84. };
  85. enum class OperationMode : u8 {
  86. Handheld = 0,
  87. Docked = 1,
  88. };
  89. void GetEventHandle(Kernel::HLERequestContext& ctx);
  90. void ReceiveMessage(Kernel::HLERequestContext& ctx);
  91. void GetCurrentFocusState(Kernel::HLERequestContext& ctx);
  92. void GetOperationMode(Kernel::HLERequestContext& ctx);
  93. void GetPerformanceMode(Kernel::HLERequestContext& ctx);
  94. Kernel::SharedPtr<Kernel::Event> event;
  95. };
  96. class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
  97. public:
  98. ILibraryAppletCreator();
  99. private:
  100. void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
  101. void CreateStorage(Kernel::HLERequestContext& ctx);
  102. };
  103. class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
  104. public:
  105. IApplicationFunctions();
  106. private:
  107. void PopLaunchParameter(Kernel::HLERequestContext& ctx);
  108. void CreateApplicationAndRequestToStartForQuest(Kernel::HLERequestContext& ctx);
  109. void EnsureSaveData(Kernel::HLERequestContext& ctx);
  110. void SetTerminateResult(Kernel::HLERequestContext& ctx);
  111. void GetDisplayVersion(Kernel::HLERequestContext& ctx);
  112. void GetDesiredLanguage(Kernel::HLERequestContext& ctx);
  113. void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx);
  114. void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx);
  115. void NotifyRunning(Kernel::HLERequestContext& ctx);
  116. };
  117. class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
  118. public:
  119. IHomeMenuFunctions();
  120. private:
  121. void RequestToGetForeground(Kernel::HLERequestContext& ctx);
  122. };
  123. class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {
  124. public:
  125. IGlobalStateController();
  126. };
  127. class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
  128. public:
  129. IApplicationCreator();
  130. };
  131. class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
  132. public:
  133. IProcessWindingController();
  134. };
  135. /// Registers all AM services with the specified service manager.
  136. void InstallInterfaces(SM::ServiceManager& service_manager,
  137. std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
  138. } // namespace AM
  139. } // namespace Service