--- nono/wx/wxheader.h 2026/04/29 17:04:39 1.1.1.3 +++ nono/wx/wxheader.h 2026/04/29 17:05:08 1.1.1.5 @@ -4,57 +4,34 @@ // Licensed under nono-license.txt // -#pragma once +// +// wxWidgets のヘッダをよろしく読み込むためのヘッダ +// -#include "header.h" -#include "object.h" +#pragma once // wx のシステムヘッダ内で警告出られてもどうしようもないのでワーニング抑制 #if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Weverything" +#define PRAGMA_PUSH_WARNINGS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Weverything\"") +#define PRAGMA_POP_WARNINGS \ + _Pragma("clang diagnostic pop") #else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" -#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#define PRAGMA_PUSH_WARNINGS \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") \ + _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"") +#define PRAGMA_POP_WARNINGS \ + _Pragma("GCC diagnostic pop") #endif + +PRAGMA_PUSH_WARNINGS + #include #ifndef WX_PRECOMP #include #endif -// ワーニング抑制ここまで -#if defined(__clang__) -#pragma clang diagnostic pop -#else -#pragma GCC diagnostic pop -#endif - -// 独自のイベントタイプ -wxDECLARE_EVENT(WXW_EVT_CREATE, wxCommandEvent); -wxDECLARE_EVENT(WXW_EVT_HALT_NOTIFY, wxCommandEvent); - -// OnCreate イベントがあるかのように扱う -// イベント登録 -#define EVT_CREATE(func) EVT_COMMAND(wxID_ANY, WXW_EVT_CREATE, func) -// OnCreate イベントを使う場合コンストラクタでコールしておく -#define POST_CREATE() do { \ - wxCommandEvent *event = new wxCommandEvent(WXW_EVT_CREATE); \ - QueueEvent(event); \ -} while (0) - -// フォント種別というかフォントサイズ。 -// 配列のインデックスとして使うので有効な値を 0 から列挙する。 -enum FontId { - None = -1, - _6x12 = 0, - _8x16, - Max, -}; -#define FONT_6x12 wxSize(6, 12) -#define FONT_8x16 wxSize(8, 16) - -class WXMainFrame; -class WXMainView; -class WXTextScreen; +PRAGMA_POP_WARNINGS