1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibPDF: Rename Command to Operator

This is the correct name, according to the spec
This commit is contained in:
Matthew Olsson 2022-03-25 15:00:11 -07:00 committed by Andreas Kling
parent 49cb040c27
commit 468ceb1b48
Notes: sideshowbarker 2024-07-17 16:24:27 +09:00
5 changed files with 65 additions and 65 deletions

View file

@ -78,28 +78,28 @@ PDFErrorOr<void> Renderer::render()
byte_buffer.append(bytes.data(), bytes.size());
}
auto commands = TRY(Parser::parse_graphics_commands(m_document, byte_buffer));
auto operators = TRY(Parser::parse_operators(m_document, byte_buffer));
for (auto& command : commands)
TRY(handle_command(command));
for (auto& op : operators)
TRY(handle_operator(op));
return {};
}
PDFErrorOr<void> Renderer::handle_command(Command const& command)
PDFErrorOr<void> Renderer::handle_operator(Operator const& op)
{
switch (command.command_type()) {
#define V(name, snake_name, symbol) \
case CommandType::name: \
TRY(handle_##snake_name(command.arguments())); \
switch (op.type()) {
#define V(name, snake_name, symbol) \
case OperatorType::name: \
TRY(handle_##snake_name(op.arguments())); \
break;
ENUMERATE_COMMANDS(V)
ENUMERATE_OPERATORS(V)
#undef V
case CommandType::TextNextLineShowString:
TRY(handle_text_next_line_show_string(command.arguments()));
case OperatorType::TextNextLineShowString:
TRY(handle_text_next_line_show_string(op.arguments()));
break;
case CommandType::TextNextLineShowStringSetSpacing:
TRY(handle_text_next_line_show_string_set_spacing(command.arguments()));
case OperatorType::TextNextLineShowStringSetSpacing:
TRY(handle_text_next_line_show_string_set_spacing(op.arguments()));
break;
}