LUMIERA.clone/src/gui/gtk-lumiera.cpp

131 lines
2.8 KiB
C++
Raw Normal View History

2008-04-09 00:21:05 +02:00
/*
GtkLumiera - The Lumiera GUI Application Object
2010-12-17 23:28:49 +01:00
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
2010-12-17 23:28:49 +01:00
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
2010-12-17 23:28:49 +01:00
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
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.
2010-12-17 23:28:49 +01:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2010-12-17 23:28:49 +01:00
* *****************************************************/
2008-04-09 00:21:05 +02:00
#include "gui/gtk-lumiera.hpp"
#include "gui/window-manager.hpp"
#include "gui/workspace/workspace-window.hpp"
#include "gui/controller/controller.hpp"
#include "gui/model/project.hpp"
#include "lib/singleton.hpp"
2008-04-09 00:21:05 +02:00
2008-04-19 20:15:59 +02:00
using namespace Gtk;
using namespace Glib;
using namespace gui;
using namespace gui::workspace;
using namespace gui::model;
2009-01-17 17:12:11 +01:00
using namespace gui::controller;
using namespace std;
2008-12-30 13:35:58 +01:00
namespace gui {
namespace {
/** storage for the Main Application object */
lib::Singleton<GtkLumiera> theApplicationInstance;
}
GtkLumiera&
GtkLumiera::application()
{
return theApplicationInstance();
}
void
GtkLumiera::main (int argc, char *argv[])
{
Glib::thread_init();
Main kit(argc, argv);
Glib::set_application_name (get_app_title());
Project project;
2009-01-17 17:12:11 +01:00
Controller controller(project);
windowManagerInstance_.init();
windowManagerInstance_.set_theme ("lumiera_ui.rc");
windowManagerInstance_.new_window (project, controller);
kit.run();
}
2008-04-20 00:16:27 +02:00
2009-01-31 20:30:58 +01:00
WindowManager&
GtkLumiera::windowManager()
2009-01-31 20:30:58 +01:00
{
return windowManagerInstance_;
2009-01-31 20:30:58 +01:00
}
2009-01-10 21:35:43 +01:00
Glib::ustring
GtkLumiera::get_home_data_path()
{
const ustring app_name("lumiera");
const ustring path(Glib::get_home_dir());
return ustring::compose("%1/.%2", path, app_name);
}
const Glib::ustring
GtkLumiera::get_app_title()
{
return "Lumiera";
}
const Glib::ustring
GtkLumiera::get_app_version()
{
return "0.pre.01";
}
2008-12-30 13:35:58 +01:00
const Glib::ustring GtkLumiera::get_app_copyright()
{
return _("© 2008 The Lumiera Team");
}
2008-12-30 13:35:58 +01:00
const Glib::ustring GtkLumiera::get_app_website()
{
return "http://www.lumiera.org";
}
const std::vector<Glib::ustring>
GtkLumiera::get_app_authors()
{
const gchar* app_authors[] = {
"Joel Holdsworth",
"Christian Thaeter",
"Hermann Vosseler",
"[Other Authors Here]"};
const int count = sizeof(app_authors) / sizeof(gchar*);
std::vector<Glib::ustring> list(count);
for(int i = 0; i < count; i++)
list[i] = app_authors[i];
return list;
}
} // namespace gui