1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibPDF: Create basic object structure

This commit is the start of LibPDF, and introduces some basic structure
objects. This emulates LibJS's Value structure, where Value is a simple
class that can contain a pointer to a more complex Object class with
more data. All of the basic PDF objects have a representation.
This commit is contained in:
Matthew Olsson 2021-04-30 18:23:17 -07:00 committed by Andreas Kling
parent af9a7b1374
commit a8f5b6aaa3
10 changed files with 637 additions and 0 deletions

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
namespace PDF {
class Document;
class Object;
#define ENUMERATE_DIRECT_OBJECT_TYPES(V) \
V(StringObject, string) \
V(NameObject, name) \
V(ArrayObject, array) \
V(DictObject, dict) \
V(StreamObject, stream) \
V(IndirectValue, indirect_value)
#define ENUMERATE_OBJECT_TYPES(V) \
ENUMERATE_DIRECT_OBJECT_TYPES(V) \
V(IndirectValueRef, indirect_value_ref)
#define FORWARD_DECL(class_name, _) class class_name;
ENUMERATE_OBJECT_TYPES(FORWARD_DECL)
#undef FORWARD_DECL
template<typename T>
concept IsObject = IsBaseOf<Object, T>;
}