Annotation of nono/wx/wxtextscreen.h, revision 1.1.1.4

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #pragma once
                      8: 
                      9: #include "wxtextpanel.h"
                     10: 
                     11: //
1.1.1.3   root       12: // テキストスクリーンを表示するパネル
1.1       root       13: //
                     14: // wxPanel
                     15: //  ↓
                     16: // WXTextPanel  テキストフォントを管理するクラス
                     17: //  ↓
1.1.1.3   root       18: // WXTextScreen テキストスクリーンを表示するパネル
1.1       root       19: //
                     20: class WXTextScreen : public WXTextPanel
                     21: {
1.1.1.2   root       22:        using inherited = WXTextPanel;
1.1       root       23: 
                     24:  public:
1.1.1.3   root       25:        WXTextScreen(wxWindow *parent, IMonitor& monitor);
                     26:        virtual ~WXTextScreen() override;
1.1       root       27: 
1.1.1.3   root       28:        // 必要なら画面を更新して再描画する。
                     29:        // TextScreen が前回描画時から更新されていたら、このパネルを再描画する。
                     30:        void RefreshIfUpdated();
1.1       root       31: 
                     32:        // フォントサイズ変更
1.1.1.3   root       33:        void SetFontSize(FontId fontid) override;
                     34: 
                     35:        // 更新頻度設定
                     36:        void SetRate(int hz);
                     37: 
                     38:        // サイズ (桁数×行数) を取得する
                     39:        const wxSize GetSize() const { return wxSize(ts.GetCol(), ts.GetRow()); }
                     40: 
                     41:        // TextScreen のユーザデータ取得、設定
                     42:        uint64 GetUserData() const { return ts.userdata; }
                     43:        void SetUserData(uint64 value) { ts.userdata = value; }
1.1       root       44: 
                     45:  private:
1.1.1.3   root       46:        void OnPaint(wxPaintEvent&);
                     47:        void OnSize(wxSizeEvent&);
                     48:        void OnTimer(wxTimerEvent&);
                     49: 
1.1       root       50:        void Draw(wxDC& dc);
                     51: 
1.1.1.2   root       52:        std::unique_ptr<uint16[]> prevbuf {};
                     53:        std::unique_ptr<uint8[]> bmpbuf {};
                     54:        std::unique_ptr<wxImage> image {};
                     55:        std::unique_ptr<wxBitmap> bitmap {};
1.1       root       56: 
1.1.1.3   root       57:        IMonitor& monitor;
1.1.1.4 ! root       58:        TextScreen ts {};
        !            59:        int view_width {};
        !            60:        int view_height {};
1.1       root       61: 
1.1.1.3   root       62:        wxTimer timer {};
                     63: 
1.1       root       64:        wxDECLARE_EVENT_TABLE();
                     65: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.