/* Copyright (C) 2018-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: Bmpp4Frame.wxc */ /** @file Bmpp4Frame.cpp The Bmpp4Frame module. */ #line 535 "Bmpp4Frame.wxc" #include "wxbmpp.h" #if !defined(__WXMSW__) #include "gui-img/icons/dkicon.xpm" #endif #include "gui-img/shared/toolbar/choose-dir.xpm" #include "gui-img/shared/toolbar/run-conversion.xpm" #ifndef DK4MAIXDBL_H_INCLUDED #include "dk4maixdbl.h" #endif #ifndef DK4MAOXDBL_H_INCLUDED #include "dk4maoxdbl.h" #endif #line 554 "Bmpp4Frame.wxc" /* __CHANGE__ 017: Add further events. */ /* __CHANGE__ 008: Remove OnIdle if no idle processing required. */ #if wxCHECK_VERSION(3,0,0) wxBEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame) #else BEGIN_EVENT_TABLE(Bmpp4Frame,wxFrame) #endif EVT_MENU(Bmpp4Frame_Quit, Bmpp4Frame::OnQuit) EVT_MENU(Bmpp4Frame_Help_About, Bmpp4Frame::OnAbout) EVT_MENU(Bmpp4Frame_Help_Contents, Bmpp4Frame::OnHelpContents) EVT_MENU(Bmpp4Frame_Choose_Directory, Bmpp4Frame::OnChooseDirectory) EVT_MENU(Bmpp4Frame_Run_Conversion, Bmpp4Frame::OnRunConversion) EVT_MENU(Bmpp4Frame_Reset_Options, Bmpp4Frame::OnResetOptions) EVT_CHOICE(Bmpp4Frame_Output_Type, Bmpp4Frame::OnOutputType) EVT_CHOICE(Bmpp4Frame_PS_Level, Bmpp4Frame::OnPSLevel) EVT_CHOICE(Bmpp4Frame_Resolution, Bmpp4Frame::OnResolution) EVT_CHECKBOX(Bmpp4Frame_Color_Output, Bmpp4Frame::OnColorOutput) EVT_CHECKBOX(Bmpp4Frame_Change_Interpolation, Bmpp4Frame::OnInterpolationChange) EVT_IDLE(Bmpp4Frame::OnIdle) #if wxCHECK_VERSION(3,0,0) wxEND_EVENT_TABLE() #else END_EVENT_TABLE() #endif /** Option name to restore make setting. */ static const wxChar * const i_dir_names[] = { /* 0 */ wxT("wxbmpp.location"), NULL #line 589 "Bmpp4Frame.wxc" }; /** Option name to restore make setting. */ static const wxChar * const i_make_names[] = { /* 0 */ wxT("wxbmpp.make"), NULL #line 598 "Bmpp4Frame.wxc" }; /** Names for saving and restoring options. */ static const wxChar * const i_option_names[] = { /* 0 */ wxT("wxbmpp.paper.choice"), /* 1 */ wxT("wxbmpp.output.type"), /* 2 */ wxT("wxbmpp.output.color"), /* 3 */ wxT("wxbmpp.ps.level"), /* 4 */ wxT("wxbmpp.ps.dsc"), /* 5 */ wxT("wxbmpp.ps.lzw"), /* 6 */ wxT("wxbmpp.paper.rotate"), /* 7 */ wxT("wxbmpp.paper.duplex"), /* 8 */ wxT("wxbmpp.resolution.type"), /* 9 */ wxT("wxbmpp.image.background.red"), /* 10 */ wxT("wxbmpp.image.background.green"), /* 11 */ wxT("wxbmpp.image.background.blue"), /* 12 */ wxT("wxbmpp.image.bg.enforce"), /* 13 */ wxT("wxbmpp.image.interpolation"), /* 14 */ wxT("wxbmpp.image.dct"), /* 15 */ wxT("wxbmpp.image.dct-interpolation"), /* 16 */ wxT("wxbmpp.image.analysis.bpc"), /* 17 */ wxT("wxbmpp.image.analysis.color"), /* 18 */ wxT("wxbmpp.image.analysis.alpha"), /* 19 */ wxT("wxbmpp.image.rgb-to-gray"), NULL #line 626 "Bmpp4Frame.wxc" }; #if 0 /** Names for saving and restoring options. */ static const wxChar * const s_option_names[] = { /* 0 */ wxT("wxbmpp.paper.name"), NULL #line 636 "Bmpp4Frame.wxc" }; #endif #if 0 /** Names for saving and restoring options. */ static const wxChar * const d_option_names[] = { /* 0 */ wxT("wxbmpp.resolution.value"), NULL #line 647 "Bmpp4Frame.wxc" }; #endif #line 653 "Bmpp4Frame.wxc" Bmpp4Frame::Bmpp4Frame( int wxid, Dk4WxApplicationHelper *applicationHelper, Dk4WxHelpController *hc, wxChar const * const *localizedTexts, wxChar const * const *nlWx, dkChar const * const *nlDk, dk4_gra_conf_t *pgc, wxArrayString *pPapSiz, wxChar *pDir, size_t szPap, bool bRGx, bool bRMa, bool bRLo, bool bMak, bool bRun, dk4_paper_size_t *pSizes ) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid), cRed(127, 0, 0), cGreen(0, 127, 0), cBlack(0, 0, 0), asPaperSizes(*pPapSiz) { wxString saOutputMode[] = { wxString(localizedTexts[18]), wxString(localizedTexts[19]), wxString(localizedTexts[20]), wxString(localizedTexts[21]), wxString(localizedTexts[22]), wxString(localizedTexts[23]) }; wxString saPsLevel[] = { wxString(localizedTexts[28]), wxString(localizedTexts[29]) }; wxString saFinishing[] = { wxString(localizedTexts[44]), wxString(localizedTexts[45]), wxString(localizedTexts[46]) }; wxString saResolution[] = { wxString(localizedTexts[52]), wxString(localizedTexts[53]), wxString(localizedTexts[54]) }; wxString saRgbToGray[] = { wxString(localizedTexts[76]), wxString(localizedTexts[77]), wxString(localizedTexts[78]), wxString(localizedTexts[79]), wxString(localizedTexts[80]), wxString(localizedTexts[81]), wxString(localizedTexts[82]), wxString(localizedTexts[83]), wxString(localizedTexts[84]), wxString(localizedTexts[85]), wxString(localizedTexts[86]), wxString(localizedTexts[87]), wxString(localizedTexts[88]) }; wxString slDirname(localizedTexts[70]); #line 715 "Bmpp4Frame.wxc" /* __CHANGE__ 012: Add further local variables. */ /* __CHANGE__ 012: Initialize further local variables. */ bIsCorrecting = false; sTexts = localizedTexts; sNlWx = nlWx; sNlDk = nlDk; #if defined(__WXMSW__) wxIcon wxbmpp_icon(sNlWx[4]); #else wxIcon wxbmpp_icon(xpm_dkicon); #endif /* __CHANGE__ 011: Initialize further class members. */ pPaperSizes = pSizes; DK4_MEMCPY(&graconf,pgc,sizeof(dk4_gra_conf_t)); if (NULL != pDir) { sDirname = wxString(pDir); slDirname = sDirname; } szPaperSizes = szPap; bRestoreGx = bRGx; bRestoreMake = bRMa; bRestoreLocation = bRLo; bMakeMode = bMak; bAutorun = bRun; if (bAutorun) { oAsc.SetAutoStart(true); oAsc.SetAutoExit(true); } else { oAsc.SetAutoStart(false); oAsc.SetAutoExit(false); } bActive = true; dk4time_get(&firsttime); dkctGUILayoutOK = false; dkctGUIContentsPanel = NULL; mainSizer = NULL; mbMain = NULL; tbMain = NULL; menuFile = NULL; menuConversion = NULL; menuExtras = NULL; menuHelp = NULL; miFileDirectory = NULL; miFileExit = NULL; miConversionRun = NULL; miExtrasOptionReset = NULL; miHelpAbout = NULL; miHelpContents = NULL; bChooseDir = NULL; bRunConversion = NULL; verticalSizer = NULL; contentsSizer = NULL; staticline0 = NULL; lDirectoryName = NULL; staticline1 = NULL; cbMakeMode = NULL; cbColorOutput = NULL; lRgbToGray = NULL; chRgbToGray = NULL; lOutputMode = NULL; chOutputMode = NULL; cbImgInterpolation = NULL; lPsLevel = NULL; chPsLevel = NULL; cbDsc = NULL; cbLzw = NULL; cbDct = NULL; lPaperSize = NULL; chPaperSizes = NULL; cbRotation = NULL; cbDctInterpolation = NULL; lFinishing = NULL; chFinishing = NULL; cbAnBpc = NULL; lResolution = NULL; chResolution = NULL; tfResolution = NULL; cbAnColor = NULL; lBackground = NULL; ccBackground = NULL; cbBackground = NULL; cbAnAlpha = NULL; dkctGUIContentsPanel = new wxPanel(this); if(!(dkctGUIContentsPanel)) { goto dkctGUILayoutFinished; } #if wxUSE_MENUS mbMain = new wxMenuBar( ); if(!(mbMain)) { goto dkctGUILayoutFinished; } menuFile = new wxMenu( ); if(!(menuFile)) { goto dkctGUILayoutFinished; } miFileDirectory = menuFile->Append( Bmpp4Frame_Choose_Directory, sTexts[65], sTexts[66] ); if(!(miFileDirectory)) { goto dkctGUILayoutFinished; } miFileExit = menuFile->Append( Bmpp4Frame_Quit, sTexts[1], sTexts[2] ); if(!(miFileExit)) { goto dkctGUILayoutFinished; } mbMain->Append(menuFile, sTexts[0]); menuConversion = new wxMenu( ); if(!(menuConversion)) { goto dkctGUILayoutFinished; } miConversionRun = menuConversion->Append( Bmpp4Frame_Run_Conversion, sTexts[68], sTexts[69] ); if(!(miConversionRun)) { goto dkctGUILayoutFinished; } mbMain->Append(menuConversion, sTexts[67]); menuExtras = new wxMenu( ); if(!(menuExtras)) { goto dkctGUILayoutFinished; } miExtrasOptionReset = menuExtras->Append( Bmpp4Frame_Reset_Options, sTexts[73], sTexts[122] ); if(!(miExtrasOptionReset)) { goto dkctGUILayoutFinished; } mbMain->Append(menuExtras, sTexts[72]); menuHelp = new wxMenu( ); if(!(menuHelp)) { goto dkctGUILayoutFinished; } miHelpAbout = menuHelp->Append( Bmpp4Frame_Help_About, sTexts[4], sTexts[5] ); if(!(miHelpAbout)) { goto dkctGUILayoutFinished; } miHelpContents = menuHelp->Append( Bmpp4Frame_Help_Contents, sTexts[6], sTexts[7] ); if(!(miHelpContents)) { goto dkctGUILayoutFinished; } mbMain->Append(menuHelp, sTexts[3]); SetMenuBar(mbMain); #endif #if wxUSE_TOOLBAR tbMain = new wxToolBar( this, wxID_ANY ); if(!(tbMain)) { goto dkctGUILayoutFinished; } bChooseDir = tbMain->AddTool( Bmpp4Frame_Choose_Directory, sTexts[65], xpm_choose_dir, wxNullBitmap, wxITEM_NORMAL, sTexts[66] ); if(!(bChooseDir)) { goto dkctGUILayoutFinished; } bRunConversion = tbMain->AddTool( Bmpp4Frame_Run_Conversion, sTexts[68], xpm_run_conversion, wxNullBitmap, wxITEM_NORMAL, sTexts[69] ); if(!(bRunConversion)) { goto dkctGUILayoutFinished; } tbMain->Realize(); SetToolBar(tbMain); #endif mainSizer = new wxBoxSizer( wxHORIZONTAL ); if(!(mainSizer)) { goto dkctGUILayoutFinished; } mainSizer->Add(10, 10, 0); verticalSizer = new wxBoxSizer( wxVERTICAL ); if(!(verticalSizer)) { goto dkctGUILayoutFinished; } verticalSizer->Add(10, 10, 0); contentsSizer = new wxGridBagSizer( 5, 5 ); if(!(contentsSizer)) { goto dkctGUILayoutFinished; } staticline0 = new wxStaticLine( dkctGUIContentsPanel, wxID_ANY ); if(!(staticline0)) { goto dkctGUILayoutFinished; } contentsSizer->Add( staticline0, wxGBPosition(0, 0), wxGBSpan(1, 11), wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW ); lDirectoryName = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, slDirname, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); if(!(lDirectoryName)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lDirectoryName, wxGBPosition(1, 0), wxGBSpan(1, 11), wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW ); staticline1 = new wxStaticLine( dkctGUIContentsPanel, wxID_ANY ); if(!(staticline1)) { goto dkctGUILayoutFinished; } contentsSizer->Add( staticline1, wxGBPosition(2, 0), wxGBSpan(1, 11), wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxGROW ); cbMakeMode = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[13] ); if(!(cbMakeMode)) { goto dkctGUILayoutFinished; } cbMakeMode->SetToolTip(sTexts[14]); contentsSizer->Add( cbMakeMode, wxGBPosition(3, 0), wxGBSpan(1, 7), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbColorOutput = new wxCheckBox( dkctGUIContentsPanel, Bmpp4Frame_Color_Output, sTexts[15] ); if(!(cbColorOutput)) { goto dkctGUILayoutFinished; } cbColorOutput->SetToolTip(sTexts[16]); contentsSizer->Add( cbColorOutput, wxGBPosition(3, 7), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); contentsSizer->Add(10, 1, wxGBPosition(3, 8), wxGBSpan(1, 1)); lRgbToGray = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[89] ); if(!(lRgbToGray)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lRgbToGray, wxGBPosition(3, 9), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); chRgbToGray = new wxChoice( dkctGUIContentsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 13, saRgbToGray ); if(!(chRgbToGray)) { goto dkctGUILayoutFinished; } chRgbToGray->SetToolTip(sTexts[90]); contentsSizer->Add( chRgbToGray, wxGBPosition(3, 10), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lOutputMode = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[17] ); if(!(lOutputMode)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lOutputMode, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); chOutputMode = new wxChoice( dkctGUIContentsPanel, Bmpp4Frame_Output_Type, wxDefaultPosition, wxDefaultSize, 6, saOutputMode ); if(!(chOutputMode)) { goto dkctGUILayoutFinished; } chOutputMode->SetToolTip(sTexts[24]); contentsSizer->Add( chOutputMode, wxGBPosition(4, 1), wxGBSpan(1, 2), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW ); cbImgInterpolation = new wxCheckBox( dkctGUIContentsPanel, Bmpp4Frame_Change_Interpolation, sTexts[25] ); if(!(cbImgInterpolation)) { goto dkctGUILayoutFinished; } cbImgInterpolation->SetToolTip(sTexts[26]); contentsSizer->Add( cbImgInterpolation, wxGBPosition(4, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lPsLevel = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[27] ); if(!(lPsLevel)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lPsLevel, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); chPsLevel = new wxChoice( dkctGUIContentsPanel, Bmpp4Frame_PS_Level, wxDefaultPosition, wxDefaultSize, 2, saPsLevel ); if(!(chPsLevel)) { goto dkctGUILayoutFinished; } chPsLevel->SetToolTip(sTexts[30]); contentsSizer->Add( chPsLevel, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbDsc = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[31] ); if(!(cbDsc)) { goto dkctGUILayoutFinished; } cbDsc->SetToolTip(sTexts[32]); contentsSizer->Add( cbDsc, wxGBPosition(5, 2), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbLzw = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[33] ); if(!(cbLzw)) { goto dkctGUILayoutFinished; } cbLzw->SetToolTip(sTexts[34]); contentsSizer->Add( cbLzw, wxGBPosition(5, 3), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbDct = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[35] ); if(!(cbDct)) { goto dkctGUILayoutFinished; } cbDct->SetToolTip(sTexts[36]); contentsSizer->Add( cbDct, wxGBPosition(5, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lPaperSize = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[37] ); if(!(lPaperSize)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lPaperSize, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); chPaperSizes = new wxChoice( dkctGUIContentsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, asPaperSizes ); if(!(chPaperSizes)) { goto dkctGUILayoutFinished; } chPaperSizes->SetToolTip(sTexts[38]); contentsSizer->Add( chPaperSizes, wxGBPosition(6, 1), wxGBSpan(1, 2), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW ); cbRotation = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[39] ); if(!(cbRotation)) { goto dkctGUILayoutFinished; } cbRotation->SetToolTip(sTexts[40]); contentsSizer->Add( cbRotation, wxGBPosition(6, 3), wxGBSpan(1, 2), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbDctInterpolation = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[41] ); if(!(cbDctInterpolation)) { goto dkctGUILayoutFinished; } cbDctInterpolation->SetToolTip(sTexts[42]); contentsSizer->Add( cbDctInterpolation, wxGBPosition(6, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lFinishing = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[43] ); if(!(lFinishing)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lFinishing, wxGBPosition(7, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); chFinishing = new wxChoice( dkctGUIContentsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 3, saFinishing ); if(!(chFinishing)) { goto dkctGUILayoutFinished; } chFinishing->SetToolTip(sTexts[47]); contentsSizer->Add( chFinishing, wxGBPosition(7, 1), wxGBSpan(1, 2), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW ); cbAnBpc = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[48] ); if(!(cbAnBpc)) { goto dkctGUILayoutFinished; } cbAnBpc->SetToolTip(sTexts[49]); contentsSizer->Add( cbAnBpc, wxGBPosition(7, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lResolution = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[50] ); if(!(lResolution)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lResolution, wxGBPosition(8, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); chResolution = new wxChoice( dkctGUIContentsPanel, Bmpp4Frame_Resolution, wxDefaultPosition, wxDefaultSize, 3, saResolution ); if(!(chResolution)) { goto dkctGUILayoutFinished; } chResolution->SetToolTip(sTexts[51]); contentsSizer->Add( chResolution, wxGBPosition(8, 1), wxGBSpan(1, 2), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW ); tfResolution = new wxTextCtrl( dkctGUIContentsPanel, wxID_ANY, sTexts[55] ); if(!(tfResolution)) { goto dkctGUILayoutFinished; } contentsSizer->Add( tfResolution, wxGBPosition(8, 3), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxGROW ); cbAnColor = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[57] ); if(!(cbAnColor)) { goto dkctGUILayoutFinished; } cbAnColor->SetToolTip(sTexts[58]); contentsSizer->Add( cbAnColor, wxGBPosition(8, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); lBackground = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[59] ); if(!(lBackground)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lBackground, wxGBPosition(9, 0), wxGBSpan(1, 1), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL ); ccBackground = new Dk4WxColourView( dkctGUIContentsPanel,wxID_ANY,applicationHelper, 255, 255, 255 ); if(!(ccBackground)) { goto dkctGUILayoutFinished; } ccBackground->SetToolTip(sTexts[60]); contentsSizer->Add( ccBackground, wxGBPosition(9, 1), wxGBSpan(1, 1), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbBackground = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[61] ); if(!(cbBackground)) { goto dkctGUILayoutFinished; } cbBackground->SetToolTip(sTexts[62]); contentsSizer->Add( cbBackground, wxGBPosition(9, 2), wxGBSpan(1, 3), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); cbAnAlpha = new wxCheckBox( dkctGUIContentsPanel, wxID_ANY, sTexts[63] ); if(!(cbAnAlpha)) { goto dkctGUILayoutFinished; } cbAnAlpha->SetToolTip(sTexts[64]); contentsSizer->Add( cbAnAlpha, wxGBPosition(9, 7), wxGBSpan(1, 4), wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL ); verticalSizer->Add( contentsSizer ); verticalSizer->Add(10, 10, 0); mainSizer->Add( verticalSizer, 1, wxGROW ); mainSizer->Add(10, 10, 0); dkctGUIContentsPanel->SetSizer(mainSizer); SetIcon(wxbmpp_icon); dkctGUILayoutOK = true; dkctGUILayoutFinished: #if wxUSE_STATUSBAR if(dkctGUILayoutOK) { CreateStatusBar(1); SetStatusText(sTexts[8]); } #endif if(dkctGUILayoutOK) { mainSizer->Fit(this); mainSizer->SetSizeHints(this); } #line 757 "Bmpp4Frame.wxc" if(dkctGUILayoutOK) { chOutputMode->SetSelection(0); chPsLevel->SetSelection(0); chFinishing->SetSelection(0); chResolution->SetSelection(0); chPaperSizes->SetSelection(0); chRgbToGray->SetSelection(0); CorrectGUI(); SetTitle(nlWx[0]); #if 0 /* 2018-05-27 Test for setActive() method. This line was added temporarily just to test the new setActive() method. */ ccBackground->SetActive(false); #line 773 "Bmpp4Frame.wxc" #endif ccBackground->SetPlaceColourChooser(); } /* __CHANGE__ 012: Release resources allocated by local variables. */ #line 781 "Bmpp4Frame.wxc" } #line 784 "Bmpp4Frame.wxc" Bmpp4Frame::~Bmpp4Frame() { #line 790 "Bmpp4Frame.wxc" /* __CHANGE__ 011: Release resources allocated by further class members. */ #line 795 "Bmpp4Frame.wxc" } bool Bmpp4Frame::CanClose(bool isLast) { bool back = true; #line 804 "Bmpp4Frame.wxc" /* __CHANGE__ 013: Check for unsaved data. */ if (isLast) { SaveSettings(); } #line 812 "Bmpp4Frame.wxc" return back; } void Bmpp4Frame::OnQuit(wxCommandEvent & WXUNUSED(event)) { #line 820 "Bmpp4Frame.wxc" #line 821 "Bmpp4Frame.wxc" Close(); } void Bmpp4Frame::OnAbout(wxCommandEvent & WXUNUSED(event)) { wxString text(wxT("")); wxString title(wxT("")); #line 832 "Bmpp4Frame.wxc" /* Construct message text. */ text.Append(sNlWx[0]); text.Append(sNlWx[7]); #if 0 text.Append(sNlWx[1]); #else text.Append(DKT_VERSION_WX); #endif text.Append(sNlWx[8]); text.Append(sTexts[9]); text.Append(sNlWx[2]); text.Append(sNlWx[8]); text.Append(sNlWx[8]); text.Append(sTexts[11]); text.Append(sNlWx[8]); text.Append(sNlWx[9]); text.Append(sNlWx[8]); text.Append(sNlWx[8]); text.Append(sTexts[12]); text.Append(sNlWx[8]); text.Append(sNlWx[10]); text.Append(sNlWx[8]); text.Append(sNlWx[11]); text.Append(sNlWx[8]); text.Append(sNlWx[12]); text.Append(sNlWx[8]); text.Append(sNlWx[13]); text.Append(sNlWx[8]); text.Append(sNlWx[14]); text.Append(sNlWx[8]); text.Append(sNlWx[15]); text.Append(sNlWx[8]); /* Construct dialog box title. */ title.Append(sTexts[10]); title.Append(sNlWx[0]); /* Show dialog box. */ wxMessageBox(text, title); /* __CHANGE__ 019: Create better about box. */ #line 875 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnHelpContents(wxCommandEvent & WXUNUSED(event)) { #line 883 "Bmpp4Frame.wxc" DisplayContents(); #line 885 "Bmpp4Frame.wxc" } /* __CHANGE__ 017: Event handlers for further events. */ void Bmpp4Frame::OnChooseDirectory(wxCommandEvent & WXUNUSED(event)) { #line 896 "Bmpp4Frame.wxc" wxDirDialog dd( this, sTexts[71], sDirname, (wxDD_DIR_MUST_EXIST | wxDD_CHANGE_DIR) ); pAppHelp->ChooseChildPosition(*this, dd, false); if(dd.ShowModal() == wxID_OK) { sDirname = dd.GetPath(); lDirectoryName->SetLabel(sDirname); #if 0 lDirectoryName->(wxALIGN_CENTRE_HORIZONTAL); #endif Refresh(); Update(); } else { } #line 912 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnResetOptions(wxCommandEvent & WXUNUSED(event)) { wxString sA4(wxT("a4")); int res; #line 922 "Bmpp4Frame.wxc" res = wxMessageBox( sTexts[75], sTexts[74], (wxNO_DEFAULT | wxYES_NO | wxICON_QUESTION) ); if (wxYES == res) { dk4gra_conf_init(&graconf); res = asPaperSizes.Index(sA4); if (wxNOT_FOUND != res) { chPaperSizes->SetSelection(res); dk4mem_cpy( &(graconf.media), &(pPaperSizes[res]), sizeof(dk4_paper_size_t), NULL ); graconf.media.name = NULL; graconf.psi = (size_t)res; graconf.have_psi = 1; } ConfigurationToGUI(); CorrectGUI(); } #line 944 "Bmpp4Frame.wxc" } bool Bmpp4Frame::CheckPaperSizeForDocuments(void) { bool back = true; if (DK4_GRA_PURPOSE_DOCUMENT == graconf.purpose) { if (graconf.media.w < (graconf.media.i + graconf.media.o)) { back = false; } if (graconf.media.h < (graconf.media.b + graconf.media.t)) { back = false; } } return back; } bool Bmpp4Frame::RunConversion(void) { wxString errorString(wxT("")); bool back = false; #line 971 "Bmpp4Frame.wxc" /* Transfer GUI state to grahpics output configuration if not specified on the command line. */ if (bRestoreGx) { ConfigurationFromGUI(); } if (!(bAutorun)) { bMakeMode = ((0 != cbMakeMode->GetValue()) ? (true) : (false)); } /* Check for usable paper size */ if (CheckPaperSizeForDocuments()) { /* Do conversion operations in idle events or modal dialog. */ Bmpp4Progress dPro( this, pAppHelp, sTexts, sDirname, &graconf, bMakeMode, &errorString ); if (dPro.PrepareProcessing()) { #line 993 "Bmpp4Frame.wxc" pAppHelp->ChooseChildPosition(*this, dPro); if (wxID_OK == dPro.ShowModal()) { back = true; } else { #line 998 "Bmpp4Frame.wxc" /* ERRROR: Aborted or errors */ wxMessageBox( errorString, sTexts[102], (wxOK | wxCENTRE | wxICON_ERROR), this ); } #line 1006 "Bmpp4Frame.wxc" } else { #line 1008 "Bmpp4Frame.wxc" /* ERROR: Failed to prepare processing */ wxMessageBox( errorString, sTexts[102], (wxOK | wxCENTRE | wxICON_ERROR), this ); } #line 1016 "Bmpp4Frame.wxc" dPro.Cleanup(); #line 1018 "Bmpp4Frame.wxc" } else { #line 1020 "Bmpp4Frame.wxc" /* ERROR: Unusable paper size */ wxMessageBox( sTexts[111], sTexts[102], (wxOK | wxCENTRE | wxICON_ERROR), this ); } #line 1029 "Bmpp4Frame.wxc" return back; } void Bmpp4Frame::OnRunConversion(wxCommandEvent & WXUNUSED(event)) { #line 1038 "Bmpp4Frame.wxc" (void)RunConversion(); #line 1040 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnOutputType(wxCommandEvent & WXUNUSED(event)) { #line 1048 "Bmpp4Frame.wxc" CorrectGUI(); #line 1050 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnPSLevel(wxCommandEvent & WXUNUSED(event)) { #line 1058 "Bmpp4Frame.wxc" CorrectGUI(); #line 1060 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnResolution(wxCommandEvent & WXUNUSED(event)) { #line 1068 "Bmpp4Frame.wxc" CorrectGUI(); #line 1070 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnInterpolationChange(wxCommandEvent & WXUNUSED(event)) { #line 1078 "Bmpp4Frame.wxc" CorrectGUI(); #line 1080 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnColorOutput(wxCommandEvent & WXUNUSED(event)) { #line 1088 "Bmpp4Frame.wxc" CorrectGUI(); #line 1090 "Bmpp4Frame.wxc" } /* __CHANGE__ 014: Implementation of further methods. */ void Bmpp4Frame::SaveSettings(void) { int ival[20]; size_t i; #line 1104 "Bmpp4Frame.wxc" if (bRestoreGx) { #line 1105 "Bmpp4Frame.wxc" for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; } ival[ 0] = chPaperSizes->GetSelection(); ival[ 1] = chOutputMode->GetSelection(); ival[ 2] = cbColorOutput->GetValue(); ival[ 3] = chPsLevel->GetSelection(); ival[ 4] = cbDsc->GetValue(); ival[ 5] = cbLzw->GetValue(); ival[ 6] = cbRotation->GetValue(); ival[ 7] = chFinishing->GetSelection(); ival[ 8] = chResolution->GetSelection(); ival[ 9] = ccBackground->Red(); ival[10] = ccBackground->Green(); ival[11] = ccBackground->Blue(); ival[12] = cbBackground->GetValue(); ival[13] = cbImgInterpolation->GetValue(); ival[14] = cbDct->GetValue(); ival[15] = cbDctInterpolation->GetValue(); ival[16] = cbAnBpc->GetValue(); ival[17] = cbAnColor->GetValue(); ival[18] = cbAnAlpha->GetValue(); ival[19] = chRgbToGray->GetSelection(); pAppHelp->SetMultiple(i_option_names, ival, 20); } if (bRestoreMake) { #line 1129 "Bmpp4Frame.wxc" ival[0] = cbMakeMode->GetValue(); pAppHelp->SetMultiple(i_make_names, ival, 1); } if (bRestoreLocation) { #line 1133 "Bmpp4Frame.wxc" pAppHelp->SetString(i_dir_names[0], sDirname); } #line 1136 "Bmpp4Frame.wxc" } void Bmpp4Frame::RestoreSettings(void) { int ival[20]; size_t i; #line 1146 "Bmpp4Frame.wxc" if (bRestoreGx) { #line 1147 "Bmpp4Frame.wxc" for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; } ival[ 0] = 0; ival[ 1] = 0; ival[ 2] = 1; ival[ 3] = 1; ival[ 4] = 1; ival[ 5] = 0; ival[ 6] = 1; ival[ 7] = 1; ival[ 8] = 0; ival[ 9] = 255; ival[10] = 255; ival[11] = 255; ival[12] = 0; ival[13] = 1; ival[14] = 1; ival[15] = 0; ival[16] = 1; ival[17] = 1; ival[18] = 1; ival[19] = 0; pAppHelp->GetMultiple(i_option_names, ival, 20); if ((0 <= ival[0]) && ((int)szPaperSizes > ival[0])) { chPaperSizes->SetSelection(ival[0]); } if (0 <= ival[1]) { chOutputMode->SetSelection(ival[1]); } cbColorOutput->SetValue((0 != ival[2]) ? (true) : (false)); if (0 <= ival[3]) { chPsLevel->SetSelection(ival[3]); } cbDsc->SetValue((0 != ival[4]) ? (true) : (false)); cbLzw->SetValue((0 != ival[5]) ? (true) : (false)); cbRotation->SetValue((0 != ival[6]) ? (true) : (false)); if (0 <= ival[7]) { chFinishing->SetSelection(ival[7]); } if (0 <= ival[8]) { chResolution->SetSelection(ival[8]); } ccBackground->SetRGB(ival[9], ival[10], ival[11]); cbBackground->SetValue((0 != ival[12]) ? (true) : (false)); cbImgInterpolation->SetValue((0 != ival[13]) ? (true) : (false)); cbDct->SetValue((0 != ival[14]) ? (true) : (false)); cbDctInterpolation->SetValue((0 != ival[15]) ? (true) : (false)); cbAnBpc->SetValue((0 != ival[16]) ? (true) : (false)); cbAnColor->SetValue((0 != ival[17]) ? (true) : (false)); cbAnAlpha->SetValue((0 != ival[18]) ? (true) : (false)); if (0 <= ival[19]) { chRgbToGray->SetSelection(ival[19]); } } else { #line 1191 "Bmpp4Frame.wxc" ConfigurationToGUI(); } if (bRestoreMake) { #line 1194 "Bmpp4Frame.wxc" for (i = 0; i < DK4_SIZEOF(ival,int); i++) { ival[i] = 0; } ival[ 0] = 0; pAppHelp->GetMultiple(i_make_names, ival, 1); cbMakeMode->SetValue((0 != ival[0]) ? (true) : (false)); bMakeMode = ((0 != ival[0]) ? true : false); } else { cbMakeMode->SetValue(bMakeMode ? (1) : (0)); } if (bRestoreLocation) { #line 1204 "Bmpp4Frame.wxc" if (pAppHelp->GetString(i_dir_names[0], &sDirname)) { lDirectoryName->SetLabel(sDirname); Refresh(); Update(); } } #line 1211 "Bmpp4Frame.wxc" } void Bmpp4Frame::CorrectGUI(void) { #line 1219 "Bmpp4Frame.wxc" if (!bIsCorrecting) { #line 1220 "Bmpp4Frame.wxc" /* Avoid recursive calls */ bIsCorrecting = true; /* Enable or disable PS specific components */ switch (chOutputMode->GetSelection()) { case 0 : case 1 : case 2 : { /* PDF */ chPsLevel->Enable(false); cbDsc->Enable(false); cbLzw->Enable(false); } break; default : { /* PS or EPS */ chPsLevel->Enable(true); cbDsc->Enable(true); if (0 == chPsLevel->GetSelection()) { /* PS 2 */ cbLzw->Enable(true); } else { /* PS 3 */ cbLzw->Enable(false); } } break; } /* Enable or disable job specific components */ switch (chOutputMode->GetSelection()) { case 2: case 5: { /* document */ chFinishing->Enable(true); cbRotation->Enable(true); chPaperSizes->Enable(true); } break; default: { /* not a document */ chFinishing->Enable(false); cbRotation->Enable(false); chPaperSizes->Enable(false); } break; } /* Enable or disable resolution text input field */ switch(chResolution->GetSelection()) { case 2: { tfResolution->Enable(true); } break; default: { tfResolution->Enable(false); } break; } /* Enable or disable Interpolation DCT */ if (0 != cbImgInterpolation->GetValue()) { cbDctInterpolation->Enable(true); } else { cbDctInterpolation->Enable(false); } /* Enable or disable RGB to gray method selection */ if (0 != cbColorOutput->GetValue()) { chRgbToGray->Enable(false); } else { chRgbToGray->Enable(true); } /* Mark as done */ bIsCorrecting = false; /* Update GUI */ Refresh(); Update(); } #line 1305 "Bmpp4Frame.wxc" } void Bmpp4Frame::ConfigurationToGUI(void) { wxChar b1[64]; /* Conversion buffer */ wxChar b2[DK4_SIZEOF(b1,wxChar)]; /* Conversion buffer */ size_t szb = DK4_SIZEOF(b1,wxChar); /* Size of b1 and b2 (elems) */ size_t papi = 0; /* Paper size index */ int res = 0; /* Operation result */ #line 1318 "Bmpp4Frame.wxc" /* Output mode */ switch (graconf.driver) { case DK4_GRA_DRIVER_PS : { switch (graconf.purpose) { case DK4_GRA_PURPOSE_DOCUMENT : { chOutputMode->SetSelection(5); } break; default : { chOutputMode->SetSelection(4); } break; } } break; case DK4_GRA_DRIVER_EPS : { chOutputMode->SetSelection(3); } break; default : { switch (graconf.purpose) { case DK4_GRA_PURPOSE_DOCUMENT : { chOutputMode->SetSelection(2); } break; case DK4_GRA_PURPOSE_IMAGE : { chOutputMode->SetSelection(1); } break; default : { /* DK4_GRA_PURPOSE_OBJECT */ chOutputMode->SetSelection(0); } break; } } break; } /* PS level */ chPsLevel->SetSelection((3 == graconf.ps_level) ? (1) : (0)); /* DSC */ cbDsc->SetValue((0 != graconf.ps_dsc) ? (1) : (0)); /* LZW */ cbLzw->SetValue((0 != graconf.ps_lzw) ? (1) : (0)); /* Paper size */ if ((0 != graconf.have_psi) && (szPaperSizes > graconf.psi)) { chPaperSizes->SetSelection((int)(graconf.psi)); } else { if (0 != graconf.have_psi) { chPaperSizes->SetSelection(graconf.psi); } else { res = dk4paper_find_nearest( &papi, pPaperSizes, szPaperSizes, &(graconf.media), NULL ); if (0 != res) { chPaperSizes->SetSelection(papi); } else { chPaperSizes->SetSelection(0); } } } /* Rotate */ cbRotation->SetValue((0 != graconf.img_rot) ? 1 : 0); /* Finishing */ if (0 != graconf.doc_tumble) { chFinishing->SetSelection(2); } else { chFinishing->SetSelection((0 != graconf.doc_duplex) ? (1) : (0)); } /* Resolution */ if ((0.0 < graconf.xres) && (0.0 < graconf.yres)) { chResolution->SetSelection(2); /* 2018-03-28 The buffer overflow reported from wxWidgets libraries magically disappeared after rebuilding the entire project with debug messages. May be rebuilding one module was missing before. */ #line 1400 "Bmpp4Frame.wxc" if (0 != dk4ma_write_wx_double(b1,szb,graconf.xres,0,1,NULL)) { #line 1402 "Bmpp4Frame.wxc" if (0 != dk4ma_write_wx_double(b2,szb,graconf.yres,0,1,NULL)) { #line 1404 "Bmpp4Frame.wxc" tfResolution->SetValue(wxString(b1) + wxT(" ") + wxString(b2)); #line 1406 "Bmpp4Frame.wxc" } else { #line 1408 "Bmpp4Frame.wxc" } } else { #line 1411 "Bmpp4Frame.wxc" } #line 1413 "Bmpp4Frame.wxc" } else { chResolution->SetSelection((graconf.img_ign_res) ? (1) : (0)); } /* Background */ if ((0 <= graconf.img_bg_r) && (256 > graconf.img_bg_r)) { if ((0 <= graconf.img_bg_g) && (256 > graconf.img_bg_g)) { if ((0 <= graconf.img_bg_b) && (256 > graconf.img_bg_b)) { ccBackground->SetRGB( graconf.img_bg_r, graconf.img_bg_g, graconf.img_bg_b ); } } } /* Enforce background */ cbBackground->SetValue((0 != graconf.img_bg_f) ? (1) : (0)); /* Color */ cbColorOutput->SetValue((0 != graconf.color) ? (1) : (0)); /* Interpolation */ cbImgInterpolation->SetValue((0 != graconf.img_int) ? (1) : (0)); /* DCT */ cbDct->SetValue((0 != graconf.img_dct) ? (1) : (0)); /* DCT interpolation */ cbDctInterpolation->SetValue((0 != graconf.img_dct_int) ? (1) : (0)); /* Analzse bpc */ cbAnBpc->SetValue((0 != graconf.img_an_bpc) ? (1) : (0)); /* Analzse color */ cbAnColor->SetValue((0 != graconf.img_an_color) ? (1) : (0)); /* Analyze alpha */ cbAnAlpha->SetValue((0 != graconf.img_an_alpha) ? (1) : (0)); /* RGB to gray method */ if (0 <= graconf.ctx.rgb_to_gray) { chRgbToGray->SetSelection(graconf.ctx.rgb_to_gray); } #line 1467 "Bmpp4Frame.wxc" } void Bmpp4Frame::ConfigurationFromGUI(void) { wxChar buffer[128]; wxChar const *ep; wxChar *p1 = NULL; wxChar *p2 = NULL; double xres = -1.0; double yres = -1.0; size_t szbu = DK4_SIZEOF(buffer,wxChar); int choiceindex; int ok = 0; #line 1484 "Bmpp4Frame.wxc" /* Output mode */ switch (chOutputMode->GetSelection()) { case 0 : { graconf.driver = DK4_GRA_DRIVER_PDF; graconf.purpose = DK4_GRA_PURPOSE_OBJECT; } break; case 1 : { graconf.driver = DK4_GRA_DRIVER_PDF; graconf.purpose = DK4_GRA_PURPOSE_IMAGE; } break; case 2 : { graconf.driver = DK4_GRA_DRIVER_PDF; graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT; } break; case 3 : { graconf.driver = DK4_GRA_DRIVER_EPS; graconf.purpose = DK4_GRA_PURPOSE_IMAGE; } break; case 4 : { graconf.driver = DK4_GRA_DRIVER_PS; graconf.purpose = DK4_GRA_PURPOSE_IMAGE; } break; case 5 : { graconf.driver = DK4_GRA_DRIVER_PS; graconf.purpose = DK4_GRA_PURPOSE_DOCUMENT; } break; default : { graconf.driver = DK4_GRA_DRIVER_PDF; graconf.purpose = DK4_GRA_PURPOSE_OBJECT; } break; } /* PS level */ switch (chPsLevel->GetSelection()) { case 0 : { graconf.ps_level = 2; } break; default : { graconf.ps_level = 3; } break; } /* DSC */ graconf.ps_dsc = ((0 != cbDsc->GetValue()) ? 1 : 0); /* LZW */ graconf.ps_lzw = ((0 != cbLzw->GetValue()) ? 1 : 0); /* Paper size */ choiceindex = chPaperSizes->GetSelection(); if ((0 <= choiceindex) && (szPaperSizes > (size_t)choiceindex)) { dk4mem_cpy( &(graconf.media), &(pPaperSizes[choiceindex]), sizeof(dk4_paper_size_t), NULL ); } /* Rotate */ graconf.img_rot = ((0 != cbRotation->GetValue()) ? 1 : 0); /* Finishing */ switch (chFinishing->GetSelection()) { case 2 : { graconf.doc_duplex = 1; graconf.doc_tumble = 1; } break; case 1 : { graconf.doc_duplex = 1; graconf.doc_tumble = 0; } break; default : { graconf.doc_duplex = 0; graconf.doc_tumble = 0; } break; } /* Resolution */ switch (chResolution->GetSelection()) { case 2 : { /* specify */ /* ##### TODO: Implementation: Retrieve values from text field */ wxCStrData valuestrdata = tfResolution->GetValue().c_str(); if ( 0 != dk4strx_cpy_s( buffer, szbu, (wxChar const *)valuestrdata, NULL ) ) { p1 = dk4strx_start(buffer, NULL); if (NULL != p1) { p2 = dk4strx_next(p1, NULL); ep = NULL; if (0 != dk4ma_input_wx_double(&xres, p1, &ep, 1, NULL)) { ok = 1; yres = xres; } if (NULL != p2) { ep = NULL; if (0 == dk4ma_input_wx_double(&yres,p2,&ep,1,NULL)) { ok = 0; } } if (1 == ok) { if ((0.0 < xres) && (0.0 < yres)) { graconf.xres = xres; graconf.yres = yres; } } } } graconf.img_ign_res = 0; } break; case 1 : { /* ignore */ graconf.img_ign_res = 1; graconf.xres = graconf.yres = 72.0; } break; default : { /* chunk */ graconf.img_ign_res = 0; graconf.xres = graconf.yres = -1.0; } break; } /* Background */ graconf.img_bg_r = ccBackground->Red(); graconf.img_bg_g = ccBackground->Green(); graconf.img_bg_b = ccBackground->Blue(); /* Enforce background */ graconf.img_bg_f = ((0 != cbBackground->GetValue()) ? 1 : 0); /* Color */ graconf.color = ((0 != cbColorOutput->GetValue()) ? 1 : 0); /* Interpolation */ graconf.img_int = ((0 != cbImgInterpolation->GetValue()) ? 1 : 0); /* DCT */ graconf.img_dct = ((0 != cbDct->GetValue()) ? 1 : 0); /* DCT interpolation */ graconf.img_dct_int = ((0 != cbDctInterpolation->GetValue()) ? 1 : 0); /* Analzse bpc */ graconf.img_an_bpc = ((0 != cbAnBpc->GetValue()) ? 1 : 0); /* Analzse color */ graconf.img_an_color = ((0 != cbAnColor->GetValue()) ? 1 : 0); /* Analyze alpha */ graconf.img_an_alpha = ((0 != cbAnAlpha->GetValue()) ? 1 : 0); /* RGB to gray method */ switch (chRgbToGray->GetSelection()) { case 12 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_BLUE; } break; case 11 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_GREEN; } break; case 10 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_CHANNEL_RED; } break; case 9 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MAX_DECOMPOSITION; } break; case 8 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MEDIUM_DECOMPOSITION; } break; case 7 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_MIN_DECOMPOSITION; } break; case 6 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_DESATURATION; } break; case 5 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_AVERAGE; } break; case 4 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_VERY_FAST; } break; case 3 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_FAST; } break; case 2 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT709; } break; case 1 : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_LUMA; } break; default : { graconf.ctx.rgb_to_gray = DK4_CS_CONV_RGB_TO_GRAY_ITU_BT601; } break; } #line 1693 "Bmpp4Frame.wxc" } void Bmpp4Frame::OnIdle(wxIdleEvent & event) { #if TRACE_DEBUG static unsigned long number = 0UL; dk4_time_t timer; #endif bool rqm = false; bool success; #line 1707 "Bmpp4Frame.wxc" #if TRACE_DEBUG dk4time_get(&timer); #endif #line 1711 "Bmpp4Frame.wxc" if (bActive) { #line 1712 "Bmpp4Frame.wxc" if (bAutorun) { #line 1713 "Bmpp4Frame.wxc" switch (oAsc.GetReaction()) { case Dk4WxAutostartController::REACTION_START : { #line 1715 "Bmpp4Frame.wxc" oAsc.StartProcessing(); success = RunConversion(); rqm = true; if (success) { lDirectoryName->SetLabel(sTexts[91]); lDirectoryName->SetForegroundColour(cGreen); } else { #if 0 oAsc.SetAutoExit(false); rqm = false; #endif lDirectoryName->SetLabel(sTexts[92]); lDirectoryName->SetForegroundColour(cRed); } lDirectoryName->Refresh(); lDirectoryName->Update(); oAsc.EndProcessing(); #line 1733 "Bmpp4Frame.wxc" } break; case Dk4WxAutostartController::REACTION_MORE : { #line 1735 "Bmpp4Frame.wxc" rqm = true; } break; case Dk4WxAutostartController::REACTION_EXIT : { #line 1738 "Bmpp4Frame.wxc" bActive = false; Show(false); Close(); rqm = false; } break; default : { /* includes DK4WX_AUTOSTART_REACTION_IGNORE */ #line 1745 "Bmpp4Frame.wxc" } break; } } else { #line 1749 "Bmpp4Frame.wxc" } } else { #line 1752 "Bmpp4Frame.wxc" } #if TRACE_DEBUG dk4time_get(&timer); #endif #line 1757 "Bmpp4Frame.wxc" if (rqm) { event.RequestMore(); } event.Skip(); } /* vim: set ai sw=4 ts=4 : */