diff options
author | Subv <subv2112@gmail.com> | 2015-05-27 22:21:06 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-07-12 05:32:12 +0200 |
commit | 725d5eea7879fa152c51f15fd76003d3c6bc44ed (patch) | |
tree | c260c6e094467c5d6b4694283573381310c2c96c /src/core/hle/applets/applet.h | |
parent | Applets: Add infrastructure to allow custom drawing and input handling in Applets. (diff) | |
download | yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar.gz yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar.bz2 yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar.lz yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar.xz yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.tar.zst yuzu-725d5eea7879fa152c51f15fd76003d3c6bc44ed.zip |
Diffstat (limited to 'src/core/hle/applets/applet.h')
-rw-r--r-- | src/core/hle/applets/applet.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index f50f7d604..fe537e70d 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -12,10 +12,10 @@ namespace HLE { namespace Applets { -class Applet : public std::enable_shared_from_this<Applet> { +class Applet { public: - virtual ~Applet() {}; - Applet(Service::APT::AppletId id) : id(id) {}; + virtual ~Applet() { } + Applet(Service::APT::AppletId id) : id(id) { } /** * Creates an instance of the Applet subclass identified by the parameter. @@ -37,25 +37,33 @@ public: * @param parameter Parameter data to handle. * @returns ResultCode Whether the operation was successful or not. */ - virtual ResultCode ReceiveParameter(Service::APT::MessageParameter const& parameter) = 0; + virtual ResultCode ReceiveParameter(const Service::APT::MessageParameter& 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. */ - virtual ResultCode Start(Service::APT::AppletStartupParameter const& parameter) = 0; + ResultCode Start(const Service::APT::AppletStartupParameter& parameter); /** * Whether the applet is currently executing instead of the host application or not. */ - virtual bool IsRunning() = 0; + virtual bool IsRunning() const = 0; /** * Handles an update tick for the Applet, lets it update the screen, send commands, etc. */ virtual void Update() = 0; +protected: + /** + * 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 StartImpl(const Service::APT::AppletStartupParameter& parameter) = 0; + Service::APT::AppletId id; ///< Id of this Applet }; @@ -65,6 +73,5 @@ void Init(); /// Shuts down the HLE applets void Shutdown(); -extern std::shared_ptr<Applet> g_current_applet; ///< Applet that is currently executing } } // namespace |