20#ifndef GIT_FILE_DIFF_AREA_H
21#define GIT_FILE_DIFF_AREA_H
35class wxSplitterWindow;
37class wxStyledTextCtrl;
60 void ShowFile(
const std::shared_ptr<KIGIT_COMMON>& aSession,
const MATERIALIZE& aMaterialize,
61 const wxString& aBeforeLabel,
const wxString& aAfterLabel );
67 void showNote(
const wxString& aNote );
69 const wxString& aBeforeLabel,
const wxString& aAfterLabel );
70 void showTextDiff(
const std::vector<KIGIT::TEXT_DIFF_LINE>& aLines );
72 const wxString& aBeforeLabel,
const wxString& aAfterLabel );
The base frame for deriving all KiCad main window classes.
A private scratch directory for extracting committed file versions to diff, removed when this object ...
std::function< bool(KIGIT_COMMON &, GIT_DIFF_WORKSPACE &, GIT_FILE_SIDES &)> MATERIALIZE
Writes the two sides on a worker with the session's action lock held.
wxStyledTextCtrl * m_textDiff
KIGIT_QUERY m_query
A newer file selection discards any materialization still running for the previous one.
void showDiff(const GIT_FILE_SIDES &aSides, const std::vector< KIGIT::TEXT_DIFF_LINE > &aTextLines, const wxString &aBeforeLabel, const wxString &aAfterLabel)
GIT_FILE_DIFF_AREA(wxWindow *aParent, EDA_BASE_FRAME *aFrame)
void followCanvas(WIDGET_DIFF_CANVAS *aLead, WIDGET_DIFF_CANVAS *aFollower)
Give aFollower the view of aLead, so panning or zooming one moves both.
~GIT_FILE_DIFF_AREA() override
bool showDrawingDiff(KICAD_DIFF::DOC_KIND aKind, const wxString &aBefore, const wxString &aAfter, const wxString &aBeforeLabel, const wxString &aAfterLabel)
void showTextDiff(const std::vector< KIGIT::TEXT_DIFF_LINE > &aLines)
std::unique_ptr< KICAD_DIFF::DIFF_CANVAS_CONTEXT > m_diffContext
The documents the two canvases draw, held by the kiface that loaded them.
WIDGET_DIFF_CANVAS * m_afterCanvas
wxStaticText * m_beforeLabel
wxSplitterWindow * m_canvasSplitter
void ShowFile(const std::shared_ptr< KIGIT_COMMON > &aSession, const MATERIALIZE &aMaterialize, const wxString &aBeforeLabel, const wxString &aAfterLabel)
Compare the two sides aMaterialize writes out, or show its reason instead.
void showNote(const wxString &aNote)
void ensureCanvases()
The two drawing canvases exist only while a drawing is compared.
WIDGET_DIFF_CANVAS * m_beforeCanvas
wxStaticText * m_afterLabel
void Clear()
Drop the documents and the drawing canvases.
Keeps the documents drawn on a pair of diff canvases alive.
The project's git session.
Read repository state without blocking the UI.
DOC_KIND
Document type a diff/merge entry point should route to, derived from a file path's extension.
The two sides of one file, written out for a comparison.