5bca604f0c06d7d3c0c8d746e2aabefb53d2bb43
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) #include <gtkmm.h>
21) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

22) #include "config.h"
23) #include "draw.h"
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

24) #include "main_window.h"
25) 
26) /**
27)  * @brief constructor
28)  * @param[in] Gtk Window object (a C object)
29)  * @param[in] builder reference to GTK builder object
30)  */
31) MainWindow::MainWindow(BaseObjectType *cobject,
32)                        const Glib::RefPtr<Gtk::Builder> &builder):
33)   Gtk::Window(cobject),
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

34)   m_builder(builder),
35)   m_config(NULL)
Stefan Schuermans begin of simulator: window...

Stefan Schuermans authored 7 years ago

36) {
37)   // get widgets
38)   builder->get_widget_derived("Draw", m_draw);
39)   builder->get_widget("Status", m_status);
40) 
41)   // connect callbacks
42)   signal_hide().connect(sigc::mem_fun(*this, &MainWindow::on_hide));
43) }
44) 
45) /// virtual destructor
46) MainWindow::~MainWindow()
47) {
48) }
49) 
Stefan Schuermans implement drawing pixels

Stefan Schuermans authored 7 years ago

50) /// set configuration object
51) void MainWindow::setConfig(Config const &config)
52) {
53)   m_config = &config;
54)   m_draw->setConfig(config);
55) }
56)