#include "src/pdf/SkPDFTag.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTo.h"
#include "src/pdf/SkPDFDocumentPriv.h"
#include <algorithm>
#include <memory>
#include <utility>
usingnamespaceskia_private;
const int kFirstAnnotationStructParentKey = …;
namespace {
struct Location { … };
}
struct SkPDFTagNode { … };
SkPDF::AttributeList::AttributeList() = default;
SkPDF::AttributeList::~AttributeList() = default;
void SkPDF::AttributeList::appendInt(
const char* owner, const char* name, int value) { … }
void SkPDF::AttributeList::appendFloat(
const char* owner, const char* name, float value) { … }
void SkPDF::AttributeList::appendName(
const char* owner, const char* name, const char* value) { … }
void SkPDF::AttributeList::appendFloatArray(
const char* owner, const char* name, const std::vector<float>& value) { … }
void SkPDF::AttributeList::appendNodeIdArray(
const char* owner,
const char* name,
const std::vector<int>& nodeIds) { … }
SkPDFTagTree::SkPDFTagTree() : … { … }
SkPDFTagTree::~SkPDFTagTree() = default;
void SkPDFTagTree::Copy(SkPDF::StructureElementNode& node,
SkPDFTagNode* dst,
SkArenaAlloc* arena,
THashMap<int, SkPDFTagNode*>* nodeMap,
bool wantTitle) { … }
void SkPDFTagTree::init(SkPDF::StructureElementNode* node, SkPDF::Metadata::Outline outline) { … }
int SkPDFTagTree::Mark::id() { … }
SkPoint& SkPDFTagTree::Mark::point() { … }
auto SkPDFTagTree::createMarkIdForNodeId(int nodeId, unsigned pageIndex, SkPoint point) -> Mark { … }
int SkPDFTagTree::createStructParentKeyForNodeId(int nodeId, unsigned pageIndex) { … }
static bool can_discard(SkPDFTagNode* node) { … }
SkPDFIndirectReference SkPDFTagTree::PrepareTagTreeToEmit(SkPDFIndirectReference parent,
SkPDFTagNode* node,
SkPDFDocument* doc) { … }
void SkPDFTagTree::addNodeAnnotation(int nodeId, SkPDFIndirectReference annotationRef, unsigned pageIndex) { … }
void SkPDFTagTree::addNodeTitle(int nodeId, SkSpan<const char> title) { … }
SkPDFIndirectReference SkPDFTagTree::makeStructTreeRoot(SkPDFDocument* doc) { … }
namespace {
struct OutlineEntry { … };
OutlineEntry::Content create_outline_entry_content(SkPDFTagNode* const node) { … }
void create_outline_from_headers(SkPDFDocument* const doc, SkPDFTagNode* const node,
STArray<7, OutlineEntry*>& stack) { … }
}
SkPDFIndirectReference SkPDFTagTree::makeOutline(SkPDFDocument* doc) { … }
SkString SkPDFTagTree::getRootLanguage() { … }