X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fcompview.cpp;h=416ea822b4190b07919a9b5bc9c73db23f8b8c12;hb=e94afbea92edb78826bff981ddc84b0757b2550f;hp=0d86cc037fc6749dde7f57a8f3047e735899b8bf;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/compview.cpp b/synfig-studio/trunk/src/gtkmm/compview.cpp index 0d86cc0..416ea82 100644 --- a/synfig-studio/trunk/src/gtkmm/compview.cpp +++ b/synfig-studio/trunk/src/gtkmm/compview.cpp @@ -1,18 +1,22 @@ -/*! ======================================================================== -** Synfig -** Template File -** $Id: compview.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file compview.cpp +** \brief writeme ** -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** $Id$ ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** 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 ** ** === N O T E S =========================================================== ** @@ -56,7 +60,7 @@ using namespace studio; #define COLUMNID_JUMP (787584) #define ColumnID int - + /* === G L O B A L S ======================================================= */ /* === P R O C E D U R E S ================================================= */ @@ -82,7 +86,7 @@ CompView::CompView(): notebook->append_page(*create_canvas_tree(),"Canvases"); notebook->append_page(*create_action_tree(),"History"); - + /* @@ -152,7 +156,7 @@ CompView::CompView(): App::signal_instance_created().connect(sigc::mem_fun(*this,&studio::CompView::new_instance)); App::signal_instance_deleted().connect(sigc::mem_fun(*this,&studio::CompView::delete_instance)); App::signal_instance_selected().connect(sigc::mem_fun(*this,&studio::CompView::set_selected_instance_signal)); - + table->show_all(); add(*table); @@ -190,7 +194,7 @@ CompView::create_canvas_tree() //#ifdef NDEBUG // column->add_attribute(icon_cellrenderer->property_pixbuf(), canvas_tree_model.icon); //#endif - + canvas_tree->append_column(*column); } canvas_tree->set_rules_hint(); @@ -220,23 +224,23 @@ CompView::create_action_tree() Gtk::CellRendererToggle* toggle_cr = Gtk::manage( new Gtk::CellRendererToggle() ); toggle_cr->signal_toggled().connect(sigc::mem_fun(*this, &studio::CompView::on_action_toggle) ); - + column->pack_start(*toggle_cr); //false = don't expand. column->add_attribute(toggle_cr->property_active(),history_tree_model.is_active); column->set_resizable(); column->set_clickable(); - + action_tree->append_column(*column); } /*{ Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column("Canvas") ); Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText()); text_cr->property_foreground()=Glib::ustring("#7f7f7f"); - + column->pack_start(*text_cr); column->add_attribute(text_cr->property_text(),history_tree_model.canvas_id); column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo); - + action_tree->append_column(*column); }*/ { @@ -244,13 +248,13 @@ CompView::create_action_tree() Gtk::CellRendererText* cell_renderer_jump=Gtk::manage(new Gtk::CellRendererText()); column->pack_start(*cell_renderer_jump,true); - + cell_renderer_jump->property_text()="(JMP)"; cell_renderer_jump->property_foreground()="#003a7f"; - + column->set_resizable(); column->set_clickable(); - + column->set_sort_column_id(COLUMNID_JUMP); action_tree->append_column(*column); @@ -262,17 +266,17 @@ CompView::create_action_tree() Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText()); text_cr->property_foreground()=Glib::ustring("#7f7f7f"); - + //column->pack_start(history_tree_model.icon, false); //false = don't expand. column->pack_start(*text_cr); column->add_attribute(text_cr->property_text(),history_tree_model.name); column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo); - + action_tree->append_column(*column); } - + action_tree->set_rules_hint(); // action_tree->signal_row_activated().connect(sigc::mem_fun(*this,&CompView::on_row_activate)); action_tree->signal_event().connect(sigc::mem_fun(*this,&CompView::on_action_event)); @@ -292,14 +296,14 @@ CompView::create_action_tree() Gtk::Button* clear_redo_button(manage(new Gtk::Button(_("Clear Redo")))); clear_redo_button->signal_pressed().connect(sigc::mem_fun(*this,&studio::CompView::clear_redo)); - + Gtk::Table* table(manage(new Gtk::Table())); table->attach(*scrolledwindow, 0, 2, 0,1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); table->attach(*clear_button, 0, 1, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0); table->attach(*clear_redo_button, 1, 2, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0); - + table->show_all(); - + return table; } @@ -323,7 +327,7 @@ void CompView::clear_history() { if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to undo any changes that you have made!\nAre you sure you want to clear the undo stack?"))) - { + { selected_instance->clear_undo_stack(); } } @@ -332,7 +336,7 @@ void CompView::clear_redo() { if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to redo any changes that you have made!\nAre you sure you want to clear the redo stack?"))) - { + { selected_instance->clear_redo_stack(); } } @@ -436,7 +440,7 @@ CompView::set_selected_instance(etl::loose_handle x) else instance_selector->set_history(0); - set_selected_instance_(x); + set_selected_instance_(x); } void @@ -444,11 +448,11 @@ CompView::new_instance(etl::handle instance) { if(studio::App::shutdown_in_progress) return; - + assert(instance); - + etl::loose_handle loose_instance(instance); - + instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&CompView::refresh_instances)); instance->synfigapp::Instance::signal_filename_changed().connect( sigc::bind >( @@ -456,7 +460,7 @@ CompView::new_instance(etl::handle instance) loose_instance ) ); - + { std::string name=basename(instance->get_file_name()); @@ -532,7 +536,7 @@ CompView::on_action_event(GdkEvent *event) ) ) break; const Gtk::TreeRow row = *(action_tree->get_model()->get_iter(path)); - + //signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id()); if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP) { @@ -549,7 +553,7 @@ CompView::on_action_event(GdkEvent *event) } } } - + case GDK_BUTTON_RELEASE: break; default: @@ -574,7 +578,7 @@ CompView::on_tree_event(GdkEvent *event) synfigapp::Action::ParamList param_list; param_list.add("canvas",synfig::Canvas::Handle(get_selected_canvas())); param_list.add("canvas_interface",get_selected_instance()->find_canvas_interface(get_selected_canvas())); - get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,synfigapp::Action::CATEGORY_CANVAS); + get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,synfigapp::Action::CATEGORY_CANVAS); menu.popup(0,0); menu.show(); break; @@ -599,10 +603,10 @@ CompView::on_action_toggle(const Glib::ustring& path_string) studio::HistoryTreeStore::Model history_tree_model; Gtk::TreePath path(path_string); - + const Gtk::TreeRow row = *(selected_instance->history_tree_store()->get_iter(path)); handle action=row[history_tree_model.action]; - + selected_instance->synfigapp::Instance::set_action_status(action,!action->is_active()); }