|
KiCad PCB EDA Suite
|
Shows what changed in one file: the old and new drawing side by side for a schematic or board, a line diff for a text file, or a note when there is nothing to compare. More...
#include <git_file_diff_area.h>
Public Types | |
| using | MATERIALIZE = std::function<bool( KIGIT_COMMON&, GIT_DIFF_WORKSPACE&, GIT_FILE_SIDES& )> |
| Writes the two sides on a worker with the session's action lock held. | |
Public Member Functions | |
| GIT_FILE_DIFF_AREA (wxWindow *aParent, EDA_BASE_FRAME *aFrame) | |
| ~GIT_FILE_DIFF_AREA () override | |
| 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 | Clear () |
| Drop the documents and the drawing canvases. | |
Private Member Functions | |
| void | showNote (const wxString &aNote) |
| void | showDiff (const GIT_FILE_SIDES &aSides, const std::vector< KIGIT::TEXT_DIFF_LINE > &aTextLines, const wxString &aBeforeLabel, const wxString &aAfterLabel) |
| void | showTextDiff (const std::vector< KIGIT::TEXT_DIFF_LINE > &aLines) |
| bool | showDrawingDiff (KICAD_DIFF::DOC_KIND aKind, const wxString &aBefore, const wxString &aAfter, const wxString &aBeforeLabel, const wxString &aAfterLabel) |
| void | ensureCanvases () |
| The two drawing canvases exist only while a drawing is compared. | |
| void | destroyCanvases () |
| void | followCanvas (WIDGET_DIFF_CANVAS *aLead, WIDGET_DIFF_CANVAS *aFollower) |
| Give aFollower the view of aLead, so panning or zooming one moves both. | |
Private Attributes | |
| EDA_BASE_FRAME * | m_frame |
| wxStaticText * | m_note |
| wxSplitterWindow * | m_canvasSplitter |
| wxStaticText * | m_beforeLabel |
| wxStaticText * | m_afterLabel |
| WIDGET_DIFF_CANVAS * | m_beforeCanvas |
| WIDGET_DIFF_CANVAS * | m_afterCanvas |
| wxStyledTextCtrl * | m_textDiff |
| wxSizer * | m_legend |
| KIGIT_QUERY | m_query |
| A newer file selection discards any materialization still running for the previous one. | |
| std::unique_ptr< KICAD_DIFF::DIFF_CANVAS_CONTEXT > | m_diffContext |
| The documents the two canvases draw, held by the kiface that loaded them. | |
Shows what changed in one file: the old and new drawing side by side for a schematic or board, a line diff for a text file, or a note when there is nothing to compare.
Definition at line 49 of file git_file_diff_area.h.
| using GIT_FILE_DIFF_AREA::MATERIALIZE = std::function<bool( KIGIT_COMMON&, GIT_DIFF_WORKSPACE&, GIT_FILE_SIDES& )> |
Writes the two sides on a worker with the session's action lock held.
Captures must not refer to widgets, frames or the project, which belong to the UI thread.
Definition at line 57 of file git_file_diff_area.h.
| GIT_FILE_DIFF_AREA::GIT_FILE_DIFF_AREA | ( | wxWindow * | aParent, |
| EDA_BASE_FRAME * | aFrame ) |
Definition at line 95 of file git_file_diff_area.cpp.
References _, KICAD_DIFF::DIFF_COLOR_THEME::added, m_afterCanvas, m_afterLabel, m_beforeCanvas, m_beforeLabel, m_canvasSplitter, m_frame, m_legend, m_note, m_textDiff, KICAD_DIFF::DIFF_COLOR_THEME::modified, and KICAD_DIFF::DIFF_COLOR_THEME::removed.
|
override |
Definition at line 144 of file git_file_diff_area.cpp.
References m_diffContext, and m_query.
| void GIT_FILE_DIFF_AREA::Clear | ( | ) |
Drop the documents and the drawing canvases.
Definition at line 153 of file git_file_diff_area.cpp.
References destroyCanvases(), and m_query.
|
private |
Definition at line 344 of file git_file_diff_area.cpp.
References m_afterCanvas, m_afterLabel, m_beforeCanvas, m_beforeLabel, m_canvasSplitter, and m_diffContext.
Referenced by Clear(), showNote(), and showTextDiff().
|
private |
The two drawing canvases exist only while a drawing is compared.
Each holds a GAL context, and a hidden one still paints over the text diff on macOS.
Definition at line 302 of file git_file_diff_area.cpp.
References followCanvas(), EDA_DRAW_PANEL_GAL::GAL_FALLBACK, m_afterCanvas, m_afterLabel, m_beforeCanvas, m_beforeLabel, m_canvasSplitter, and m_frame.
Referenced by showDrawingDiff().
|
private |
Give aFollower the view of aLead, so panning or zooming one moves both.
Definition at line 364 of file git_file_diff_area.cpp.
References KIGFX::VIEW::GetCenter(), KIGFX::VIEW::GetScale(), EDA_DRAW_PANEL_GAL::GetView(), m_afterCanvas, m_beforeCanvas, EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::VIEW::SetCenter(), and KIGFX::VIEW::SetScale().
Referenced by ensureCanvases().
|
private |
Definition at line 229 of file git_file_diff_area.cpp.
References _, GIT_FILE_SIDES::after, GIT_FILE_SIDES::before, GIT_FILE_SIDES::kind, KICAD_DIFF::PCB, KICAD_DIFF::SCH, showDrawingDiff(), showNote(), showTextDiff(), and KICAD_DIFF::UNKNOWN.
Referenced by ShowFile().
|
private |
Definition at line 257 of file git_file_diff_area.cpp.
References _, KICAD_DIFF::BuildScene(), KICAD_DIFF::SIDE_BY_SIDE_SCENES::comparison, KICAD_DIFF::DispatchAttachDiffCanvases(), KICAD_DIFF::DIFF_SCENE::docKind, ensureCanvases(), m_afterCanvas, m_afterLabel, m_beforeCanvas, m_beforeLabel, m_canvasSplitter, m_diffContext, m_frame, m_legend, m_note, m_textDiff, KICAD_DIFF::SIDE_BY_SIDE_SCENES::reference, reporter, showNote(), and KICAD_DIFF::SplitSceneBySide().
Referenced by showDiff().
| void GIT_FILE_DIFF_AREA::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.
Definition at line 160 of file git_file_diff_area.cpp.
References _, KIGIT::BuildTextDiff(), m_frame, m_query, result, showDiff(), showNote(), KIGIT::SplitTextLines(), KIGIT::TextLooksBinary(), and KICAD_DIFF::UNKNOWN.
|
private |
Definition at line 217 of file git_file_diff_area.cpp.
References destroyCanvases(), m_canvasSplitter, m_legend, m_note, and m_textDiff.
Referenced by showDiff(), showDrawingDiff(), and ShowFile().
|
private |
Definition at line 246 of file git_file_diff_area.cpp.
References destroyCanvases(), FillTextDiffControl(), m_canvasSplitter, m_legend, m_note, and m_textDiff.
Referenced by showDiff().
|
private |
Definition at line 88 of file git_file_diff_area.h.
Referenced by destroyCanvases(), ensureCanvases(), followCanvas(), GIT_FILE_DIFF_AREA(), and showDrawingDiff().
|
private |
Definition at line 86 of file git_file_diff_area.h.
Referenced by destroyCanvases(), ensureCanvases(), GIT_FILE_DIFF_AREA(), and showDrawingDiff().
|
private |
Definition at line 87 of file git_file_diff_area.h.
Referenced by destroyCanvases(), ensureCanvases(), followCanvas(), GIT_FILE_DIFF_AREA(), and showDrawingDiff().
|
private |
Definition at line 85 of file git_file_diff_area.h.
Referenced by destroyCanvases(), ensureCanvases(), GIT_FILE_DIFF_AREA(), and showDrawingDiff().
|
private |
Definition at line 84 of file git_file_diff_area.h.
Referenced by destroyCanvases(), ensureCanvases(), GIT_FILE_DIFF_AREA(), showDrawingDiff(), showNote(), and showTextDiff().
|
private |
The documents the two canvases draw, held by the kiface that loaded them.
Reset before the canvases go.
Definition at line 97 of file git_file_diff_area.h.
Referenced by destroyCanvases(), showDrawingDiff(), and ~GIT_FILE_DIFF_AREA().
|
private |
Definition at line 82 of file git_file_diff_area.h.
Referenced by ensureCanvases(), GIT_FILE_DIFF_AREA(), showDrawingDiff(), and ShowFile().
|
private |
Definition at line 90 of file git_file_diff_area.h.
Referenced by GIT_FILE_DIFF_AREA(), showDrawingDiff(), showNote(), and showTextDiff().
|
private |
Definition at line 83 of file git_file_diff_area.h.
Referenced by GIT_FILE_DIFF_AREA(), showDrawingDiff(), showNote(), and showTextDiff().
|
private |
A newer file selection discards any materialization still running for the previous one.
Definition at line 93 of file git_file_diff_area.h.
Referenced by Clear(), ShowFile(), and ~GIT_FILE_DIFF_AREA().
|
private |
Definition at line 89 of file git_file_diff_area.h.
Referenced by GIT_FILE_DIFF_AREA(), showDrawingDiff(), showNote(), and showTextDiff().