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:
parent
49cb040c27
commit
468ceb1b48
Notes:
sideshowbarker
2024-07-17 16:24:27 +09:00
Author: https://github.com/mattco98
Commit: 468ceb1b48
Pull-request: https://github.com/SerenityOS/serenity/pull/13326
Reviewed-by: https://github.com/alimpfard
5 changed files with 65 additions and 65 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue