Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ jobs:
run: |
python3 scripts/ci/test_correction_operation_catalog.py
python3 scripts/generate-architecture-catalogs.py --check
- name: Verify command catalog handler coverage (#231)
run: |
python3 scripts/ci/test_command_catalog.py
python3 scripts/verify-command-catalog.py
- name: Verify preflight check catalog and coverage backlog (#165)
run: python3 scripts/ci/test_preflight_check_catalog.py
- name: Verify preflight corpus coverage map (#165)
Expand Down
4 changes: 4 additions & 0 deletions LoopEditor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ qt_add_executable(LoopEditor
quickoutput.cpp
quickoutput.h
editorhost.h
editorsettings.cpp
editorsettings.h
focusrestoration.cpp
focusrestoration.h
quickdocumentmodel.cpp
Expand All @@ -48,6 +50,8 @@ qt_add_qml_module(LoopEditor
QML_FILES
qml/Main.qml
qml/OperatorHelpDialog.qml
qml/SettingsDialog.qml
qml/DiagnosticsDialog.qml
qml/Workspace.qml
qml/DocumentPane.qml
qml/CanvasPane.qml
Expand Down
21 changes: 21 additions & 0 deletions LoopEditor/documentviewsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "interactioncontroller.h"
#include "overlaybuilder.h"
#include "pagesurfacecoordinator.h"
#include "pdfdocumentimageextractor.h"
#include "pdfdocumenttextselectionsource.h"
#include "pdfdocumentsession.h"
#include "pdfpagecachebudget.h"

Expand Down Expand Up @@ -104,6 +106,16 @@ DocumentViewSession::DocumentViewSession(QObject* parent) :
*m_hitTest,
*m_overlays,
this);
m_textSelectionSource = std::make_unique<pdfinteraction::PDFDocumentTextSelectionSource>(&m_context);
m_interaction->setTextSelectionSource(m_textSelectionSource.get());
m_imageExtractor = std::make_unique<pdfinteraction::PDFDocumentImageExtractor>(&m_context);

// The revision moving under a measurement or a text selection is the
// conflict path: both are dropped rather than carried onto geometry the
// operator never saw. The session owns the stack, so it owns this wiring.
connect(&m_context, &pdf::PDFDocumentContext::revisionChanged, this,
[this](const pdf::PDFRevisionIdentity&, const pdf::PDFRevisionIdentity&)
{ m_interaction->handleRevisionChanged(); });

m_viewport.setPageLayout(pdfinteraction::PageLayout::SinglePage);
applyInitialViewportScreenMetrics(m_viewport);
Expand Down Expand Up @@ -205,6 +217,9 @@ void DocumentViewSession::prepareDocumentView()
m_interaction->invalidate();
m_geometry = std::make_unique<pdfinteraction::PDFDocumentPageGeometrySource>(&m_context);
m_viewport.setGeometrySource(m_geometry.get());
// The geometry source answers the page's /UserUnit scale too, so the
// measure tool reads the same page facts the viewport laid out.
m_interaction->setPageUnitSource(m_geometry.get());
m_viewport.invalidateLayout();
m_surfaces->setDocumentKey(m_revisionSource->documentKey());

Expand All @@ -223,6 +238,7 @@ void DocumentViewSession::prepareDocumentView()
void DocumentViewSession::clearDocumentView()
{
m_interaction->invalidate();
m_interaction->setPageUnitSource(nullptr);
m_viewport.setGeometrySource(nullptr);
m_geometry.reset();
m_surfaces->invalidate(m_facade->currentRevision());
Expand All @@ -237,6 +253,11 @@ void DocumentViewSession::setSurfaceRenderFeatures(pdf::PDFRenderer::Features fe
m_surfaces->setRenderSettings(settings);
}

void DocumentViewSession::setSoftProofProfile(const QString& proofProfileId)
{
m_surfaces->setSoftProofProfile(proofProfileId);
}

void DocumentViewSession::setCacheLimit(qsizetype totalBytes)
{
const qsizetype normalized = pdf::PDFPageCacheBudget::total(totalBytes);
Expand Down
12 changes: 12 additions & 0 deletions LoopEditor/documentviewsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class OverlayBuilder;
class PageSurfaceCoordinator;
class PDFDocumentContextSource;
class PDFDocumentPageGeometrySource;
class PDFDocumentTextSelectionSource;
class PDFDocumentImageExtractor;
}

/// Owns the document-bound view machinery used by EditorHost.
Expand Down Expand Up @@ -65,6 +67,7 @@ class DocumentViewSession final : public QObject
pdfinteraction::HitTestDispatcher* hitTest() const noexcept { return m_hitTest.get(); }
pdfinteraction::OverlayBuilder* overlays() const noexcept { return m_overlays.get(); }
pdfinteraction::InteractionController* interaction() const noexcept { return m_interaction.get(); }
pdfinteraction::PDFDocumentImageExtractor* imageExtractor() const noexcept { return m_imageExtractor.get(); }
pdfinteraction::ViewportCommandBridge& commandBridge() noexcept { return m_commandBridge; }
pdfinteraction::PageBoxHitTestSource& pageBoxSource() noexcept { return m_pageBoxSource; }

Expand All @@ -78,6 +81,13 @@ class DocumentViewSession final : public QObject
void clearDocumentView();
void setSurfaceRenderFeatures(pdf::PDFRenderer::Features features);

/// The proofing profile identity in force for the interactive canvas (issue
/// #237). Empty disables proofing. The surfaces re-render as proofs through
/// Core's colour management; the identity joins the surface key, so a proof
/// can never be served from, or mistaken for, the fast or authoritative
/// render of the same page.
void setSoftProofProfile(const QString& proofProfileId);

quint64 passwordRequestId() const;
bool answerPassword(quint64 requestId, QString password, bool accepted);

Expand Down Expand Up @@ -131,6 +141,8 @@ class DocumentViewSession final : public QObject
std::unique_ptr<pdfinteraction::HitTestDispatcher> m_hitTest;
std::unique_ptr<pdfinteraction::OverlayBuilder> m_overlays;
std::unique_ptr<pdfinteraction::InteractionController> m_interaction;
std::unique_ptr<pdfinteraction::PDFDocumentTextSelectionSource> m_textSelectionSource;
std::unique_ptr<pdfinteraction::PDFDocumentImageExtractor> m_imageExtractor;
pdfinteraction::ViewportCommandBridge m_commandBridge;
pdfinteraction::PageBoxHitTestSource m_pageBoxSource;
qsizetype m_cacheLimit = DefaultCacheLimit; // total authority (partitioned via PDFPageCacheBudget)
Expand Down
Loading
Loading