Format source file with typo fixes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
ef73ad1c97
commit
6ec9871eca
|
@ -142,7 +142,7 @@ bool OPJViewerApp::OnInit(void)
|
||||||
|
|
||||||
wxChar **wxArgv = new wxChar *[argc + 1];
|
wxChar **wxArgv = new wxChar *[argc + 1];
|
||||||
|
|
||||||
for (n = 0; n < argc; n++ ) {
|
for (n = 0; n < argc; n++) {
|
||||||
wxMB2WXbuf warg = wxConvertMB2WX((char *) argv[n]);
|
wxMB2WXbuf warg = wxConvertMB2WX((char *) argv[n]);
|
||||||
wxArgv[n] = wxStrdup(warg);
|
wxArgv[n] = wxStrdup(warg);
|
||||||
}
|
}
|
||||||
|
@ -151,19 +151,22 @@ bool OPJViewerApp::OnInit(void)
|
||||||
|
|
||||||
#else // !wxUSE_UNICODE
|
#else // !wxUSE_UNICODE
|
||||||
|
|
||||||
#define wxArgv argv
|
#define wxArgv argv
|
||||||
|
|
||||||
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
||||||
|
|
||||||
#if wxUSE_CMDLINE_PARSER
|
#if wxUSE_CMDLINE_PARSER
|
||||||
|
|
||||||
static const wxCmdLineEntryDesc cmdLineDesc[] =
|
static const wxCmdLineEntryDesc cmdLineDesc[] = {
|
||||||
{
|
{
|
||||||
{ wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("show this help message"),
|
wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("show this help message"),
|
||||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
|
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
|
||||||
|
},
|
||||||
|
|
||||||
{ wxCMD_LINE_PARAM, NULL, NULL, _T("input file"),
|
{
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
|
wxCMD_LINE_PARAM, NULL, NULL, _T("input file"),
|
||||||
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE
|
||||||
|
},
|
||||||
|
|
||||||
{ wxCMD_LINE_NONE }
|
{ wxCMD_LINE_NONE }
|
||||||
};
|
};
|
||||||
|
@ -188,20 +191,20 @@ bool OPJViewerApp::OnInit(void)
|
||||||
|
|
||||||
//wxInitAllImageHandlers();
|
//wxInitAllImageHandlers();
|
||||||
#if wxUSE_LIBJPEG
|
#if wxUSE_LIBJPEG
|
||||||
wxImage::AddHandler( new wxJPEGHandler );
|
wxImage::AddHandler(new wxJPEGHandler);
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_LIBOPENJPEG
|
#if wxUSE_LIBOPENJPEG
|
||||||
wxImage::AddHandler( new wxJPEG2000Handler );
|
wxImage::AddHandler(new wxJPEG2000Handler);
|
||||||
#endif
|
#endif
|
||||||
#if USE_MXF
|
#if USE_MXF
|
||||||
wxImage::AddHandler( new wxMXFHandler );
|
wxImage::AddHandler(new wxMXFHandler);
|
||||||
#endif // USE_MXF
|
#endif // USE_MXF
|
||||||
#if OPJ_MANYFORMATS
|
#if OPJ_MANYFORMATS
|
||||||
wxImage::AddHandler( new wxBMPHandler );
|
wxImage::AddHandler(new wxBMPHandler);
|
||||||
wxImage::AddHandler( new wxPNGHandler );
|
wxImage::AddHandler(new wxPNGHandler);
|
||||||
wxImage::AddHandler( new wxGIFHandler );
|
wxImage::AddHandler(new wxGIFHandler);
|
||||||
wxImage::AddHandler( new wxPNMHandler );
|
wxImage::AddHandler(new wxPNMHandler);
|
||||||
wxImage::AddHandler( new wxTIFFHandler );
|
wxImage::AddHandler(new wxTIFFHandler);
|
||||||
#endif
|
#endif
|
||||||
// we use a XPM image in our HTML page
|
// we use a XPM image in our HTML page
|
||||||
wxImage::AddHandler(new wxXPMHandler);
|
wxImage::AddHandler(new wxXPMHandler);
|
||||||
|
@ -222,7 +225,8 @@ bool OPJViewerApp::OnInit(void)
|
||||||
OPJconfig->Read(wxT("decode/xxxframenum"), &m_framenum, (long) 0);
|
OPJconfig->Read(wxT("decode/xxxframenum"), &m_framenum, (long) 0);
|
||||||
#ifdef USE_JPWL
|
#ifdef USE_JPWL
|
||||||
OPJconfig->Read(wxT("decode/enablejpwl"), &m_enablejpwl, (bool) true);
|
OPJconfig->Read(wxT("decode/enablejpwl"), &m_enablejpwl, (bool) true);
|
||||||
OPJconfig->Read(wxT("decode/expcomps"), &m_expcomps, (long) JPWL_EXPECTED_COMPONENTS);
|
OPJconfig->Read(wxT("decode/expcomps"), &m_expcomps,
|
||||||
|
(long) JPWL_EXPECTED_COMPONENTS);
|
||||||
OPJconfig->Read(wxT("decode/maxtiles"), &m_maxtiles, (long) JPWL_MAXIMUM_TILES);
|
OPJconfig->Read(wxT("decode/maxtiles"), &m_maxtiles, (long) JPWL_MAXIMUM_TILES);
|
||||||
#endif // USE_JPWL
|
#endif // USE_JPWL
|
||||||
|
|
||||||
|
@ -239,7 +243,8 @@ bool OPJViewerApp::OnInit(void)
|
||||||
OPJconfig->Read(wxT("frameheight"), &m_frameheight, (long) OPJ_FRAME_HEIGHT);
|
OPJconfig->Read(wxT("frameheight"), &m_frameheight, (long) OPJ_FRAME_HEIGHT);
|
||||||
|
|
||||||
// load encoding engine parameters
|
// load encoding engine parameters
|
||||||
OPJconfig->Read(wxT("encode/subsampling"), &m_subsampling, (wxString) wxT("1,1"));
|
OPJconfig->Read(wxT("encode/subsampling"), &m_subsampling,
|
||||||
|
(wxString) wxT("1,1"));
|
||||||
OPJconfig->Read(wxT("encode/origin"), &m_origin, (wxString) wxT("0,0"));
|
OPJconfig->Read(wxT("encode/origin"), &m_origin, (wxString) wxT("0,0"));
|
||||||
OPJconfig->Read(wxT("encode/rates"), &m_rates, (wxString) wxT("20,10,5"));
|
OPJconfig->Read(wxT("encode/rates"), &m_rates, (wxString) wxT("20,10,5"));
|
||||||
OPJconfig->Read(wxT("encode/quality"), &m_quality, (wxString) wxT("30,35,40"));
|
OPJconfig->Read(wxT("encode/quality"), &m_quality, (wxString) wxT("30,35,40"));
|
||||||
|
@ -249,7 +254,8 @@ bool OPJViewerApp::OnInit(void)
|
||||||
OPJconfig->Read(wxT("encode/resolutions"), &m_resolutions, (int) 6);
|
OPJconfig->Read(wxT("encode/resolutions"), &m_resolutions, (int) 6);
|
||||||
OPJconfig->Read(wxT("encode/progression"), &m_progression, (int) 0);
|
OPJconfig->Read(wxT("encode/progression"), &m_progression, (int) 0);
|
||||||
OPJconfig->Read(wxT("encode/cbsize"), &m_cbsize, (wxString) wxT("32,32"));
|
OPJconfig->Read(wxT("encode/cbsize"), &m_cbsize, (wxString) wxT("32,32"));
|
||||||
OPJconfig->Read(wxT("encode/prsize"), &m_prsize, (wxString) wxT("[128,128],[128,128]"));
|
OPJconfig->Read(wxT("encode/prsize"), &m_prsize,
|
||||||
|
(wxString) wxT("[128,128],[128,128]"));
|
||||||
OPJconfig->Read(wxT("encode/tsize"), &m_tsize, (wxString) wxT(""));
|
OPJconfig->Read(wxT("encode/tsize"), &m_tsize, (wxString) wxT(""));
|
||||||
OPJconfig->Read(wxT("encode/torigin"), &m_torigin, (wxString) wxT("0,0"));
|
OPJconfig->Read(wxT("encode/torigin"), &m_torigin, (wxString) wxT("0,0"));
|
||||||
OPJconfig->Read(wxT("encode/enablesop"), &m_enablesop, (bool) false);
|
OPJconfig->Read(wxT("encode/enablesop"), &m_enablesop, (bool) false);
|
||||||
|
@ -263,19 +269,27 @@ bool OPJViewerApp::OnInit(void)
|
||||||
OPJconfig->Read(wxT("encode/enablecomm"), &m_enablecomm, (bool) true);
|
OPJconfig->Read(wxT("encode/enablecomm"), &m_enablecomm, (bool) true);
|
||||||
OPJconfig->Read(wxT("encode/enablepoc"), &m_enablepoc, (bool) false);
|
OPJconfig->Read(wxT("encode/enablepoc"), &m_enablepoc, (bool) false);
|
||||||
OPJconfig->Read(wxT("encode/comment"), &m_comment, (wxString) wxT(""));
|
OPJconfig->Read(wxT("encode/comment"), &m_comment, (wxString) wxT(""));
|
||||||
OPJconfig->Read(wxT("encode/poc"), &m_poc, (wxString) wxT("T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL"));
|
OPJconfig->Read(wxT("encode/poc"), &m_poc,
|
||||||
|
(wxString) wxT("T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL"));
|
||||||
OPJconfig->Read(wxT("encode/enableidx"), &m_enableidx, (bool) false);
|
OPJconfig->Read(wxT("encode/enableidx"), &m_enableidx, (bool) false);
|
||||||
OPJconfig->Read(wxT("encode/index"), &m_index, (wxString) wxT("index.txt"));
|
OPJconfig->Read(wxT("encode/index"), &m_index, (wxString) wxT("index.txt"));
|
||||||
#ifdef USE_JPWL
|
#ifdef USE_JPWL
|
||||||
OPJconfig->Read(wxT("encode/enablejpwl"), &m_enablejpwle, (bool) true);
|
OPJconfig->Read(wxT("encode/enablejpwl"), &m_enablejpwle, (bool) true);
|
||||||
for (n = 0; n < MYJPWL_MAX_NO_TILESPECS; n++) {
|
for (n = 0; n < MYJPWL_MAX_NO_TILESPECS; n++) {
|
||||||
OPJconfig->Read(wxT("encode/jpwl/hprotsel") + wxString::Format(wxT("%02d"), n), &m_hprotsel[n], 0);
|
OPJconfig->Read(wxT("encode/jpwl/hprotsel") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Read(wxT("encode/jpwl/htileval") + wxString::Format(wxT("%02d"), n), &m_htileval[n], 0);
|
&m_hprotsel[n], 0);
|
||||||
OPJconfig->Read(wxT("encode/jpwl/pprotsel") + wxString::Format(wxT("%02d"), n), &m_pprotsel[n], 0);
|
OPJconfig->Read(wxT("encode/jpwl/htileval") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Read(wxT("encode/jpwl/ptileval") + wxString::Format(wxT("%02d"), n), &m_ptileval[n], 0);
|
&m_htileval[n], 0);
|
||||||
OPJconfig->Read(wxT("encode/jpwl/ppackval") + wxString::Format(wxT("%02d"), n), &m_ppackval[n], 0);
|
OPJconfig->Read(wxT("encode/jpwl/pprotsel") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Read(wxT("encode/jpwl/sensisel") + wxString::Format(wxT("%02d"), n), &m_sensisel[n], 0);
|
&m_pprotsel[n], 0);
|
||||||
OPJconfig->Read(wxT("encode/jpwl/stileval") + wxString::Format(wxT("%02d"), n), &m_stileval[n], 0);
|
OPJconfig->Read(wxT("encode/jpwl/ptileval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
&m_ptileval[n], 0);
|
||||||
|
OPJconfig->Read(wxT("encode/jpwl/ppackval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
&m_ppackval[n], 0);
|
||||||
|
OPJconfig->Read(wxT("encode/jpwl/sensisel") + wxString::Format(wxT("%02d"), n),
|
||||||
|
&m_sensisel[n], 0);
|
||||||
|
OPJconfig->Read(wxT("encode/jpwl/stileval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
&m_stileval[n], 0);
|
||||||
}
|
}
|
||||||
#endif // USE_JPWL
|
#endif // USE_JPWL
|
||||||
|
|
||||||
|
@ -311,8 +325,8 @@ bool OPJViewerApp::OnInit(void)
|
||||||
m_irreversible = false;
|
m_irreversible = false;
|
||||||
m_resolutions = 6;
|
m_resolutions = 6;
|
||||||
m_progression = 0;
|
m_progression = 0;
|
||||||
m_cbsize= wxT("32,32");
|
m_cbsize = wxT("32,32");
|
||||||
m_prsize= wxT("[128,128],[128,128]");
|
m_prsize = wxT("[128,128],[128,128]");
|
||||||
m_tsize = wxT("");
|
m_tsize = wxT("");
|
||||||
m_torigin = wxT("0,0");
|
m_torigin = wxT("0,0");
|
||||||
m_enablesop = false;
|
m_enablesop = false;
|
||||||
|
@ -444,13 +458,20 @@ int OPJViewerApp::OnExit()
|
||||||
#ifdef USE_JPWL
|
#ifdef USE_JPWL
|
||||||
OPJconfig->Write(wxT("encode/enablejpwl"), m_enablejpwle);
|
OPJconfig->Write(wxT("encode/enablejpwl"), m_enablejpwle);
|
||||||
for (n = 0; n < MYJPWL_MAX_NO_TILESPECS; n++) {
|
for (n = 0; n < MYJPWL_MAX_NO_TILESPECS; n++) {
|
||||||
OPJconfig->Write(wxT("encode/jpwl/hprotsel") + wxString::Format(wxT("%02d"), n), m_hprotsel[n]);
|
OPJconfig->Write(wxT("encode/jpwl/hprotsel") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Write(wxT("encode/jpwl/htileval") + wxString::Format(wxT("%02d"), n), m_htileval[n]);
|
m_hprotsel[n]);
|
||||||
OPJconfig->Write(wxT("encode/jpwl/pprotsel") + wxString::Format(wxT("%02d"), n), m_pprotsel[n]);
|
OPJconfig->Write(wxT("encode/jpwl/htileval") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Write(wxT("encode/jpwl/ptileval") + wxString::Format(wxT("%02d"), n), m_ptileval[n]);
|
m_htileval[n]);
|
||||||
OPJconfig->Write(wxT("encode/jpwl/ppackval") + wxString::Format(wxT("%02d"), n), m_ppackval[n]);
|
OPJconfig->Write(wxT("encode/jpwl/pprotsel") + wxString::Format(wxT("%02d"), n),
|
||||||
OPJconfig->Write(wxT("encode/jpwl/sensisel") + wxString::Format(wxT("%02d"), n), m_sensisel[n]);
|
m_pprotsel[n]);
|
||||||
OPJconfig->Write(wxT("encode/jpwl/stileval") + wxString::Format(wxT("%02d"), n), m_stileval[n]);
|
OPJconfig->Write(wxT("encode/jpwl/ptileval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
m_ptileval[n]);
|
||||||
|
OPJconfig->Write(wxT("encode/jpwl/ppackval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
m_ppackval[n]);
|
||||||
|
OPJconfig->Write(wxT("encode/jpwl/sensisel") + wxString::Format(wxT("%02d"), n),
|
||||||
|
m_sensisel[n]);
|
||||||
|
OPJconfig->Write(wxT("encode/jpwl/stileval") + wxString::Format(wxT("%02d"), n),
|
||||||
|
m_stileval[n]);
|
||||||
}
|
}
|
||||||
#endif // USE_JPWL
|
#endif // USE_JPWL
|
||||||
|
|
||||||
|
@ -503,7 +524,8 @@ BEGIN_EVENT_TABLE(OPJFrame, wxMDIParentFrame)
|
||||||
EVT_MENU(OPJFRAME_FILETOGGLET, OPJFrame::OnToggleToolbar)
|
EVT_MENU(OPJFRAME_FILETOGGLET, OPJFrame::OnToggleToolbar)
|
||||||
EVT_MENU(OPJFRAME_SETSENCO, OPJFrame::OnSetsEnco)
|
EVT_MENU(OPJFRAME_SETSENCO, OPJFrame::OnSetsEnco)
|
||||||
EVT_MENU(OPJFRAME_SETSDECO, OPJFrame::OnSetsDeco)
|
EVT_MENU(OPJFRAME_SETSDECO, OPJFrame::OnSetsDeco)
|
||||||
EVT_SASH_DRAGGED_RANGE(OPJFRAME_BROWSEWIN, OPJFRAME_LOGWIN, OPJFrame::OnSashDrag)
|
EVT_SASH_DRAGGED_RANGE(OPJFRAME_BROWSEWIN, OPJFRAME_LOGWIN,
|
||||||
|
OPJFrame::OnSashDrag)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(LEFT_NOTEBOOK_ID, OPJFrame::OnNotebook)
|
EVT_NOTEBOOK_PAGE_CHANGED(LEFT_NOTEBOOK_ID, OPJFrame::OnNotebook)
|
||||||
EVT_MENU(OPJFRAME_THREADLOGMSG, OPJFrame::OnThreadLogmsg)
|
EVT_MENU(OPJFRAME_THREADLOGMSG, OPJFrame::OnThreadLogmsg)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
@ -534,10 +556,12 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
file_menu->AppendSeparator();
|
file_menu->AppendSeparator();
|
||||||
|
|
||||||
file_menu->Append(OPJFRAME_FILETOGGLEB, wxT("Toggle &browser\tCtrl+B"));
|
file_menu->Append(OPJFRAME_FILETOGGLEB, wxT("Toggle &browser\tCtrl+B"));
|
||||||
file_menu->SetHelpString(OPJFRAME_FILETOGGLEB, wxT("Toggle the left browsing pane"));
|
file_menu->SetHelpString(OPJFRAME_FILETOGGLEB,
|
||||||
|
wxT("Toggle the left browsing pane"));
|
||||||
|
|
||||||
file_menu->Append(OPJFRAME_FILETOGGLEP, wxT("Toggle &peeker\tCtrl+P"));
|
file_menu->Append(OPJFRAME_FILETOGGLEP, wxT("Toggle &peeker\tCtrl+P"));
|
||||||
file_menu->SetHelpString(OPJFRAME_FILETOGGLEP, wxT("Toggle the bottom peeking pane"));
|
file_menu->SetHelpString(OPJFRAME_FILETOGGLEP,
|
||||||
|
wxT("Toggle the bottom peeking pane"));
|
||||||
|
|
||||||
file_menu->Append(OPJFRAME_FILETOGGLET, wxT("Toggle &toolbar\tCtrl+T"));
|
file_menu->Append(OPJFRAME_FILETOGGLET, wxT("Toggle &toolbar\tCtrl+T"));
|
||||||
file_menu->SetHelpString(OPJFRAME_FILETOGGLET, wxT("Toggle the toolbar"));
|
file_menu->SetHelpString(OPJFRAME_FILETOGGLET, wxT("Toggle the toolbar"));
|
||||||
|
@ -642,30 +666,38 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpZoom = wxArtProvider::GetBitmap(wxART_FIND, wxART_TOOLBAR,
|
wxBitmap bmpZoom = wxArtProvider::GetBitmap(wxART_FIND, wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpFit = wxArtProvider::GetBitmap(wxART_FIND_AND_REPLACE, wxART_TOOLBAR,
|
wxBitmap bmpFit = wxArtProvider::GetBitmap(wxART_FIND_AND_REPLACE,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpReload = wxArtProvider::GetBitmap(wxART_EXECUTABLE_FILE, wxART_TOOLBAR,
|
wxBitmap bmpReload = wxArtProvider::GetBitmap(wxART_EXECUTABLE_FILE,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpDecosettings = wxArtProvider::GetBitmap(wxART_REPORT_VIEW, wxART_TOOLBAR,
|
wxBitmap bmpDecosettings = wxArtProvider::GetBitmap(wxART_REPORT_VIEW,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpEncosettings = wxArtProvider::GetBitmap(wxART_LIST_VIEW, wxART_TOOLBAR,
|
wxBitmap bmpEncosettings = wxArtProvider::GetBitmap(wxART_LIST_VIEW,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpPrevframe = wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_TOOLBAR,
|
wxBitmap bmpPrevframe = wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpHomeframe = wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_TOOLBAR,
|
wxBitmap bmpHomeframe = wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpNextframe = wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_TOOLBAR,
|
wxBitmap bmpNextframe = wxArtProvider::GetBitmap(wxART_GO_FORWARD,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpLesslayers = bmpPrevframe;
|
wxBitmap bmpLesslayers = bmpPrevframe;
|
||||||
wxBitmap bmpAlllayers = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_TOOLBAR,
|
wxBitmap bmpAlllayers = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpMorelayers = bmpNextframe;
|
wxBitmap bmpMorelayers = bmpNextframe;
|
||||||
wxBitmap bmpLessres = bmpPrevframe;
|
wxBitmap bmpLessres = bmpPrevframe;
|
||||||
wxBitmap bmpFullres = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_TOOLBAR,
|
wxBitmap bmpFullres = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpMoreres = bmpNextframe;
|
wxBitmap bmpMoreres = bmpNextframe;
|
||||||
wxBitmap bmpPrevcomp = bmpPrevframe;
|
wxBitmap bmpPrevcomp = bmpPrevframe;
|
||||||
wxBitmap bmpAllcomps = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_TOOLBAR,
|
wxBitmap bmpAllcomps = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT,
|
||||||
|
wxART_TOOLBAR,
|
||||||
wxDefaultSize);
|
wxDefaultSize);
|
||||||
wxBitmap bmpNextcomp = bmpNextframe;
|
wxBitmap bmpNextcomp = bmpNextframe;
|
||||||
|
|
||||||
|
@ -684,15 +716,19 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWHOMEFRAME, bmpHomeframe, wxT("Starting frame"));
|
tool_bar->AddTool(OPJFRAME_VIEWHOMEFRAME, bmpHomeframe, wxT("Starting frame"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWNEXTFRAME, bmpNextframe, wxT("Next frame"));
|
tool_bar->AddTool(OPJFRAME_VIEWNEXTFRAME, bmpNextframe, wxT("Next frame"));
|
||||||
tool_bar->AddSeparator();
|
tool_bar->AddSeparator();
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWLESSLAYERS, bmpLesslayers, wxT("Remove a layer"));
|
tool_bar->AddTool(OPJFRAME_VIEWLESSLAYERS, bmpLesslayers,
|
||||||
|
wxT("Remove a layer"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWALLLAYERS, bmpAlllayers, wxT("Show all layers"));
|
tool_bar->AddTool(OPJFRAME_VIEWALLLAYERS, bmpAlllayers, wxT("Show all layers"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWMORELAYERS, bmpMorelayers, wxT("Add a layer"));
|
tool_bar->AddTool(OPJFRAME_VIEWMORELAYERS, bmpMorelayers, wxT("Add a layer"));
|
||||||
tool_bar->AddSeparator();
|
tool_bar->AddSeparator();
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWLESSRES, bmpLessres, wxT("Reduce the resolution"));
|
tool_bar->AddTool(OPJFRAME_VIEWLESSRES, bmpLessres,
|
||||||
|
wxT("Reduce the resolution"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWFULLRES, bmpFullres, wxT("Full resolution"));
|
tool_bar->AddTool(OPJFRAME_VIEWFULLRES, bmpFullres, wxT("Full resolution"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWMORERES, bmpMoreres, wxT("Increase the resolution"));
|
tool_bar->AddTool(OPJFRAME_VIEWMORERES, bmpMoreres,
|
||||||
|
wxT("Increase the resolution"));
|
||||||
tool_bar->AddSeparator();
|
tool_bar->AddSeparator();
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWPREVCOMP, bmpPrevcomp, wxT("Previous component"));
|
tool_bar->AddTool(OPJFRAME_VIEWPREVCOMP, bmpPrevcomp,
|
||||||
|
wxT("Previous component"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWALLCOMPS, bmpAllcomps, wxT("All components"));
|
tool_bar->AddTool(OPJFRAME_VIEWALLCOMPS, bmpAllcomps, wxT("All components"));
|
||||||
tool_bar->AddTool(OPJFRAME_VIEWNEXTCOMP, bmpNextcomp, wxT("Next component"));
|
tool_bar->AddTool(OPJFRAME_VIEWNEXTCOMP, bmpNextcomp, wxT("Next component"));
|
||||||
tool_bar->Realize();
|
tool_bar->Realize();
|
||||||
|
@ -701,10 +737,11 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
SetToolBar(tool_bar);
|
SetToolBar(tool_bar);
|
||||||
|
|
||||||
// show the toolbar?
|
// show the toolbar?
|
||||||
if (!wxGetApp().m_showtoolbar)
|
if (!wxGetApp().m_showtoolbar) {
|
||||||
tool_bar->Show(false);
|
tool_bar->Show(false);
|
||||||
else
|
} else {
|
||||||
tool_bar->Show(true);
|
tool_bar->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
// the logging window
|
// the logging window
|
||||||
loggingWindow = new wxSashLayoutWindow(this, OPJFRAME_LOGWIN,
|
loggingWindow = new wxSashLayoutWindow(this, OPJFRAME_LOGWIN,
|
||||||
|
@ -718,10 +755,11 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
loggingWindow->SetSashVisible(wxSASH_TOP, true);
|
loggingWindow->SetSashVisible(wxSASH_TOP, true);
|
||||||
|
|
||||||
// show the logging?
|
// show the logging?
|
||||||
if (!wxGetApp().m_showpeeker)
|
if (!wxGetApp().m_showpeeker) {
|
||||||
loggingWindow->Show(false);
|
loggingWindow->Show(false);
|
||||||
else
|
} else {
|
||||||
loggingWindow->Show(true);
|
loggingWindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
// create the bottom notebook
|
// create the bottom notebook
|
||||||
m_bookCtrlbottom = new wxNotebook(loggingWindow, BOTTOM_NOTEBOOK_ID,
|
m_bookCtrlbottom = new wxNotebook(loggingWindow, BOTTOM_NOTEBOOK_ID,
|
||||||
|
@ -745,7 +783,8 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
);
|
);
|
||||||
wxFont *browsefont = new wxFont(wxNORMAL_FONT->GetPointSize(),
|
wxFont *browsefont = new wxFont(wxNORMAL_FONT->GetPointSize(),
|
||||||
wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
m_textCtrlbrowse->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, *browsefont));
|
m_textCtrlbrowse->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour,
|
||||||
|
*browsefont));
|
||||||
m_textCtrlbrowse->AppendText(wxT("Browsing window\n"));
|
m_textCtrlbrowse->AppendText(wxT("Browsing window\n"));
|
||||||
|
|
||||||
// add it the notebook
|
// add it the notebook
|
||||||
|
@ -769,10 +808,11 @@ OPJFrame::OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||||
wxBK_TOP);
|
wxBK_TOP);
|
||||||
|
|
||||||
// show the browser?
|
// show the browser?
|
||||||
if (!wxGetApp().m_showbrowser)
|
if (!wxGetApp().m_showbrowser) {
|
||||||
markerTreeWindow->Show(false);
|
markerTreeWindow->Show(false);
|
||||||
else
|
} else {
|
||||||
markerTreeWindow->Show(true);
|
markerTreeWindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
// For some reason, we get a memcpy crash in wxLogStream::DoLogStream
|
// For some reason, we get a memcpy crash in wxLogStream::DoLogStream
|
||||||
|
@ -819,8 +859,9 @@ void OPJFrame::OnNotebook(wxNotebookEvent& event)
|
||||||
|
|
||||||
m_bookCtrl->GetPageText(sel).ToLong(&childnum);
|
m_bookCtrl->GetPageText(sel).ToLong(&childnum);
|
||||||
|
|
||||||
if (m_childhash[childnum])
|
if (m_childhash[childnum]) {
|
||||||
m_childhash[childnum]->Activate();
|
m_childhash[childnum]->Activate();
|
||||||
|
}
|
||||||
|
|
||||||
//wxLogMessage(wxT("Selection changed (now %d --> %d)"), childnum, m_childhash[childnum]->m_winnumber);
|
//wxLogMessage(wxT("Selection changed (now %d --> %d)"), childnum, m_childhash[childnum]->m_winnumber);
|
||||||
|
|
||||||
|
@ -916,8 +957,9 @@ void OPJFrame::OnClose(wxCommandEvent& WXUNUSED(event))
|
||||||
// current frame
|
// current frame
|
||||||
OPJChildFrame *currframe = (OPJChildFrame *) GetActiveChild();
|
OPJChildFrame *currframe = (OPJChildFrame *) GetActiveChild();
|
||||||
|
|
||||||
if (!currframe)
|
if (!currframe) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wxCloseEvent e;
|
wxCloseEvent e;
|
||||||
currframe->OnClose(e);
|
currframe->OnClose(e);
|
||||||
|
@ -938,8 +980,9 @@ void OPJFrame::OnFit(wxCommandEvent& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// problems
|
// problems
|
||||||
if (!currchild)
|
if (!currchild) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// current canvas
|
// current canvas
|
||||||
OPJCanvas *currcanvas = currchild->m_canvas;
|
OPJCanvas *currcanvas = currchild->m_canvas;
|
||||||
|
@ -960,8 +1003,9 @@ void OPJFrame::OnZoom(wxCommandEvent& WXUNUSED(event))
|
||||||
// current frame
|
// current frame
|
||||||
OPJChildFrame *currframe = (OPJChildFrame *) GetActiveChild();
|
OPJChildFrame *currframe = (OPJChildFrame *) GetActiveChild();
|
||||||
|
|
||||||
if (!currframe)
|
if (!currframe) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// get the preferred zoom
|
// get the preferred zoom
|
||||||
long zooml = wxGetNumberFromUser(wxT("Choose a scale between 5% and 300%"),
|
long zooml = wxGetNumberFromUser(wxT("Choose a scale between 5% and 300%"),
|
||||||
|
@ -992,15 +1036,17 @@ void OPJFrame::Rescale(int zooml, OPJChildFrame *currframe)
|
||||||
int wzooml, hzooml;
|
int wzooml, hzooml;
|
||||||
//wxSize clientsize = currframe->m_canvas->GetClientSize();
|
//wxSize clientsize = currframe->m_canvas->GetClientSize();
|
||||||
wxSize clientsize = currframe->m_frame->GetActiveChild()->GetClientSize();
|
wxSize clientsize = currframe->m_frame->GetActiveChild()->GetClientSize();
|
||||||
wzooml = (int) floor(100.0 * (double) clientsize.GetWidth() / (double) (2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetWidth()));
|
wzooml = (int) floor(100.0 * (double) clientsize.GetWidth() / (double)(
|
||||||
hzooml = (int) floor(100.0 * (double) clientsize.GetHeight() / (double) (2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetHeight()));
|
2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetWidth()));
|
||||||
|
hzooml = (int) floor(100.0 * (double) clientsize.GetHeight() / (double)(
|
||||||
|
2 * OPJ_CANVAS_BORDER + currframe->m_canvas->m_image100.GetHeight()));
|
||||||
zooml = wxMin(100, wxMin(wzooml, hzooml));
|
zooml = wxMin(100, wxMin(wzooml, hzooml));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zooml != 100)
|
if (zooml != 100)
|
||||||
new_image.Rescale((int) ((double) zooml * (double) new_image.GetWidth() / 100.0),
|
new_image.Rescale((int)((double) zooml * (double) new_image.GetWidth() / 100.0),
|
||||||
(int) ((double) zooml * (double) new_image.GetHeight() / 100.0),
|
(int)((double) zooml * (double) new_image.GetHeight() / 100.0),
|
||||||
wxGetApp().m_resizemethod ? wxIMAGE_QUALITY_HIGH : wxIMAGE_QUALITY_NORMAL);
|
wxGetApp().m_resizemethod ? wxIMAGE_QUALITY_HIGH : wxIMAGE_QUALITY_NORMAL);
|
||||||
currframe->m_canvas->m_image = wxBitmap(new_image);
|
currframe->m_canvas->m_image = wxBitmap(new_image);
|
||||||
currframe->m_canvas->SetScrollbars(20,
|
currframe->m_canvas->SetScrollbars(20,
|
||||||
|
@ -1025,10 +1071,11 @@ void OPJFrame::OnReload(wxCommandEvent& event)
|
||||||
if (currframe) {
|
if (currframe) {
|
||||||
OPJDecoThread *dthread = currframe->m_canvas->CreateDecoThread();
|
OPJDecoThread *dthread = currframe->m_canvas->CreateDecoThread();
|
||||||
|
|
||||||
if (dthread->Run() != wxTHREAD_NO_ERROR)
|
if (dthread->Run() != wxTHREAD_NO_ERROR) {
|
||||||
wxLogMessage(wxT("Can't start deco thread!"));
|
wxLogMessage(wxT("Can't start deco thread!"));
|
||||||
else
|
} else {
|
||||||
wxLogMessage(wxT("New deco thread started."));
|
wxLogMessage(wxT("New deco thread started."));
|
||||||
|
}
|
||||||
|
|
||||||
currframe->m_canvas->Refresh();
|
currframe->m_canvas->Refresh();
|
||||||
|
|
||||||
|
@ -1039,8 +1086,9 @@ void OPJFrame::OnReload(wxCommandEvent& event)
|
||||||
|
|
||||||
void OPJFrame::OnPrevFrame(wxCommandEvent& event)
|
void OPJFrame::OnPrevFrame(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (--wxGetApp().m_framenum < 0)
|
if (--wxGetApp().m_framenum < 0) {
|
||||||
wxGetApp().m_framenum = 0;
|
wxGetApp().m_framenum = 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxCommandEvent e;
|
wxCommandEvent e;
|
||||||
OnReload(e);
|
OnReload(e);
|
||||||
|
@ -1064,8 +1112,9 @@ void OPJFrame::OnNextFrame(wxCommandEvent& event)
|
||||||
|
|
||||||
void OPJFrame::OnLessLayers(wxCommandEvent& event)
|
void OPJFrame::OnLessLayers(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (--wxGetApp().m_qualitylayers < 1)
|
if (--wxGetApp().m_qualitylayers < 1) {
|
||||||
wxGetApp().m_qualitylayers = 1;
|
wxGetApp().m_qualitylayers = 1;
|
||||||
|
}
|
||||||
|
|
||||||
wxCommandEvent e;
|
wxCommandEvent e;
|
||||||
OnReload(e);
|
OnReload(e);
|
||||||
|
@ -1105,8 +1154,9 @@ void OPJFrame::OnFullRes(wxCommandEvent& event)
|
||||||
|
|
||||||
void OPJFrame::OnMoreRes(wxCommandEvent& event)
|
void OPJFrame::OnMoreRes(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (--wxGetApp().m_reducefactor < 0)
|
if (--wxGetApp().m_reducefactor < 0) {
|
||||||
wxGetApp().m_reducefactor = 0;
|
wxGetApp().m_reducefactor = 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxCommandEvent e;
|
wxCommandEvent e;
|
||||||
OnReload(e);
|
OnReload(e);
|
||||||
|
@ -1114,8 +1164,9 @@ void OPJFrame::OnMoreRes(wxCommandEvent& event)
|
||||||
|
|
||||||
void OPJFrame::OnPrevComp(wxCommandEvent& event)
|
void OPJFrame::OnPrevComp(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (--wxGetApp().m_components < 1)
|
if (--wxGetApp().m_components < 1) {
|
||||||
wxGetApp().m_components = 1;
|
wxGetApp().m_components = 1;
|
||||||
|
}
|
||||||
|
|
||||||
wxCommandEvent e;
|
wxCommandEvent e;
|
||||||
OnReload(e);
|
OnReload(e);
|
||||||
|
@ -1139,10 +1190,11 @@ void OPJFrame::OnNextComp(wxCommandEvent& event)
|
||||||
|
|
||||||
void OPJFrame::OnToggleBrowser(wxCommandEvent& WXUNUSED(event))
|
void OPJFrame::OnToggleBrowser(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if (markerTreeWindow->IsShown())
|
if (markerTreeWindow->IsShown()) {
|
||||||
markerTreeWindow->Show(false);
|
markerTreeWindow->Show(false);
|
||||||
else
|
} else {
|
||||||
markerTreeWindow->Show(true);
|
markerTreeWindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
@ -1155,10 +1207,11 @@ void OPJFrame::OnToggleBrowser(wxCommandEvent& WXUNUSED(event))
|
||||||
|
|
||||||
void OPJFrame::OnTogglePeeker(wxCommandEvent& WXUNUSED(event))
|
void OPJFrame::OnTogglePeeker(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if (loggingWindow->IsShown())
|
if (loggingWindow->IsShown()) {
|
||||||
loggingWindow->Show(false);
|
loggingWindow->Show(false);
|
||||||
else
|
} else {
|
||||||
loggingWindow->Show(true);
|
loggingWindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
@ -1171,10 +1224,11 @@ void OPJFrame::OnTogglePeeker(wxCommandEvent& WXUNUSED(event))
|
||||||
|
|
||||||
void OPJFrame::OnToggleToolbar(wxCommandEvent& WXUNUSED(event))
|
void OPJFrame::OnToggleToolbar(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if (tool_bar->IsShown())
|
if (tool_bar->IsShown()) {
|
||||||
tool_bar->Show(false);
|
tool_bar->Show(false);
|
||||||
else
|
} else {
|
||||||
tool_bar->Show(true);
|
tool_bar->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
@ -1189,17 +1243,16 @@ void OPJFrame::OnSashDrag(wxSashEvent& event)
|
||||||
{
|
{
|
||||||
int wid, hei;
|
int wid, hei;
|
||||||
|
|
||||||
if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE)
|
if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (event.GetId()) {
|
switch (event.GetId()) {
|
||||||
case OPJFRAME_BROWSEWIN:
|
case OPJFRAME_BROWSEWIN: {
|
||||||
{
|
|
||||||
markerTreeWindow->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
markerTreeWindow->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OPJFRAME_LOGWIN:
|
case OPJFRAME_LOGWIN: {
|
||||||
{
|
|
||||||
loggingWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
|
loggingWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1227,8 +1280,7 @@ void OPJFrame::OnThreadLogmsg(wxCommandEvent& event)
|
||||||
wxLogMessage(event.GetString());
|
wxLogMessage(event.GetString());
|
||||||
#else
|
#else
|
||||||
int n = event.GetInt();
|
int n = event.GetInt();
|
||||||
if ( n == -1 )
|
if (n == -1) {
|
||||||
{
|
|
||||||
m_dlgProgress->Destroy();
|
m_dlgProgress->Destroy();
|
||||||
m_dlgProgress = (wxProgressDialog *)NULL;
|
m_dlgProgress = (wxProgressDialog *)NULL;
|
||||||
|
|
||||||
|
@ -1236,11 +1288,8 @@ void OPJFrame::OnThreadLogmsg(wxCommandEvent& event)
|
||||||
// we may need to wake up the main event loop for the dialog to be
|
// we may need to wake up the main event loop for the dialog to be
|
||||||
// really closed
|
// really closed
|
||||||
wxWakeUpIdle();
|
wxWakeUpIdle();
|
||||||
}
|
} else {
|
||||||
else
|
if (!m_dlgProgress->Update(n)) {
|
||||||
{
|
|
||||||
if ( !m_dlgProgress->Update(n) )
|
|
||||||
{
|
|
||||||
wxCriticalSectionLocker lock(m_critsectWork);
|
wxCriticalSectionLocker lock(m_critsectWork);
|
||||||
|
|
||||||
m_cancelled = true;
|
m_cancelled = true;
|
||||||
|
@ -1258,11 +1307,13 @@ void OPJFrame::SaveFile(wxArrayString paths, wxArrayString filenames)
|
||||||
|
|
||||||
if (wxFile::Exists(paths[0].c_str())) {
|
if (wxFile::Exists(paths[0].c_str())) {
|
||||||
|
|
||||||
s.Printf(wxT("File %s already exists. Do you want to overwrite it?\n"), filenames[0].c_str());
|
s.Printf(wxT("File %s already exists. Do you want to overwrite it?\n"),
|
||||||
|
filenames[0].c_str());
|
||||||
wxMessageDialog dialog3(this, s, _T("File exists"), wxYES_NO);
|
wxMessageDialog dialog3(this, s, _T("File exists"), wxYES_NO);
|
||||||
if (dialog3.ShowModal() == wxID_NO)
|
if (dialog3.ShowModal() == wxID_NO) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*s.Printf(_T("File %d: %s (%s)\n"), (int)0, paths[0].c_str(), filenames[0].c_str());
|
/*s.Printf(_T("File %d: %s (%s)\n"), (int)0, paths[0].c_str(), filenames[0].c_str());
|
||||||
msg += s;
|
msg += s;
|
||||||
|
@ -1270,17 +1321,20 @@ void OPJFrame::SaveFile(wxArrayString paths, wxArrayString filenames)
|
||||||
wxMessageDialog dialog2(this, msg, _T("Selected files"));
|
wxMessageDialog dialog2(this, msg, _T("Selected files"));
|
||||||
dialog2.ShowModal();*/
|
dialog2.ShowModal();*/
|
||||||
|
|
||||||
if (!GetActiveChild())
|
if (!GetActiveChild()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
((OPJChildFrame *) GetActiveChild())->m_canvas->m_savename = paths[0];
|
((OPJChildFrame *) GetActiveChild())->m_canvas->m_savename = paths[0];
|
||||||
|
|
||||||
OPJEncoThread *ethread = ((OPJChildFrame *) GetActiveChild())->m_canvas->CreateEncoThread();
|
OPJEncoThread *ethread = ((OPJChildFrame *)
|
||||||
|
GetActiveChild())->m_canvas->CreateEncoThread();
|
||||||
|
|
||||||
if (ethread->Run() != wxTHREAD_NO_ERROR)
|
if (ethread->Run() != wxTHREAD_NO_ERROR) {
|
||||||
wxLogMessage(wxT("Can't start enco thread!"));
|
wxLogMessage(wxT("Can't start enco thread!"));
|
||||||
else
|
} else {
|
||||||
wxLogMessage(wxT("New enco thread started."));
|
wxLogMessage(wxT("New enco thread started."));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1293,7 +1347,8 @@ void OPJFrame::OpenFiles(wxArrayString paths, wxArrayString filenames)
|
||||||
for (size_t n = 0; n < count; n++) {
|
for (size_t n = 0; n < count; n++) {
|
||||||
|
|
||||||
wxString msg, s;
|
wxString msg, s;
|
||||||
s.Printf(_T("File %d: %s (%s)\n"), (int)n, paths[n].c_str(), filenames[n].c_str());
|
s.Printf(_T("File %d: %s (%s)\n"), (int)n, paths[n].c_str(),
|
||||||
|
filenames[n].c_str());
|
||||||
|
|
||||||
msg += s;
|
msg += s;
|
||||||
|
|
||||||
|
@ -1311,12 +1366,14 @@ void OPJFrame::OpenFiles(wxArrayString paths, wxArrayString filenames)
|
||||||
m_childhash[winNumber] = subframe;
|
m_childhash[winNumber] = subframe;
|
||||||
|
|
||||||
// create own marker tree
|
// create own marker tree
|
||||||
m_treehash[winNumber] = new OPJMarkerTree(m_bookCtrl, subframe, paths[n], wxT("Parsing..."), TreeTest_Ctrl,
|
m_treehash[winNumber] = new OPJMarkerTree(m_bookCtrl, subframe, paths[n],
|
||||||
|
wxT("Parsing..."), TreeTest_Ctrl,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxTR_DEFAULT_STYLE | wxSUNKEN_BORDER
|
wxTR_DEFAULT_STYLE | wxSUNKEN_BORDER
|
||||||
);
|
);
|
||||||
|
|
||||||
m_bookCtrl->AddPage(m_treehash[winNumber], wxString::Format(wxT("%u"), winNumber), false);
|
m_bookCtrl->AddPage(m_treehash[winNumber], wxString::Format(wxT("%u"),
|
||||||
|
winNumber), false);
|
||||||
|
|
||||||
for (unsigned int p = 0; p < m_bookCtrl->GetPageCount(); p++) {
|
for (unsigned int p = 0; p < m_bookCtrl->GetPageCount(); p++) {
|
||||||
if (m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"), winNumber)) {
|
if (m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"), winNumber)) {
|
||||||
|
@ -1355,7 +1412,7 @@ void OPJFrame::OnFileOpen(wxCommandEvent& WXUNUSED(event))
|
||||||
#endif
|
#endif
|
||||||
wxFileDialog dialog(this, _T("Open image file(s)"),
|
wxFileDialog dialog(this, _T("Open image file(s)"),
|
||||||
wxEmptyString, wxEmptyString, wildcards,
|
wxEmptyString, wxEmptyString, wildcards,
|
||||||
wxFD_OPEN|wxFD_MULTIPLE);
|
wxFD_OPEN | wxFD_MULTIPLE);
|
||||||
|
|
||||||
if (dialog.ShowModal() == wxID_OK) {
|
if (dialog.ShowModal() == wxID_OK) {
|
||||||
wxArrayString paths, filenames;
|
wxArrayString paths, filenames;
|
||||||
|
@ -1403,7 +1460,8 @@ void OPJFrame::OnMemoryOpen(wxCommandEvent& WXUNUSED(event))
|
||||||
// do nothing
|
// do nothing
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTextEntryDialog dialog(this, wxT("Memory HEX address range: start_address-stop_address"),
|
wxTextEntryDialog dialog(this,
|
||||||
|
wxT("Memory HEX address range: start_address-stop_address"),
|
||||||
wxT("Decode a memory buffer"),
|
wxT("Decode a memory buffer"),
|
||||||
wxT("0x-0x"),
|
wxT("0x-0x"),
|
||||||
wxOK | wxCANCEL | wxCENTRE,
|
wxOK | wxCANCEL | wxCENTRE,
|
||||||
|
@ -1421,7 +1479,8 @@ BEGIN_EVENT_TABLE(OPJCanvas, wxScrolledWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// Define a constructor for my canvas
|
// Define a constructor for my canvas
|
||||||
OPJCanvas::OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos, const wxSize& size)
|
OPJCanvas::OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos,
|
||||||
|
const wxSize& size)
|
||||||
: wxScrolledWindow(parent, wxID_ANY, pos, size,
|
: wxScrolledWindow(parent, wxID_ANY, pos, size,
|
||||||
wxSUNKEN_BORDER | wxNO_FULL_REPAINT_ON_RESIZE)
|
wxSUNKEN_BORDER | wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
{
|
{
|
||||||
|
@ -1435,10 +1494,11 @@ OPJCanvas::OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos, con
|
||||||
|
|
||||||
OPJDecoThread *dthread = CreateDecoThread();
|
OPJDecoThread *dthread = CreateDecoThread();
|
||||||
|
|
||||||
if (dthread->Run() != wxTHREAD_NO_ERROR)
|
if (dthread->Run() != wxTHREAD_NO_ERROR) {
|
||||||
wxLogMessage(wxT("Can't start deco thread!"));
|
wxLogMessage(wxT("Can't start deco thread!"));
|
||||||
else
|
} else {
|
||||||
wxLogMessage(wxT("New deco thread started."));
|
wxLogMessage(wxT("New deco thread started."));
|
||||||
|
}
|
||||||
|
|
||||||
// 100% zoom
|
// 100% zoom
|
||||||
//m_zooml = 100;
|
//m_zooml = 100;
|
||||||
|
@ -1449,8 +1509,9 @@ OPJDecoThread *OPJCanvas::CreateDecoThread(void)
|
||||||
{
|
{
|
||||||
OPJDecoThread *dthread = new OPJDecoThread(this);
|
OPJDecoThread *dthread = new OPJDecoThread(this);
|
||||||
|
|
||||||
if (dthread->Create() != wxTHREAD_NO_ERROR)
|
if (dthread->Create() != wxTHREAD_NO_ERROR) {
|
||||||
wxLogError(wxT("Can't create deco thread!"));
|
wxLogError(wxT("Can't create deco thread!"));
|
||||||
|
}
|
||||||
|
|
||||||
wxCriticalSectionLocker enter(wxGetApp().m_deco_critsect);
|
wxCriticalSectionLocker enter(wxGetApp().m_deco_critsect);
|
||||||
wxGetApp().m_deco_threads.Add(dthread);
|
wxGetApp().m_deco_threads.Add(dthread);
|
||||||
|
@ -1462,8 +1523,9 @@ OPJEncoThread *OPJCanvas::CreateEncoThread(void)
|
||||||
{
|
{
|
||||||
OPJEncoThread *ethread = new OPJEncoThread(this);
|
OPJEncoThread *ethread = new OPJEncoThread(this);
|
||||||
|
|
||||||
if (ethread->Create() != wxTHREAD_NO_ERROR)
|
if (ethread->Create() != wxTHREAD_NO_ERROR) {
|
||||||
wxLogError(wxT("Can't create enco thread!"));
|
wxLogError(wxT("Can't create enco thread!"));
|
||||||
|
}
|
||||||
|
|
||||||
wxCriticalSectionLocker enter(wxGetApp().m_enco_critsect);
|
wxCriticalSectionLocker enter(wxGetApp().m_enco_critsect);
|
||||||
wxGetApp().m_enco_threads.Add(ethread);
|
wxGetApp().m_enco_threads.Add(ethread);
|
||||||
|
@ -1483,15 +1545,19 @@ void OPJCanvas::OnDraw(wxDC& dc)
|
||||||
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||||
//int tw, th;
|
//int tw, th;
|
||||||
dc.DrawRectangle(OPJ_CANVAS_BORDER, OPJ_CANVAS_BORDER,
|
dc.DrawRectangle(OPJ_CANVAS_BORDER, OPJ_CANVAS_BORDER,
|
||||||
(unsigned long int) (0.5 + (double) m_zooml * (double) m_childframe->m_twidth / 100.0),
|
(unsigned long int)(0.5 + (double) m_zooml * (double) m_childframe->m_twidth /
|
||||||
(unsigned long int) (0.5 + (double) m_zooml * (double) m_childframe->m_theight / 100.0));
|
100.0),
|
||||||
|
(unsigned long int)(0.5 + (double) m_zooml * (double) m_childframe->m_theight /
|
||||||
|
100.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dc.SetFont(*wxSWISS_FONT);
|
dc.SetFont(*wxSWISS_FONT);
|
||||||
dc.SetPen(*wxBLACK_PEN);
|
dc.SetPen(*wxBLACK_PEN);
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
dc.DrawText(_T("Decoding image, please wait... (press \"Zoom to Fit\" to show the image)"), 40, 50);
|
dc.DrawText(
|
||||||
|
_T("Decoding image, please wait... (press \"Zoom to Fit\" to show the image)"),
|
||||||
|
40, 50);
|
||||||
#else
|
#else
|
||||||
dc.DrawText(_T("Decoding image, please wait..."), 40, 50);
|
dc.DrawText(_T("Decoding image, please wait..."), 40, 50);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1530,8 +1596,7 @@ void OPJCanvas::OnThreadSignal(wxCommandEvent& event)
|
||||||
wxLogMessage(event.GetString());
|
wxLogMessage(event.GetString());
|
||||||
#else
|
#else
|
||||||
int n = event.GetInt();
|
int n = event.GetInt();
|
||||||
if ( n == -1 )
|
if (n == -1) {
|
||||||
{
|
|
||||||
m_dlgProgress->Destroy();
|
m_dlgProgress->Destroy();
|
||||||
m_dlgProgress = (wxProgressDialog *)NULL;
|
m_dlgProgress = (wxProgressDialog *)NULL;
|
||||||
|
|
||||||
|
@ -1539,11 +1604,8 @@ void OPJCanvas::OnThreadSignal(wxCommandEvent& event)
|
||||||
// we may need to wake up the main event loop for the dialog to be
|
// we may need to wake up the main event loop for the dialog to be
|
||||||
// really closed
|
// really closed
|
||||||
wxWakeUpIdle();
|
wxWakeUpIdle();
|
||||||
}
|
} else {
|
||||||
else
|
if (!m_dlgProgress->Update(n)) {
|
||||||
{
|
|
||||||
if ( !m_dlgProgress->Update(n) )
|
|
||||||
{
|
|
||||||
wxCriticalSectionLocker lock(m_critsectWork);
|
wxCriticalSectionLocker lock(m_critsectWork);
|
||||||
|
|
||||||
m_cancelled = true;
|
m_cancelled = true;
|
||||||
|
@ -1564,8 +1626,9 @@ BEGIN_EVENT_TABLE(OPJChildFrame, wxMDIChildFrame)
|
||||||
EVT_KILL_FOCUS(OPJChildFrame::OnLostFocus)
|
EVT_KILL_FOCUS(OPJChildFrame::OnLostFocus)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
OPJChildFrame::OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber, const wxString& title, const wxPoint& pos, const wxSize& size,
|
OPJChildFrame::OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber,
|
||||||
const long style):
|
const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||||
|
const long style):
|
||||||
wxMDIChildFrame(parent, wxID_ANY, title, pos, size, style)
|
wxMDIChildFrame(parent, wxID_ANY, title, pos, size, style)
|
||||||
{
|
{
|
||||||
m_frame = (OPJFrame *) parent;
|
m_frame = (OPJFrame *) parent;
|
||||||
|
@ -1586,7 +1649,8 @@ const long style):
|
||||||
int width, height;
|
int width, height;
|
||||||
GetClientSize(&width, &height);
|
GetClientSize(&width, &height);
|
||||||
|
|
||||||
OPJCanvas *canvas = new OPJCanvas(fname, this, wxPoint(0, 0), wxSize(width, height));
|
OPJCanvas *canvas = new OPJCanvas(fname, this, wxPoint(0, 0), wxSize(width,
|
||||||
|
height));
|
||||||
#if USE_PENCIL_ON_CANVAS
|
#if USE_PENCIL_ON_CANVAS
|
||||||
canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
|
canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
|
||||||
#endif
|
#endif
|
||||||
|
@ -1611,7 +1675,8 @@ OPJChildFrame::~OPJChildFrame(void)
|
||||||
void OPJChildFrame::OnClose(wxCloseEvent& event)
|
void OPJChildFrame::OnClose(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
for (unsigned int p = 0; p < m_frame->m_bookCtrl->GetPageCount(); p++) {
|
for (unsigned int p = 0; p < m_frame->m_bookCtrl->GetPageCount(); p++) {
|
||||||
if (m_frame->m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"), m_winnumber)) {
|
if (m_frame->m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"),
|
||||||
|
m_winnumber)) {
|
||||||
m_frame->m_bookCtrl->DeletePage(p);
|
m_frame->m_bookCtrl->DeletePage(p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1630,12 +1695,14 @@ void OPJChildFrame::OnActivate(wxActivateEvent& event)
|
||||||
void OPJChildFrame::OnGotFocus(wxFocusEvent& event)
|
void OPJChildFrame::OnGotFocus(wxFocusEvent& event)
|
||||||
{
|
{
|
||||||
// we need to check if the notebook is being destroyed or not
|
// we need to check if the notebook is being destroyed or not
|
||||||
if (!m_frame->m_bookCtrl)
|
if (!m_frame->m_bookCtrl) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int p = 0; p < m_frame->m_bookCtrl->GetPageCount(); p++) {
|
for (unsigned int p = 0; p < m_frame->m_bookCtrl->GetPageCount(); p++) {
|
||||||
|
|
||||||
if (m_frame->m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"), m_winnumber)) {
|
if (m_frame->m_bookCtrl->GetPageText(p) == wxString::Format(wxT("%u"),
|
||||||
|
m_winnumber)) {
|
||||||
m_frame->m_bookCtrl->ChangeSelection(p);
|
m_frame->m_bookCtrl->ChangeSelection(p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue