/* Copyright (C) 2015-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: Dk4FcsFrame.wxc */ /** @file Dk4FcsFrame.cpp The Dk4FcsFrame module. */ #line 250 "Dk4FcsFrame.wxc" #include "dk4conf.h" #include "wxdkfcs.h" #include "dk4mem.h" #include "dk4verswx.h" #if DK4_HAVE_OPENSSL_MD5_H #ifndef OPENSSL_MD5_H_INCLUDED #include #define OPENSSL_MD5_H_INCLUDED 1 #endif #endif #if DK4_HAVE_OPENSSL_RIPEMD_H #ifndef OPENSSL_RIPEMD_H_INCLUDED #include #define OPENSSL_RIPEMD_H_INCLUDED 1 #endif #endif #if DK4_HAVE_OPENSSL_SHA_H #ifndef OPENSSL_SHA_H_INCLUDED #include #define OPENSSL_SHA_H_INCLUDED 1 #endif #endif #if !defined(__WXMSW__) #include "gui-img/icons/dkicon.xpm" #endif #line 286 "Dk4FcsFrame.wxc" #if wxCHECK_VERSION(3,0,0) wxBEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame) #else BEGIN_EVENT_TABLE(Dk4FcsFrame,wxFrame) #endif EVT_MENU(Dk4FcsFrame_Quit, Dk4FcsFrame::OnQuit) EVT_MENU(Dk4FcsFrame_Open, Dk4FcsFrame::OnOpen) EVT_MENU(Dk4FcsFrame_Help_About, Dk4FcsFrame::OnAbout) EVT_MENU(Dk4FcsFrame_Help_Contents, Dk4FcsFrame::OnHelpContents) EVT_IDLE(Dk4FcsFrame::OnIdle) #if wxCHECK_VERSION(3,0,0) wxEND_EVENT_TABLE() #else END_EVENT_TABLE() #endif typedef struct { /* Message digests contexts. */ #if DK4_HAVE_OPENSSL_MD5_H MD5_CTX md5; /**< MD5 context. */ #endif #if DK4_HAVE_OPENSSL_RIPEMD_H RIPEMD160_CTX ripemd160; /**< RIPEMD-160 context. */ #endif #if DK4_HAVE_OPENSSL_SHA_H SHA_CTX sha; /**< SHA-1 context. */ #if DK4_HAVE_SHA224 SHA256_CTX sha224; /**< SHA-224 context. */ #endif #if DK4_HAVE_SHA256 SHA256_CTX sha256; /**< SHA-256 context. */ #endif #if DK4_HAVE_SHA384 SHA512_CTX sha384; /**< SHA-384 context. */ #endif #if DK4_HAVE_SHA512 SHA512_CTX sha512; /**< SHA-512 context. */ #endif #endif int iMd5; /**< Flag: Can use Md5. */ int iRipemd160; /**< Flag: Can use RIPEMD-160. */ int iSha1; /**< Flag: Can use SHA-1. */ int iSha224; /**< Flag: Can use SHA-224. */ int iSha256; /**< Flag: Can use SHA-256. */ int iSha384; /**< Flag: Can use SHA-384. */ int iSha512; /**< Flag: Can use SHA-512. */ } MULTI_CTX; static const wxChar dk4fcs_frame_version[] = { DKT_VERSION_WX }; static void multi_ctx_init(MULTI_CTX *mptr) { #line 352 "Dk4FcsFrame.wxc" DK4_MEMRES(mptr, sizeof(MULTI_CTX)); #if DK4_HAVE_OPENSSL_MD5_H if (1 == MD5_Init(&(mptr->md5))) { mptr->iMd5 = 1; #line 356 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_OPENSSL_RIPEMD_H if (1 == RIPEMD160_Init(&(mptr->ripemd160))) { mptr->iRipemd160 = 1; #line 361 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_OPENSSL_SHA_H if (1 == SHA1_Init(&(mptr->sha))) { mptr->iSha1 = 1; #line 366 "Dk4FcsFrame.wxc" } #if DK4_HAVE_SHA224 if (1 == SHA224_Init(&(mptr->sha224))) { mptr->iSha224 = 1; #line 370 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA256 if (1 == SHA256_Init(&(mptr->sha256))) { mptr->iSha256 = 1; #line 375 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA384 if (1 == SHA384_Init(&(mptr->sha384))) { mptr->iSha384 = 1; #line 380 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA512 if (1 == SHA512_Init(&(mptr->sha512))) { mptr->iSha512 = 1; #line 385 "Dk4FcsFrame.wxc" } #endif #endif #line 389 "Dk4FcsFrame.wxc" } static void multi_ctx_add(MULTI_CTX *mptr, void *buffer, size_t sz) { #line 398 "Dk4FcsFrame.wxc" #if DK4_HAVE_OPENSSL_MD5_H if (1 != MD5_Update(&(mptr->md5), buffer, (unsigned long)sz)) { mptr->iMd5 = 0; #line 401 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_OPENSSL_RIPEMD_H if (1 != RIPEMD160_Update(&(mptr->ripemd160), buffer, (unsigned long)sz)) { mptr->iRipemd160 = 0; #line 406 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_OPENSSL_SHA_H if (1 != SHA1_Update(&(mptr->sha), buffer, (unsigned long)sz)) { mptr->iSha1 = 0; #line 411 "Dk4FcsFrame.wxc" } #if DK4_HAVE_SHA224 if (1 != SHA224_Update(&(mptr->sha224), buffer, (unsigned long)sz)) { mptr->iSha224 = 0; #line 415 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA256 if (1 != SHA256_Update(&(mptr->sha256), buffer, (unsigned long)sz)) { mptr->iSha256 = 0; #line 420 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA384 if (1 != SHA384_Update(&(mptr->sha384), buffer, (unsigned long)sz)) { mptr->iSha384 = 0; #line 425 "Dk4FcsFrame.wxc" } #endif #if DK4_HAVE_SHA512 if (1 != SHA512_Update(&(mptr->sha512), buffer, (unsigned long)sz)) { mptr->iSha512 = 0; #line 430 "Dk4FcsFrame.wxc" } #endif #endif #line 434 "Dk4FcsFrame.wxc" } /** Thread runs while progress dialog is shown. This is a ``fire and forget'' thread destroying itself after running. */ class Dk4FcsThread : public wxThread { protected: /** Buffer for reading input file. */ unsigned char buf[4096]; /** Progress dialog. */ Dk4WxProgressDialog *pPd; /** Multiple message digest contexts. */ MULTI_CTX *pCtx; /** File to read from. */ wxFile *pWxf; public: /** Constructor. @param pd Pointer to progress dialog. @param ctx Pointer to multiple digest contexts collection. @param wxf Pointer to file we read from. */ Dk4FcsThread( Dk4WxProgressDialog *pd, MULTI_CTX *ctx, wxFile *wxf ); /** Thread function. @return Pointer which is ignored. */ virtual void * Entry(); /** Method executed at end of thread. */ virtual void OnExit(); }; Dk4FcsThread::Dk4FcsThread( Dk4WxProgressDialog *pd, MULTI_CTX *ctx, wxFile *wxf ) { #line 497 "Dk4FcsFrame.wxc" pPd = pd; pCtx = ctx; pWxf = wxf; #line 501 "Dk4FcsFrame.wxc" } void * Dk4FcsThread::Entry() { wxFileOffset fileSize = (wxFileOffset)0UL; wxFileOffset bytesRead = (wxFileOffset)0UL; size_t bytes = 0U; int gauge = 0; int ogauge = 0; bool canContinue = true; bool success = true; #line 516 "Dk4FcsFrame.wxc" fileSize = pWxf->Length(); while(canContinue) { #line 518 "Dk4FcsFrame.wxc" if (pPd->CanContinue()) { #line 519 "Dk4FcsFrame.wxc" bytes = pWxf->Read(buf, sizeof(buf)); #line 521 "Dk4FcsFrame.wxc" if (0 < bytes) { #line 522 "Dk4FcsFrame.wxc" if ((size_t)(wxInvalidOffset) != bytes) { #line 523 "Dk4FcsFrame.wxc" multi_ctx_add(pCtx, buf, bytes); bytesRead += (wxFileOffset)bytes; if (bytesRead >= fileSize) { gauge = 1000; #line 527 "Dk4FcsFrame.wxc" } else { gauge = (int)((1000.0 * (double)bytesRead) / ((double)fileSize)); if (1000 < gauge) { gauge = 1000; #line 531 "Dk4FcsFrame.wxc" } } if (gauge != ogauge) { #line 534 "Dk4FcsFrame.wxc" pPd->SetGauge(gauge); ogauge = gauge; } } else { #line 538 "Dk4FcsFrame.wxc" canContinue = false; success = false; } } else { #line 542 "Dk4FcsFrame.wxc" canContinue = false; } } else { #line 545 "Dk4FcsFrame.wxc" canContinue = false; success = false; } #line 548 "Dk4FcsFrame.wxc" } #line 550 "Dk4FcsFrame.wxc" pPd->EndProcessing(success); #line 552 "Dk4FcsFrame.wxc" return NULL; } void Dk4FcsThread::OnExit() { #line 561 "Dk4FcsFrame.wxc" #line 562 "Dk4FcsFrame.wxc" } #line 567 "Dk4FcsFrame.wxc" Dk4FcsFrame::Dk4FcsFrame( int wxid, Dk4WxApplicationHelper *applicationHelper, Dk4WxHelpController *hc, int argc, wxChar **argv, wxChar const * const *localizedTexts, wxChar const * const *nlWx, dkChar const * const *nlDk ) : Dk4WxFrame(nlWx[0], applicationHelper, hc, wxid) { #line 579 "Dk4FcsFrame.wxc" /* Further local variables. */ /* Initialize further local variables. */ sTexts = localizedTexts; sNlWx = nlWx; sNlDk = nlDk; #if defined(__WXMSW__) wxIcon wxdkfcs_icon(sNlWx[4]); #else wxIcon wxdkfcs_icon(xpm_dkicon); #endif /* Initialize further class members. */ bActive = true; sFileName = wxEmptyString; sDirectory = wxEmptyString; if (1 < argc) { sFileName = argv[1]; oAsc.SetAutoStart(true); { wxFileName wxfn(sFileName); sDirectory = wxfn.GetPath(); } #if 0 /* Just to test auto exit. */ oAsc.SetAutoExit(true); #endif } dkctGUILayoutOK = false; dkctGUIContentsPanel = NULL; mainSizer = NULL; mbMain = NULL; menuFile = NULL; menuHelp = NULL; miFileOpen = NULL; miFileExit = NULL; miHelpAbout = NULL; miHelpContents = NULL; verticalSizer = NULL; contentsSizer = NULL; lFile = NULL; tFile = NULL; gResults = 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; } miFileOpen = menuFile->Append( Dk4FcsFrame_Open, sTexts[23], sTexts[24] ); if(!(miFileOpen)) { goto dkctGUILayoutFinished; } miFileExit = menuFile->Append( Dk4FcsFrame_Quit, sTexts[1], sTexts[2] ); if(!(miFileExit)) { goto dkctGUILayoutFinished; } mbMain->Append(menuFile, sTexts[0]); menuHelp = new wxMenu( ); if(!(menuHelp)) { goto dkctGUILayoutFinished; } miHelpAbout = menuHelp->Append( Dk4FcsFrame_Help_About, sTexts[4], sTexts[5] ); if(!(miHelpAbout)) { goto dkctGUILayoutFinished; } miHelpContents = menuHelp->Append( Dk4FcsFrame_Help_Contents, sTexts[6], sTexts[7] ); if(!(miHelpContents)) { goto dkctGUILayoutFinished; } mbMain->Append(menuHelp, sTexts[3]); SetMenuBar(mbMain); #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; } lFile = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, sTexts[13] ); if(!(lFile)) { goto dkctGUILayoutFinished; } contentsSizer->Add( lFile, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_RIGHT ); tFile = new wxStaticText( dkctGUIContentsPanel, wxID_ANY, wxT("") ); if(!(tFile)) { goto dkctGUILayoutFinished; } contentsSizer->Add( tFile, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALIGN_LEFT ); gResults = new wxGrid( dkctGUIContentsPanel, wxID_ANY ); if(!(gResults)) { goto dkctGUILayoutFinished; } gResults->CreateGrid(7, 1); gResults->SetColLabelValue(0, sTexts[21]); gResults->SetRowLabelValue(0, sTexts[14]); gResults->SetRowLabelValue(1, sTexts[15]); gResults->SetRowLabelValue(2, sTexts[16]); gResults->SetRowLabelValue(3, sTexts[17]); gResults->SetRowLabelValue(4, sTexts[18]); gResults->SetRowLabelValue(5, sTexts[19]); gResults->SetRowLabelValue(6, sTexts[20]); gResults->SetCellValue(0, 0, sNlWx[17]); gResults->SetCellValue(1, 0, sNlWx[17]); gResults->SetCellValue(2, 0, sNlWx[17]); gResults->SetCellValue(3, 0, sNlWx[17]); gResults->SetCellValue(4, 0, sNlWx[17]); gResults->SetCellValue(5, 0, sNlWx[17]); gResults->SetCellValue(6, 0, sNlWx[17]); gResults->SetRowLabelSize(wxGRID_AUTOSIZE); gResults->SetColLabelSize(wxGRID_AUTOSIZE); gResults->AutoSize(); gResults->EnableEditing(false); gResults->SetMinSize(wxSize(300, 200)); contentsSizer->Add( gResults, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALIGN_LEFT|wxGROW ); contentsSizer->AddGrowableRow(1); contentsSizer->AddGrowableCol(1); verticalSizer->Add( contentsSizer, 1, wxGROW ); verticalSizer->Add(10, 10, 0); mainSizer->Add( verticalSizer, 1, wxGROW ); mainSizer->Add(10, 10, 0); dkctGUIContentsPanel->SetSizer(mainSizer); SetIcon(wxdkfcs_icon); dkctGUILayoutOK = true; dkctGUILayoutFinished: #if wxUSE_STATUSBAR if(dkctGUILayoutOK) { CreateStatusBar(1); SetStatusText(sTexts[8]); } #endif if(dkctGUILayoutOK) { mainSizer->Fit(this); mainSizer->SetSizeHints(this); } #line 612 "Dk4FcsFrame.wxc" if(dkctGUILayoutOK) { SetTitle(nlWx[0]); if (1 < argc) { tFile->SetLabel(sFileName); } gResults->SetCellValue(0, 0, sNlWx[5]); gResults->SetCellValue(1, 0, sNlWx[5]); gResults->SetCellValue(2, 0, sNlWx[5]); gResults->SetCellValue(3, 0, sNlWx[5]); gResults->SetCellValue(4, 0, sNlWx[5]); gResults->SetCellValue(5, 0, sNlWx[5]); gResults->SetCellValue(6, 0, sNlWx[5]); } /* Release resources allocated by local variables. */ #line 629 "Dk4FcsFrame.wxc" } #line 632 "Dk4FcsFrame.wxc" Dk4FcsFrame::~Dk4FcsFrame() { #line 638 "Dk4FcsFrame.wxc" /* Release resources allocated by further class members. */ #line 641 "Dk4FcsFrame.wxc" } bool Dk4FcsFrame::CanClose(bool WXUNUSED(isFinal)) { bool back = true; #line 650 "Dk4FcsFrame.wxc" #line 651 "Dk4FcsFrame.wxc" return back; } void Dk4FcsFrame::OnQuit(wxCommandEvent & WXUNUSED(event)) { #line 660 "Dk4FcsFrame.wxc" Close(); #line 662 "Dk4FcsFrame.wxc" } void Dk4FcsFrame::OnAbout(wxCommandEvent & WXUNUSED(event)) { wxString text(wxT("")); wxString title(wxT("")); #line 672 "Dk4FcsFrame.wxc" /* Construct message text. */ text.Append(sNlWx[0]); text.Append(sNlWx[7]); text.Append(dk4fcs_frame_version); #if 0 text.Append(sNlWx[1]); #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]); text.Append(sNlWx[16]); text.Append(sNlWx[8]); text.Append(sNlWx[8]); text.Append(sNlWx[18]); text.Append(sNlWx[8]); text.Append(sNlWx[19]); text.Append(sNlWx[8]); text.Append(sNlWx[20]); text.Append(sNlWx[8]); text.Append(sNlWx[21]); text.Append(sNlWx[8]); text.Append(sNlWx[22]); /* Construct dialog box title. */ title.Append(sTexts[10]); title.Append(sNlWx[0]); /* Show dialog box. */ wxMessageBox(text, title); #line 723 "Dk4FcsFrame.wxc" } void Dk4FcsFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event)) { #line 731 "Dk4FcsFrame.wxc" DisplayContents(); #line 733 "Dk4FcsFrame.wxc" } /* __CHANGE__ 017: Event handlers for further events. */ /** Hexadecimal digits. */ static const wxChar hexdig[] = { wxT("0123456789abcdef") }; void Dk4FcsFrame::SetCellValueBinary( int rowno, unsigned char *buf, size_t bytes ) { wxChar obuf[144]; wxChar *obptr; unsigned short u; #line 759 "Dk4FcsFrame.wxc" if (64 >= bytes) { obptr = obuf; while(bytes--) { u = (unsigned short)(*buf); u = u >> 4; u &= 15; *(obptr++) = hexdig[u]; #line 766 "Dk4FcsFrame.wxc" u = (unsigned short)(*buf); u &= 15; *(obptr++) = hexdig[u]; #line 769 "Dk4FcsFrame.wxc" buf++; } *obptr = wxT('\0'); { wxString testString(obuf); gResults->SetCellValue(rowno, 0, testString); } } else { /* ERROR: message digest too long, need larger obuf! */ } #line 780 "Dk4FcsFrame.wxc" } bool Dk4FcsFrame::RunChecksumming(void) { MULTI_CTX ctx; // Digests contexts collection unsigned char obuf[128]; // Binary message digests Dk4WxProgressDialog *pd = NULL; // Progress dialog Dk4FcsThread *pt = NULL; // Thread int res = 0; // Operation result bool updateTable = false; // Flag: Update the table #line 794 "Dk4FcsFrame.wxc" /* Reset all values. */ gResults->BeginBatch(); gResults->SetCellValue(0, 0, sNlWx[5]); gResults->SetCellValue(1, 0, sNlWx[5]); gResults->SetCellValue(2, 0, sNlWx[5]); gResults->SetCellValue(3, 0, sNlWx[5]); gResults->SetCellValue(4, 0, sNlWx[5]); gResults->SetCellValue(5, 0, sNlWx[5]); gResults->SetCellValue(6, 0, sNlWx[5]); gResults->EndBatch(); gResults->ForceRefresh(); Refresh(); Update(); /* Attempt to build checksum. */ if (wxFile::Exists(sFileName)) { #line 812 "Dk4FcsFrame.wxc" { wxFile wxf(sFileName); if (wxf.IsOpened()) { #line 815 "Dk4FcsFrame.wxc" pd = new Dk4WxProgressDialog(this, pAppHelp); if (NULL != pd) { #line 817 "Dk4FcsFrame.wxc" pt = new Dk4FcsThread(pd, &ctx, &wxf); if (NULL != pt) { #line 819 "Dk4FcsFrame.wxc" multi_ctx_init(&ctx); if(wxTHREAD_NO_ERROR == pt->Create()) { #line 821 "Dk4FcsFrame.wxc" pt->SetPriority(WXTHREAD_DEFAULT_PRIORITY); pt->Run(); res = pd->ShowModal(); if (wxID_OK == res) { #line 825 "Dk4FcsFrame.wxc" updateTable = true; } else { #line 827 "Dk4FcsFrame.wxc" /* !!!!! ERROR: Aborted by user */ } } else { #line 830 "Dk4FcsFrame.wxc" delete(pt); pt = NULL; /* !!!!! ERROR: Failed to create thread */ } } else { #line 835 "Dk4FcsFrame.wxc" /* !!!!! ERROR: No thread */ } pd->Destroy(); } else { #line 839 "Dk4FcsFrame.wxc" /* !!!!! ERROR: No progress dialog */ } } else { #line 842 "Dk4FcsFrame.wxc" /* !!!!! ERROR: Failed to open file */ } } if (updateTable) { #line 846 "Dk4FcsFrame.wxc" gResults->BeginBatch(); #if DK4_HAVE_OPENSSL_MD5_H if (0 != ctx.iMd5) { #line 849 "Dk4FcsFrame.wxc" if (1 == MD5_Final(obuf, &(ctx.md5))) { #line 850 "Dk4FcsFrame.wxc" SetCellValueBinary(0, obuf, 16); } } #endif #if DK4_HAVE_OPENSSL_RIPEMD_H if (0 != ctx.iRipemd160) { #line 856 "Dk4FcsFrame.wxc" if (1 == RIPEMD160_Final(obuf, &(ctx.ripemd160))) { SetCellValueBinary(1, obuf, 20); #line 858 "Dk4FcsFrame.wxc" } } #endif #if DK4_HAVE_OPENSSL_SHA_H if (0 != ctx.iSha1) { #line 863 "Dk4FcsFrame.wxc" if (1 == SHA1_Final(obuf, &(ctx.sha))) { #line 864 "Dk4FcsFrame.wxc" SetCellValueBinary(2, obuf, 20); } } #if DK4_HAVE_SHA224 if (0 != ctx.iSha224) { #line 869 "Dk4FcsFrame.wxc" if (1 == SHA224_Final(obuf, &(ctx.sha224))) { #line 870 "Dk4FcsFrame.wxc" SetCellValueBinary(3, obuf, 28); } } #endif #if DK4_HAVE_SHA256 if (0 != ctx.iSha256) { #line 876 "Dk4FcsFrame.wxc" if (1 == SHA256_Final(obuf, &(ctx.sha256))) { #line 877 "Dk4FcsFrame.wxc" SetCellValueBinary(4, obuf, 32); } } #endif #if DK4_HAVE_SHA384 if (0 != ctx.iSha384) { #line 883 "Dk4FcsFrame.wxc" if (1 == SHA384_Final(obuf, &(ctx.sha384))) { #line 884 "Dk4FcsFrame.wxc" SetCellValueBinary(5, obuf, 48); } } #endif #if DK4_HAVE_SHA512 if (0 != ctx.iSha512) { #line 890 "Dk4FcsFrame.wxc" if (1 == SHA512_Final(obuf, &(ctx.sha512))) { #line 891 "Dk4FcsFrame.wxc" SetCellValueBinary(6, obuf, 64); } } #endif #endif gResults->AutoSize(); gResults->EndBatch(); gResults->ForceRefresh(); { int x, y, w, h; GetPosition(&x, &y); GetSize(&w, &h); mainSizer->Fit(this); SetSize(x, y, w, h); } Refresh(); Update(); } else { #line 909 "Dk4FcsFrame.wxc" } } else { #line 911 "Dk4FcsFrame.wxc" /* !!!!! ERROR: File does not exist */ } #line 914 "Dk4FcsFrame.wxc" return updateTable; } void Dk4FcsFrame::OnOpen(wxCommandEvent & WXUNUSED(event)) { bool canRun = true; int res = 0; #line 925 "Dk4FcsFrame.wxc" { wxFileDialog dlg(this, sTexts[22], sDirectory); res = dlg.ShowModal(); if (wxID_OK == res) { sFileName = dlg.GetPath(); tFile->SetLabel(sFileName); { wxFileName wxfn(sFileName); sDirectory = wxfn.GetPath(); } canRun = true; } else { canRun = false; } } if (canRun) { (void)RunChecksumming(); } #line 944 "Dk4FcsFrame.wxc" } void Dk4FcsFrame::OnIdle(wxIdleEvent & event) { bool success = false; #line 953 "Dk4FcsFrame.wxc" if (bActive) { /* event.RequestMore(); */ switch (oAsc.GetReaction()) { #if 0 case Dk4WxAutostartController::REACTION_IGNORE : { } break; #endif case Dk4WxAutostartController::REACTION_START : { oAsc.StartProcessing(); success = RunChecksumming(); oAsc.EndProcessing(success); } break; case Dk4WxAutostartController::REACTION_MORE : { event.RequestMore(); } break; case Dk4WxAutostartController::REACTION_EXIT : { bActive = false; Close(); } break; } } event.Skip(); #line 976 "Dk4FcsFrame.wxc" }