31#include <wx/translation.h>
55wxString
OlderFormatNotice(
int aAncestorVersion,
int aOursVersion,
int aTheirsVersion,
int aCurrentVersion )
57 if( aAncestorVersion >= aCurrentVersion && aOursVersion >= aCurrentVersion && aTheirsVersion >= aCurrentVersion )
62 return _(
"One of the files being merged was written by an older version of KiCad.\n\n"
63 "The merged file is written in the current file format, whichever side is kept. "
64 "KiCad cannot write the older format back." );
69 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
70 bool aSingleFile,
REPORTER* aReporter )
72 typedef int ( *MERGE_FN )( int,
const wxString&,
const wxString&,
const wxString&,
73 const wxString&, bool, bool,
REPORTER* );
85 return fn(
static_cast<int>( aKind ), aAncestor, aOurs, aTheirs, aOutput, aInteractive,
86 aSingleFile, aReporter );
91 const wxString& aFileB,
const wxString& aLabelA,
const wxString& aLabelB,
92 wxWindow* aParent,
REPORTER* aReporter )
94 typedef int ( *OPEN_FN )( int,
const wxString&,
const wxString&,
const wxString&,
95 const wxString&, wxWindow*,
REPORTER* );
107 return fn(
static_cast<int>( aKind ), aFileA, aFileB, aLabelA, aLabelB, aParent, aReporter );
129 return std::unique_ptr<DIFF_CANVAS_CONTEXT>(
130 fn(
static_cast<int>( aKind ), aFileA, aFileB, &aBefore, &aAfter, &aDiff, aReporter ) );
Keeps the documents drawn on a pair of diff canvases alive.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
FACE_T
Known KIFACE implementations.
A pure virtual class used to derive REPORTER objects from.
@ KIFACE_MERGE_DOCUMENT
int (*)( int aKind, const wxString& aAncestor, const wxString& aOurs, const wxString& aTheirs,...
@ KIFACE_ATTACH_DIFF_CANVASES
KICAD_DIFF::DIFF_CANVAS_CONTEXT* (*)( int aKind, const wxString& aFileA, const wxString& aFileB,...
@ KIFACE_OPEN_DIFF_DIALOG
int (*)( int aKind, const wxString& aFileA, const wxString& aFileB, const wxString& aLabelA,...
static const int ERR_UNKNOWN
wxString OlderFormatNotice(int aAncestorVersion, int aOursVersion, int aTheirsVersion, int aCurrentVersion)
Empty when every side is already in the current file format.
std::unique_ptr< DIFF_CANVAS_CONTEXT > DispatchAttachDiffCanvases(KIWAY &aKiway, DOC_KIND aKind, const wxString &aFileA, const wxString &aFileB, WIDGET_DIFF_CANVAS &aBefore, WIDGET_DIFF_CANVAS &aAfter, DOCUMENT_DIFF &aDiff, REPORTER *aReporter)
Diff two files in the owning kiface through its KIFACE_ATTACH_DIFF_CANVASES export.
int DispatchMerge(KIWAY &aKiway, DOC_KIND aKind, const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive, bool aSingleFile, REPORTER *aReporter)
Run a 3-way document/library merge by calling the owning kiface's KIFACE_MERGE_DOCUMENT function expo...
DOC_KIND
Document type a diff/merge entry point should route to, derived from a file path's extension.
int DispatchOpenDiffDialog(KIWAY &aKiway, DOC_KIND aKind, const wxString &aFileA, const wxString &aFileB, const wxString &aLabelA, const wxString &aLabelB, wxWindow *aParent, REPORTER *aReporter)
Open DIALOG_KICAD_DIFF on two files by calling the owning kiface's KIFACE_OPEN_DIFF_DIALOG function e...
The full set of changes between two parsed documents of one type.
Implement a participant in the KIWAY alchemy.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)