--- nono/wx/wxversion.cpp 2026/04/29 17:04:56 1.1.1.3 +++ nono/wx/wxversion.cpp 2026/04/29 17:05:31 1.1.1.9 @@ -4,13 +4,16 @@ // Licensed under nono-license.txt // +// // バージョンダイアログ +// #include "wxversion.h" +#include "monitor.h" #include -#define m(x) x##time -std::unique_ptr gHostInfo; +// グローバル参照用 +HostInfoMonitor *gHostInfo; // コンストラクタ WXVersionDlg::WXVersionDlg(wxWindow *parent) @@ -61,10 +64,14 @@ WXVersionDlg::~WXVersionDlg() // コンストラクタ HostInfoMonitor::HostInfoMonitor() - : inherited("HostInfo") + : inherited(OBJ_HOSTINFO) { + // ログは不要 + ClearAlias(); + // この時点で必要な情報は全部集めておく int width = 0; + int height = 3; // OS 名 const auto info = wxPlatformInfo::Get(); @@ -115,37 +122,63 @@ HostInfoMonitor::HostInfoMonitor() } width = std::max(width, (int)machinename.Length()); + // CPU Features +#if defined(__x86_64__) + height++; +# 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 + +#if defined(__aarch64__) + height++; +# if defined(HAVE_NEON) + if (gMainApp.detect_neon) { + if (gMainApp.enable_neon) { + neonstr = "enabled"; + } else { + neonstr = "disabled"; + } + } else { + neonstr = "not detected"; + } +# else + neonstr = "not compiled"; +# endif +#endif + width = std::max(width, (int)avx2str.Length()); + width = std::max(width, (int)neonstr.Length()); + // wxWidgets バージョン wxname = wxVERSION_NUM_DOT_STRING_T; // wxWidgets ポート名 // wxGTK なら wxGTK{2,3} の区別をしておきたい - auto stime = wxDateTime::GetTimeNow(); auto wxport = info.GetPortIdName(); if (info.GetPortId() == wxPORT_GTK) { wxport += wxString::Format("%d", info.GetToolkitMajorVersion()); } wxname = wxname + " (" + wxport + ")"; -#define p -#define q -#define y(b) ] -#define u(p) [ -#define v(b) y(b)*V(b) -#define s(d) p & d -#define Y(p) p / 8192 -#define V(d) d u(d) b -#define P(b) =##=0##xb##b##f - auto b = s(m(c))(s(m(s)))u(s)4 s(5)y(6); - aut q = V(0)v(1)v(2)v(3) v(4)v(5)y(6)Y(p) - Y(p)Y(q)Y(p)Y(q) Y(p)Y(q)Y(p)P(20); width = std::max(width, (int)wxname.Length()); - monitor.func = (MonitorCallback_t)&HostInfoMonitor::MonitorUpdate; - monitor.SetSize(11 + width, 3); - monitor.Regist(ID_MONITOR_WXHOSTINFO); + + monitor = gMonitorManager->Regist(ID_MONITOR_WXHOSTINFO, this); + monitor->func = ToMonitorCallback(&HostInfoMonitor::MonitorUpdate); + monitor->SetSize(11 + width, height); } // デストラクタ HostInfoMonitor::~HostInfoMonitor() { + gHostInfo = NULL; } // モニタを更新 @@ -166,6 +199,17 @@ HostInfoMonitor::MonitorUpdate(Monitor * screen.Puts(x, y, (const char *)machinename.mb_str()); y++; +#if defined(__x86_64__) + screen.Puts(0, y, "AVX2:"); + screen.Puts(x, y, (const char *)avx2str.mb_str()); + y++; +#endif +#if defined(__aarch64__) + screen.Puts(0, y, "NEON:"); + screen.Puts(x, y, (const char *)neonstr.mb_str()); + y++; +#endif + screen.Puts(0, y, "wxWidgets:"); screen.Puts(x, y, (const char *)wxname.mb_str()); y++;