5c70d9d85a6f690ae5c591b7d884677efad7fbaa
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

1) /*
2)  * EtherPix simulator
3)  *
4)  * Copyright 2017 Stefan Schuermans <stefan schuermans info>
5)  *
6)  * This program is free software: you can redistribute it and/or modify
7)  * it under the terms of the GNU General Public License as published by
8)  * the Free Software Foundation, version 3 of the License.
9)  *
10)  *
11)  * This program is distributed in the hope that it will be useful,
12)  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13)  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14)  * GNU General Public License for more details.
15)  *
16)  * You should have received a copy of the GNU Lesser General Public License
17)  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18)  */
19) 
20) #ifndef MAIN_WINDOW_H
21) #define MAIN_WINDOW_H
22) 
23) #include <gtkmm.h>
24) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

25) #include "config.h"
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

26) #include "draw.h"
27) 
28) /// main window of StateTracker GUI
29) class MainWindow: public Gtk::Window
30) {
31) public:
32)   /**
33)    * @brief constructor
34)    * @param[in] Gtk Window object (a C object)
35)    * @param[in] builder reference to GTK builder object
36)    */
37)   MainWindow(BaseObjectType *cobject,
38)              const Glib::RefPtr<Gtk::Builder> &builder);
39) 
40)   /// virtual destructor
41)   virtual ~MainWindow();
42) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

43)   /// set configuration object
Stefan Schuermans implement receiving packets

Stefan Schuermans authored 7 years ago

44)   void setConfig(Config & config);
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

45) 
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

46) protected:
47)   /// window is being hidden
48)   void on_hide();
49) 
50)   /// set status bar text
51)   void set_status(std::string const &txt);
52) 
Stefan Schuermans implement receiving packets

Stefan Schuermans authored 7 years ago

53)   /// timer callback
54)   bool on_timer(int timerno);
55) 
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

56) protected:
57)   /// reference to GTK builder object
58)   Glib::RefPtr<Gtk::Builder> m_builder;
59) 
60)   /// drawing area
61)   Draw *m_draw;
62)   /// status bar
63)   Gtk::Statusbar *m_status;
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

64) 
65)   /// configuration object
Stefan Schuermans implement receiving packets

Stefan Schuermans authored 7 years ago

66)   Config *m_config;
67) 
68)   /// timer connection
69)   sigc::connection m_timer;
70) 
71)   /// packet count per second
72)   //@{
73)   unsigned long m_packets; ///< packet counter
74)   unsigned long m_time_ms; ///< time counter
75)   //@}
76)