summaryrefslogtreecommitdiff
path: root/src/core/hle/applets/applet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/applets/applet.h')
-rw-r--r--src/core/hle/applets/applet.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h
deleted file mode 100644
index ebeed9813..000000000
--- a/src/core/hle/applets/applet.h
+++ /dev/null
@@ -1,83 +0,0 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <memory>
8#include "core/hle/result.h"
9#include "core/hle/service/apt/apt.h"
10
11namespace HLE {
12namespace Applets {
13
14class Applet {
15public:
16 virtual ~Applet() = default;
17
18 /**
19 * Creates an instance of the Applet subclass identified by the parameter.
20 * and stores it in a global map.
21 * @param id Id of the applet to create.
22 * @returns ResultCode Whether the operation was successful or not.
23 */
24 static ResultCode Create(Service::APT::AppletId id);
25
26 /**
27 * Retrieves the Applet instance identified by the specified id.
28 * @param id Id of the Applet to retrieve.
29 * @returns Requested Applet or nullptr if not found.
30 */
31 static std::shared_ptr<Applet> Get(Service::APT::AppletId id);
32
33 /**
34 * Handles a parameter from the application.
35 * @param parameter Parameter data to handle.
36 * @returns ResultCode Whether the operation was successful or not.
37 */
38 virtual ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) = 0;
39
40 /**
41 * Handles the Applet start event, triggered from the application.
42 * @param parameter Parameter data to handle.
43 * @returns ResultCode Whether the operation was successful or not.
44 */
45 ResultCode Start(const Service::APT::AppletStartupParameter& parameter);
46
47 /**
48 * Whether the applet is currently executing instead of the host application or not.
49 */
50 bool IsRunning() const;
51
52 /**
53 * Handles an update tick for the Applet, lets it update the screen, send commands, etc.
54 */
55 virtual void Update() = 0;
56
57protected:
58 explicit Applet(Service::APT::AppletId id) : id(id) {}
59
60 /**
61 * Handles the Applet start event, triggered from the application.
62 * @param parameter Parameter data to handle.
63 * @returns ResultCode Whether the operation was successful or not.
64 */
65 virtual ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) = 0;
66
67 Service::APT::AppletId id; ///< Id of this Applet
68 std::shared_ptr<std::vector<u8>> heap_memory; ///< Heap memory for this Applet
69
70 /// Whether this applet is currently running instead of the host application or not.
71 bool is_running = false;
72};
73
74/// Returns whether a library applet is currently running
75bool IsLibraryAppletRunning();
76
77/// Initializes the HLE applets
78void Init();
79
80/// Shuts down the HLE applets
81void Shutdown();
82}
83} // namespace