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 DRAW_H
21) #define DRAW_H
22) 
23) #include <gtkmm.h>
24) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 7 years ago

27) /// drawing area
28) class Draw: public Gtk::DrawingArea
29) {
30) public:
31)   /**
32)    * @brief constructor
33)    * @param[in] Gtk Window object (a C object)
34)    * @param[in] builder reference to GTK builder object
35)    */
36)   Draw(BaseObjectType *cobject,
37)        const Glib::RefPtr<Gtk::Builder> &builder);
38) 
39)   /// virtual destructor
40)   virtual ~Draw();
41) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

42)   /// set configuration object
43)   void setConfig(Config const&config);
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

44) 
Stefan Schuermans implement receiving packets

Stefan Schuermans authored 7 years ago

45)   /// request image update
46)   void reqUpdate();
47) 
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

48) protected:
49)   /**
50)    * @brief widget is (re)configured
51)    * @param[in] cfg configuration event
52)    * @return if callback was completely handled
53)    */
54)   virtual bool on_configure_event(GdkEventConfigure *cfg);
55) 
56)   /**
57)    * @brief widget is being drawn
58)    * @param[in] cairo cairo context for drawing
59)    * @return if callback was completely handled
60)    */
61)   virtual bool on_draw(const Cairo::RefPtr<Cairo::Context> &cairo);
62) 
63)   /// update image
64)   void updateImage();
65) 
66) protected:
67)   /// reference to GTK builder object
68)   Glib::RefPtr<Gtk::Builder> m_builder;
69) 
70)   /// cairo surface with current simulator image
71)   Cairo::RefPtr<Cairo::ImageSurface> m_image;
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

72) 
73)   /// configuration object
74)   Config const *m_config;