37#include <wx/docview.h>
38#include <wx/cmdline.h>
39#include <wx/imagpng.h>
41#include <boost/format.hpp>
72ProDe::
ProDe(): docManager_((wxDocManager*)NULL), options_(NULL) {
94 static const wxCmdLineEntryDesc cmdLineDesc[] = {
96#if wxCHECK_VERSION(3, 0, 0)
97 { wxCMD_LINE_PARAM,
"",
"",
"file", wxCMD_LINE_VAL_STRING,
98 wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
100 { wxCMD_LINE_NONE,
"",
"",
"", wxCMD_LINE_VAL_STRING, 0}
102 { wxCMD_LINE_PARAM, _T(
""), _T(
""), _T(
"file"), wxCMD_LINE_VAL_STRING,
103 wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
105 { wxCMD_LINE_NONE, _T(
""), _T(
""), _T(
""), wxCMD_LINE_VAL_STRING, 0}
110 wxCmdLineParser parser(cmdLineDesc, argc, argv);
111 int parserStatus = parser.Parse();
112 if (parserStatus != 0) {
118 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
119 _T(
"Architecture Definition"),
120 _T(
"*.adf;*.xml;*.cfg"), _T(
""),
121 _T(
"adf"), _T(
"Architecture Definition File"),
129 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
130 _T(
"Processor Configuration"),
132 _T(
"cfg"), _T(
"Architecture Definition File"),
134 CLASSINFO(
MDFView), wxTEMPLATE_INVISIBLE);
137 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
138 _T(
"Architecture Definition File"),
140 _T(
"xml"), _T(
"Architecture Definition File"),
142 CLASSINFO(
MDFView), wxTEMPLATE_INVISIBLE);
148 wxImage::AddHandler(
new wxPNGHandler);
162 bool erroneousOptions =
false;
171 <<
"Default options will be used." << endl;
172 erroneousOptions =
true;
175 if (erroneousOptions) {
188 wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
194 for (
unsigned int i = 0; i < parser.GetParamCount(); i++) {
195 wxString file = parser.GetParam(i);
196 wxDocument* doc =
docManager_->CreateDocument(file, wxDOC_SILENT);
200 std::cerr <<
"Improper file '"
202 <<
"' couldn't be opened."
205 std::cerr <<
"Cannot open file '"
const string TRUE
Value used for true in attribute and element values.
static MachInfoCmdLineOptions options
static std::string bitmapsDirPath(const std::string &prog)
static std::string dataDirPath(const std::string &prog)
static TCEString confPath(const std::string &fileName)
std::string errorMessage() const
static const std::string DIRECTORY_SEPARATOR
static bool fileExists(const std::string fileName)
ObjectState * readState()
void addKeyboardShortcut(KeyboardShortcut *shortcut)
void setToolbarVisibility(bool visible)
void addToolbarButton(ToolbarButton *button)
void setFullScreen(bool fullScreen)
void setWindowPosition(int x, int y)
void addSeparator(int position)
virtual void validate() const
@ BOTH
Buttons contains text and icon.
void setFileName(const std::string &fileName)
void setToolbarLayout(ToolbarLayout layout)
void setWindowSize(int width, int height)
static const std::string CMD_NAME_REDO
Command name for the "Redo" command.
static const std::string CMD_NAME_EDIT_OPTIONS
Command name for the "Edit Options" command.
static const std::string CMD_NAME_OPEN_DOC
Command name for the "Open Document" command.
static const std::string CMD_NAME_NEW_DOC
Command name for the "New Document" command.
static const wxString EDITOR_NAME
Full name of the Editor.
static const std::string CMD_NAME_SAVE_DOC
Command name for the "Save Document" command.
static const std::string CMD_NAME_UNDO
Command name for the "Undo" command.
static const std::string CMD_NAME_ZOOM_FIT_WIN
Command name for the "Fit Window" command.
static const std::string CMD_NAME_COPY
Command name for the "Copy" command.
static const std::string CMD_NAME_ZOOM_OUT
Command name for the "Zoom Out" command.
static const std::string CMD_NAME_PASTE
Command name for the "Paste" command.
static const std::string CMD_NAME_ZOOM_IN
Command name for the "Zoom In" command.
static const std::string CMD_NAME_QUIT
Command name for the "Quit" command.
static const std::string CMD_NAME_CUT
Command name for the "Cut" command.
static const std::string CMD_NAME_CLOSE_DOC
Command name for the "Close Document" command.
static const std::string CMD_NAME_MODIFY_COMP
Command name for the "Modify Component" command.
static const std::string CMD_NAME_PRINT
Command name for the "Print" command.
static const std::string CMD_NAME_DELETE_COMP
Command name for the "Delete Component" command.
void setUndoStackSize(int size)
void createDefaultOptions()
MainFrame * mainFrame() const
ProDeOptions * options_
editor options
wxDocManager * docManager() const
wxDocManager * docManager_
Manages multiple documents.
MainFrame * mainFrame_
Main frame of the application.
void setOptions(ProDeOptions *options)
CommandRegistry * commandRegistry_
editor command registry
static std::string bitmapsDirPath()
CommandRegistry * commandRegistry() const
ProDeOptions * options() const
static const std::string COMMAND_NAME
Command name string.
static char ** toCStringArray(size_t elements, wxChar **source)
static std::string toString(const wxString &source)
void setUseSchema(bool useSchema)
void setSchemaFile(const std::string &fileName)
void setSourceFile(const std::string &fileName)