0

[PDF Ink Signatures] Relocate private PdfInkModule data types

Some private PdfInkModule data types are needed to support the internal
implementations of public support classes.  Move these definitions to
earlier in the class declaration to avoid the need for an interface
class to hide those details.

Change-Id: Ic9e6c45fa10e77879920832b34a0ff95de722baa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904950
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363882}
This commit is contained in:
Alan Screen
2024-10-03 21:47:53 +00:00
committed by Chromium LUCI CQ
parent 4035e23564
commit d5ace02626

@ -40,6 +40,37 @@ class PdfInkBrush;
class PdfInkModuleClient;
class PdfInkModule {
private:
// Some initial definitions needed for internal working of public classes.
// A stroke that has been completed, its ID, and whether it should be drawn
// or not.
struct FinishedStrokeState {
FinishedStrokeState(ink::Stroke stroke, size_t id);
FinishedStrokeState(const FinishedStrokeState&) = delete;
FinishedStrokeState& operator=(const FinishedStrokeState&) = delete;
FinishedStrokeState(FinishedStrokeState&&) noexcept;
FinishedStrokeState& operator=(FinishedStrokeState&&) noexcept;
~FinishedStrokeState();
// Coordinates for each stroke are stored in a canonical format specified in
// pdf_ink_transform.h.
ink::Stroke stroke;
// A unique ID to identify this stroke.
size_t id;
bool should_draw = true;
};
// Each page of a document can have many strokes. Each stroke is restricted
// to just one page.
// The elements are stored with IDs in an increasing order.
using PageStrokes = std::vector<FinishedStrokeState>;
// Mapping of a 0-based page index to the strokes for that page.
using DocumentStrokesMap = std::map<int, PageStrokes>;
public:
using StrokeInputPoints = std::vector<gfx::PointF>;
@ -120,34 +151,6 @@ class PdfInkModule {
std::vector<ink::StrokeInputBatch> inputs;
};
// A stroke that has been completed, its ID, and whether it should be drawn
// or not.
struct FinishedStrokeState {
FinishedStrokeState(ink::Stroke stroke, size_t id);
FinishedStrokeState(const FinishedStrokeState&) = delete;
FinishedStrokeState& operator=(const FinishedStrokeState&) = delete;
FinishedStrokeState(FinishedStrokeState&&) noexcept;
FinishedStrokeState& operator=(FinishedStrokeState&&) noexcept;
~FinishedStrokeState();
// Coordinates for each stroke are stored in a canonical format specified in
// pdf_ink_transform.h.
ink::Stroke stroke;
// A unique ID to identify this stroke.
size_t id;
bool should_draw = true;
};
// Each page of a document can have many strokes. Each stroke is restricted
// to just one page.
// The elements are stored with IDs in an increasing order.
using PageStrokes = std::vector<FinishedStrokeState>;
// Mapping of a 0-based page index to the strokes for that page.
using DocumentStrokesMap = std::map<int, PageStrokes>;
class StrokeIdGenerator {
public:
StrokeIdGenerator();