yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
api_handlers.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_SERVICE_API_API_HANDLERS_H_
2#define YAZE_SRC_CLI_SERVICE_API_API_HANDLERS_H_
3
4#include <functional>
5#include <string>
6
7// Forward declarations to avoid exposing httplib headers everywhere
8namespace httplib {
9struct Request;
10struct Response;
11} // namespace httplib
12
13namespace yaze {
14namespace cli {
15namespace api {
16class BonjourPublisher;
17}
18} // namespace cli
19} // namespace yaze
20
21namespace yaze {
22class Rom;
23
24namespace emu {
25namespace debug {
26class SymbolProvider;
27}
28} // namespace emu
29
30namespace app {
31namespace service {
32class RenderService;
33}
34} // namespace app
35
36namespace cli {
37namespace api {
38
39// Health check endpoint. The optional |bonjour| pointer is used to report
40// discovery availability in the response JSON.
41void HandleHealth(const httplib::Request& req, httplib::Response& res,
42 const BonjourPublisher* bonjour = nullptr);
43
44// List available models
45void HandleListModels(const httplib::Request& req, httplib::Response& res);
46
47// Get current symbol table
48void HandleGetSymbols(const httplib::Request& req, httplib::Response& res,
50
51// Mesen2 bridge endpoints
52void HandleNavigate(const httplib::Request& req, httplib::Response& res);
53void HandleBreakpointHit(const httplib::Request& req, httplib::Response& res);
54void HandleStateUpdate(const httplib::Request& req, httplib::Response& res);
55
56// Window control endpoints
57void HandleWindowShow(const httplib::Request& req, httplib::Response& res,
58 const std::function<bool()>& action);
59void HandleWindowHide(const httplib::Request& req, httplib::Response& res,
60 const std::function<bool()>& action);
61
62// Apply common CORS headers to a response.
63void ApplyCorsHeaders(httplib::Response& res);
64
65// Render dungeon room to PNG image.
66// GET /api/v1/render/dungeon?room=<id>[&overlays=collision,sprites,...][&scale=<f>]
67void HandleRenderDungeon(const httplib::Request& req, httplib::Response& res,
68 yaze::app::service::RenderService* render_service);
69
70// Return JSON metadata for a dungeon room (no rendering).
71// GET /api/v1/render/dungeon/metadata?room=<id>
73 const httplib::Request& req, httplib::Response& res,
74 yaze::app::service::RenderService* render_service);
75
76// CORS preflight handler for OPTIONS requests.
77void HandleCorsPreflight(const httplib::Request& req, httplib::Response& res);
78
79// Execute a z3ed CLI command.
80// POST /api/v1/command/execute Body: {"command":"name","args":["--flag=val"]}
81void HandleCommandExecute(const httplib::Request& req, httplib::Response& res,
82 yaze::Rom* rom);
83
84// List all registered z3ed commands.
85// GET /api/v1/command/list
86void HandleCommandList(const httplib::Request& req, httplib::Response& res);
87
88// Annotation CRUD endpoints.
89// GET /api/v1/annotations[?room=<id>]
90void HandleAnnotationList(const httplib::Request& req, httplib::Response& res,
91 const std::string& project_path);
92
93// POST /api/v1/annotations
94void HandleAnnotationCreate(const httplib::Request& req, httplib::Response& res,
95 const std::string& project_path);
96
97// PUT /api/v1/annotations/<id>
98void HandleAnnotationUpdate(const httplib::Request& req, httplib::Response& res,
99 const std::string& project_path);
100
101// DELETE /api/v1/annotations/<id>
102void HandleAnnotationDelete(const httplib::Request& req, httplib::Response& res,
103 const std::string& project_path);
104
105} // namespace api
106} // namespace cli
107} // namespace yaze
108
109#endif // YAZE_SRC_CLI_SERVICE_API_API_HANDLERS_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Provider for symbol (label) resolution in disassembly.
void HandleStateUpdate(const httplib::Request &req, httplib::Response &res)
void ApplyCorsHeaders(httplib::Response &res)
void HandleCorsPreflight(const httplib::Request &req, httplib::Response &res)
void HandleBreakpointHit(const httplib::Request &req, httplib::Response &res)
void HandleListModels(const httplib::Request &req, httplib::Response &res)
void HandleGetSymbols(const httplib::Request &req, httplib::Response &res, yaze::emu::debug::SymbolProvider *symbols)
void HandleNavigate(const httplib::Request &req, httplib::Response &res)
void HandleWindowShow(const httplib::Request &req, httplib::Response &res, const std::function< bool()> &action)
void HandleAnnotationUpdate(const httplib::Request &req, httplib::Response &res, const std::string &project_path)
void HandleRenderDungeonMetadata(const httplib::Request &req, httplib::Response &res, yaze::app::service::RenderService *render_service)
void HandleRenderDungeon(const httplib::Request &req, httplib::Response &res, yaze::app::service::RenderService *render_service)
void HandleCommandExecute(const httplib::Request &req, httplib::Response &res, yaze::Rom *rom)
void HandleAnnotationDelete(const httplib::Request &req, httplib::Response &res, const std::string &project_path)
void HandleAnnotationList(const httplib::Request &req, httplib::Response &res, const std::string &project_path)
void HandleAnnotationCreate(const httplib::Request &req, httplib::Response &res, const std::string &project_path)
void HandleCommandList(const httplib::Request &req, httplib::Response &res)
void HandleWindowHide(const httplib::Request &req, httplib::Response &res, const std::function< bool()> &action)
void HandleHealth(const httplib::Request &req, httplib::Response &res, const BonjourPublisher *bonjour)