main.cpp

00001 
00002 /***************************************************************************
00003  *  main.cpp - YUV viewer gui
00004  *
00005  *  Created:  Sat Mar 22 16:34:02 2009
00006  *  Copyright 2009 Christof Rath <c.rath@student.tugraz.at>
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #include "yuv_viewer_gui.h"
00024 
00025 #include <core/exception.h>
00026 
00027 #include <libglademm/xml.h>
00028 #include <iostream>
00029 
00030 using namespace std;
00031 
00032 int main(int argc, char** argv)
00033 {
00034   Glib::thread_init();
00035 
00036   try
00037   {
00038     Gtk::Main kit(argc, argv);
00039 
00040 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00041     Glib::RefPtr<Gnome::Glade::Xml> refxml = Gnome::Glade::Xml::create(RESDIR"/guis/yuv_viewer/yuv_viewer.glade");
00042 #else
00043     std::auto_ptr<Gnome::Glade::XmlError> error;
00044     Glib::RefPtr<Gnome::Glade::Xml> refxml = Gnome::Glade::Xml::create(RESDIR"/guis/yuv_viewer/yuv_viewer.glade", "", "", error);
00045     if (error.get()) {
00046       throw fawkes::Exception("Failed to load Glade file: %s", error->what().c_str());
00047     }
00048 #endif
00049 
00050     YuvViewerGtkWindow *window = NULL;
00051     refxml->get_widget_derived("wndMain", window);
00052 
00053     kit.run( *window );
00054 
00055     delete window;
00056   }
00057   catch (std::exception const& e)
00058   {
00059     std::cerr << "Error: " << e.what() << std::endl;
00060   }
00061 
00062   return 0;
00063 }

Generated on Tue Feb 22 13:31:18 2011 for Fawkes API by  doxygen 1.4.7