X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2F0.61.08%2Fsrc%2Fgtkmm%2Fstatemanager.cpp;fp=synfig-studio%2Ftags%2F0.61.08%2Fsrc%2Fgtkmm%2Fstatemanager.cpp;h=0000000000000000000000000000000000000000;hb=3a6643238c67c043fc3592837a05d6d2861967f1;hp=4a6828cdf066247dd06c3322d66fee7783b5dbc6;hpb=47fce282611fbba1044921d22ca887f9b53ad91a;p=synfig.git diff --git a/synfig-studio/tags/0.61.08/src/gtkmm/statemanager.cpp b/synfig-studio/tags/0.61.08/src/gtkmm/statemanager.cpp deleted file mode 100644 index 4a6828c..0000000 --- a/synfig-studio/tags/0.61.08/src/gtkmm/statemanager.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file statemanager.cpp -** \brief Template File -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore -** -** This package 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; either version 2 of -** the License, or (at your option) any later version. -** -** This package 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. -** \endlegal -*/ -/* ========================================================================= */ - -/* === H E A D E R S ======================================================= */ - -#ifdef USING_PCH -# include "pch.h" -#else -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "statemanager.h" -#include -#include -#include -#include "app.h" -#include "toolbox.h" - -#include "general.h" - -#endif - -/* === U S I N G =========================================================== */ - -using namespace std; -using namespace etl; -using namespace synfig; -using namespace studio; - -/* === M A C R O S ========================================================= */ - -/* === G L O B A L S ======================================================= */ - -/* === P R O C E D U R E S ================================================= */ - -/* === M E T H O D S ======================================================= */ - -StateManager::StateManager(): - state_group(Gtk::ActionGroup::create()), - merge_id(App::ui_manager()->new_merge_id()) -{ - App::ui_manager()->insert_action_group(get_action_group()); -} - -StateManager::~StateManager() -{ - App::ui_manager()->remove_ui(merge_id); - - for(;!merge_id_list.empty();merge_id_list.pop_back()) - App::ui_manager()->remove_ui(merge_id_list.back()); -} - -void -StateManager::change_state_(const Smach::state_base *state) -{ - App::toolbox->change_state_(state); -} - -void -StateManager::add_state(const Smach::state_base *state) -{ - String name(state->get_name()); - - Gtk::StockItem stock_item; - Gtk::Stock::lookup(Gtk::StockID("synfig-"+name),stock_item); - - Glib::RefPtr action( - Gtk::Action::create( - "state-"+name, - stock_item.get_stock_id(), - stock_item.get_label(), - stock_item.get_label() - ) - ); - /*action->set_sensitive(false);*/ - state_group->add(action); - - action->signal_activate().connect( - sigc::bind( - sigc::mem_fun(*this,&studio::StateManager::change_state_), - state - ) - ); - - App::ui_manager()->ensure_update(); - - /*App::ui_manager()->add_ui( - merge_id, - "/main-menu/menu-state", - "state-"+name, - "state-"+name - ); - */ - - String uid_def(""); - merge_id_list.push_back(App::ui_manager()->add_ui_from_string(uid_def)); - - App::ui_manager()->ensure_update(); - - App::toolbox->add_state(state); -} - -Glib::RefPtr -StateManager::get_action_group() -{ - return state_group; -}