yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
gui_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_GUI_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_GUI_COMMANDS_H_
3
5
6namespace yaze {
7namespace cli {
8namespace handlers {
9
14 public:
15 std::string GetName() const { return "gui-place-tile"; }
16 std::string GetDescription() const {
17 return "Place a tile at specific coordinates using GUI automation";
18 }
19 std::string GetUsage() const {
20 return "gui-place-tile --tile <tile_id> --x <x> --y <y> [--format "
21 "<json|text>]";
22 }
23
24 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
25 return parser.RequireArgs({"tile", "x", "y"});
26 }
27
28 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
29 resources::OutputFormatter& formatter) override;
30};
31
36 public:
37 std::string GetName() const { return "gui-click"; }
38 std::string GetDescription() const {
39 return "Click on a GUI element using automation";
40 }
41 std::string GetUsage() const {
42 return "gui-click (--target <target> | --widget-key <key>) [--click-type "
43 "<left|right|middle|double>] [--format <json|text>]";
44 }
45
46 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
47
48 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
49 resources::OutputFormatter& formatter) override;
50};
51
56 public:
57 std::string GetName() const { return "gui-type"; }
58 std::string GetDescription() const {
59 return "Type text into a GUI input using automation";
60 }
61 std::string GetUsage() const {
62 return "gui-type (--target <target> | --widget-key <key>) --text <text> "
63 "[--clear-first] [--format <json|text>]";
64 }
65
66 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
67
68 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
69 resources::OutputFormatter& formatter) override;
70};
71
76 public:
77 std::string GetName() const { return "gui-wait"; }
78 std::string GetDescription() const {
79 return "Wait for a GUI condition or widget selector";
80 }
81 std::string GetUsage() const {
82 return "gui-wait [--condition <condition>] [--widget-key <key>] "
83 "[--timeout-ms <ms>] [--poll-interval-ms <ms>] [--format "
84 "<json|text>]";
85 }
86
87 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
88
89 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
90 resources::OutputFormatter& formatter) override;
91};
92
97 public:
98 std::string GetName() const { return "gui-assert"; }
99 std::string GetDescription() const {
100 return "Assert a GUI condition or widget selector";
101 }
102 std::string GetUsage() const {
103 return "gui-assert [--condition <condition>] [--widget-key <key>] "
104 "[--format <json|text>]";
105 }
106
107 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
108
109 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
110 resources::OutputFormatter& formatter) override;
111};
112
117 public:
118 std::string GetName() const { return "gui-discover-tool"; }
119 std::string GetDescription() const {
120 return "Discover available GUI tools and widgets";
121 }
122 std::string GetUsage() const {
123 return "gui-discover-tool [--window <window>] [--type <type>] [--format "
124 "<json|text>]";
125 }
126
127 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
128 return absl::OkStatus(); // No required args
129 }
130
131 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
132 resources::OutputFormatter& formatter) override;
133};
134
139 public:
140 std::string GetName() const override { return "gui-summarize-widgets"; }
141};
142
147 public:
148 std::string GetName() const { return "gui-screenshot"; }
149 std::string GetDescription() const { return "Take a screenshot of the GUI"; }
150 std::string GetUsage() const {
151 return "gui-screenshot [--region <region>] [--format <format>] [--format "
152 "<json|text>]";
153 }
154
155 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
156 return absl::OkStatus(); // No required args
157 }
158
159 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
160 resources::OutputFormatter& formatter) override;
161};
162
163} // namespace handlers
164} // namespace cli
165} // namespace yaze
166
167#endif // YAZE_SRC_CLI_HANDLERS_GUI_COMMANDS_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
Command handler for GUI assertions.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
Command handler for clicking GUI elements.
std::string GetName() const
Get the command name.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for discovering GUI tools.
std::string GetUsage() const
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for placing tiles via GUI automation.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for taking screenshots.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
std::string GetName() const
Get the command name.
Command handler for summarizing GUI widgets.
std::string GetName() const override
Get the command name.
Command handler for typing into GUI inputs.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
Command handler for waiting on GUI conditions.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Utility for parsing common CLI argument patterns.
absl::Status RequireArgs(const std::vector< std::string > &required) const
Validate that required arguments are present.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.