/*
* EtherPix simulator
*
* Copyright 2017 Stefan Schuermans <stefan schuermans info>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtkmm.h>
#include <iostream>
#include <string.h>
#include "config.h"
#include "etherpix_sim.glade.h"
#include "main_window.h"
int main(int argc, char *argv[])
{
// instantiate GTK main loop
Gtk::Main kit(argc, argv);
// parse arguments
if (argc < 2) {
std::cerr << "usage: " << argv[0] << " <sim_config.etps>" << std::endl;
return 2;
}
char *configFile = argv[1];
try {
// parse config file
Config config(configFile);
// create window
Glib::RefPtr<Gtk::Builder> builder =
Gtk::Builder::create_from_string(widgets_etherpix_sim);
// connect main window to its class
MainWindow *mainWindow;
builder->get_widget_derived("MainWindow", mainWindow);