Fawkes API  Fawkes Development Version
main.cpp
1 
2 /***************************************************************************
3  * main.cpp - Plugin Tool Gui
4  *
5  * Created: Thu Nov 09 20:13:45 2007
6  * Copyright 2007 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include <core/exception.h>
24 #include <tools/plugin_gui/plugin_gui.h>
25 #ifdef HAVE_GCONFMM
26 # include <gconfmm.h>
27 #endif
28 #include <iostream>
29 
30 #if GTK_VERSION_GE(3,0)
31 # define UI_FILE RESDIR"/guis/plugin_tool/plugin_gui.ui"
32 #else
33 # define UI_FILE RESDIR"/guis/plugin_tool/plugin_gui_gtk2.ui"
34 #endif
35 
36 
37 using namespace std;
38 
39 int main(int argc, char** argv)
40 {
41  try
42  {
43  Gtk::Main kit(argc, argv);
44 #ifdef HAVE_GCONFMM
45  Gnome::Conf::init();
46 #endif
47 
48  Glib::RefPtr<Gtk::Builder> builder;
49  try {
50  builder =
51  Gtk::Builder::create_from_file(UI_FILE);
52  } catch (Gtk::BuilderError &e) {
53  printf("Failed to create GUI: %s\n", e.what().c_str());
54  }
55 
56  PluginGuiGtkWindow *window = NULL;
57  builder->get_widget_derived("wndMain", window);
58 
59  kit.run( *window );
60 
61  delete window;
62  }
63  catch (std::exception const& e)
64  {
65  std::cerr << "Error: " << e.what() << std::endl;
66  }
67 
68  return 0;
69 }
Graphical plugin management tool.
Definition: plugin_gui.h:36
STL namespace.