--- nono/wx/wxversion.cpp 2026/04/29 17:04:40 1.1.1.2 +++ nono/wx/wxversion.cpp 2026/04/29 17:05:23 1.1.1.7 @@ -4,12 +4,15 @@ // Licensed under nono-license.txt // +// // バージョンダイアログ +// #include "wxversion.h" #include -std::unique_ptr gHostInfo; +// グローバル参照用 +HostInfoMonitor *gHostInfo; // コンストラクタ WXVersionDlg::WXVersionDlg(wxWindow *parent) @@ -60,9 +63,13 @@ WXVersionDlg::~WXVersionDlg() // コンストラクタ HostInfoMonitor::HostInfoMonitor() + : inherited(OBJ_HOSTINFO) { + // ログは不要 + ClearAlias(); + // この時点で必要な情報は全部集めておく - width = 0; + int width = 0; // OS 名 const auto info = wxPlatformInfo::Get(); @@ -113,49 +120,75 @@ HostInfoMonitor::HostInfoMonitor() } width = std::max(width, (int)machinename.Length()); + // CPU Features +#if defined(__x86_64__) +# if defined(HAVE_AVX2) + if (gMainApp.detect_avx2) { + if (gMainApp.enable_avx2) { + avx2str = "enabled"; + } else { + avx2str = "disabled"; + } + } else { + avx2str = "not detected"; + } +# else + avx2str = "not compiled"; +# endif +#endif + width = std::max(width, (int)avx2str.Length()); + // wxWidgets バージョン wxname = wxVERSION_NUM_DOT_STRING_T; // wxWidgets ポート名 // wxGTK なら wxGTK{2,3} の区別をしておきたい - wxString wxport = info.GetPortIdName(); + auto wxport = info.GetPortIdName(); if (info.GetPortId() == wxPORT_GTK) { wxport += wxString::Format("%d", info.GetToolkitMajorVersion()); } wxname = wxname + " (" + wxport + ")"; width = std::max(width, (int)wxname.Length()); + + int height = 3; +#if defined(__x86_64__) // HAVE_AVX2 ではなく + height++; +#endif + monitor.func = ToMonitorCallback(&HostInfoMonitor::MonitorUpdate); + monitor.SetSize(11 + width, height); + monitor.Regist(ID_MONITOR_WXHOSTINFO); } // デストラクタ HostInfoMonitor::~HostInfoMonitor() { -} - -// モニタサイズを取得 -nnSize -HostInfoMonitor::GetMonitorSize() -{ - return nnSize(11 + width, 3); + gHostInfo = NULL; } // モニタを更新 void -HostInfoMonitor::MonitorUpdate(TextScreen& monitor) +HostInfoMonitor::MonitorUpdate(Monitor *, TextScreen& screen) { int x = 11; int y; - monitor.Clear(); + screen.Clear(); y = 0; - monitor.Puts(0, y, "OS:"); - monitor.Puts(x, y, (const char *)osname.mb_str()); + screen.Puts(0, y, "OS:"); + screen.Puts(x, y, (const char *)osname.mb_str()); y++; - monitor.Puts(0, y, "Machine:"); - monitor.Puts(x, y, (const char *)machinename.mb_str()); + screen.Puts(0, y, "Machine:"); + screen.Puts(x, y, (const char *)machinename.mb_str()); y++; - monitor.Puts(0, y, "wxWidgets:"); - monitor.Puts(x, y, (const char *)wxname.mb_str()); +#if defined(__x86_64__) + screen.Puts(0, y, "AVX2:"); + screen.Puts(x, y, (const char *)avx2str.mb_str()); + y++; +#endif + + screen.Puts(0, y, "wxWidgets:"); + screen.Puts(x, y, (const char *)wxname.mb_str()); y++; }