diff options
author | Subv <subv2112@gmail.com> | 2015-05-26 18:00:26 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-07-12 04:47:23 +0200 |
commit | 621ee10eae0546d4ec3f9e911e113aa9ee609c22 (patch) | |
tree | adfdc1cf9ae7e9ac9a5cf9950a91bbcfeb6cd552 /src/core/hle/applets/applet.h | |
parent | HLE/APT: Initial HLE support for applets. (diff) | |
download | yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar.gz yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar.bz2 yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar.lz yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar.xz yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.tar.zst yuzu-621ee10eae0546d4ec3f9e911e113aa9ee609c22.zip |
Diffstat (limited to 'src/core/hle/applets/applet.h')
-rw-r--r-- | src/core/hle/applets/applet.h | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index 221348d9c..f50f7d604 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -12,42 +12,59 @@ namespace HLE { namespace Applets { -class Applet { +class Applet : public std::enable_shared_from_this<Applet> { public: virtual ~Applet() {}; Applet(Service::APT::AppletId id) : id(id) {}; /** - * Creates an instance of the Applet subclass identified by the parameter + * Creates an instance of the Applet subclass identified by the parameter. * and stores it in a global map. - * @param id Id of the applet to create - * @returns ResultCode Whether the operation was successful or not + * @param id Id of the applet to create. + * @returns ResultCode Whether the operation was successful or not. */ static ResultCode Create(Service::APT::AppletId id); /** - * Retrieves the Applet instance identified by the specified id - * @param id Id of the Applet to retrieve - * @returns Requested Applet or nullptr if not found + * Retrieves the Applet instance identified by the specified id. + * @param id Id of the Applet to retrieve. + * @returns Requested Applet or nullptr if not found. */ static std::shared_ptr<Applet> Get(Service::APT::AppletId id); /** - * Handles a parameter from the application - * @param parameter Parameter data to handle - * @returns ResultCode Whether the operation was successful or not + * Handles a parameter from the application. + * @param parameter Parameter data to handle. + * @returns ResultCode Whether the operation was successful or not. */ virtual ResultCode ReceiveParameter(Service::APT::MessageParameter const& parameter) = 0; /** - * Handles the Applet start event, triggered from the application - * @param parameter Parameter data to handle - * @returns ResultCode Whether the operation was successful or not + * Handles the Applet start event, triggered from the application. + * @param parameter Parameter data to handle. + * @returns ResultCode Whether the operation was successful or not. */ virtual ResultCode Start(Service::APT::AppletStartupParameter const& parameter) = 0; + /** + * Whether the applet is currently executing instead of the host application or not. + */ + virtual bool IsRunning() = 0; + + /** + * Handles an update tick for the Applet, lets it update the screen, send commands, etc. + */ + virtual void Update() = 0; + Service::APT::AppletId id; ///< Id of this Applet }; +/// Initializes the HLE applets +void Init(); + +/// Shuts down the HLE applets +void Shutdown(); + +extern std::shared_ptr<Applet> g_current_applet; ///< Applet that is currently executing } } // namespace |