From: Nikita Kitaev Date: Sun, 11 Apr 2010 23:09:13 +0000 (-0700) Subject: Cleanup dead code X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=da3b4764c5bc5fab412c59b33c0a26c0189984f1;p=synfig.git Cleanup dead code --- diff --git a/synfig-studio/src/gtkmm/app.cpp b/synfig-studio/src/gtkmm/app.cpp index 95452d3..01a4f8f 100644 --- a/synfig-studio/src/gtkmm/app.cpp +++ b/synfig-studio/src/gtkmm/app.cpp @@ -755,9 +755,9 @@ init_ui_manager() )); } -#define DEFINE_ACTION(x,stock) { Glib::RefPtr action( Gtk::Action::create(x, stock) ); /*action->set_sensitive(false);*/ actions_action_group->add(action); } -#define DEFINE_ACTION2(x,stock,label) { Glib::RefPtr action( Gtk::Action::create(x, stock,label,label) ); /*action->set_sensitive(false);*/ actions_action_group->add(action); } -#define DEFINE_ACTION_SIG(group,x,stock,sig) { Glib::RefPtr action( Gtk::Action::create(x, stock) ); /*action->set_sensitive(false);*/ group->add(action,sig); } +#define DEFINE_ACTION(x,stock) { Glib::RefPtr action( Gtk::Action::create(x, stock) ); actions_action_group->add(action); } +#define DEFINE_ACTION2(x,stock,label) { Glib::RefPtr action( Gtk::Action::create(x, stock,label,label) ); actions_action_group->add(action); } +#define DEFINE_ACTION_SIG(group,x,stock,sig) { Glib::RefPtr action( Gtk::Action::create(x, stock) ); group->add(action,sig); } DEFINE_ACTION2("keyframe-properties", Gtk::StockID("gtk-properties"), _("Keyframe Properties")); DEFINE_ACTION("about", Gtk::StockID("synfig-about")); @@ -847,39 +847,6 @@ init_ui_manager() #undef DEFINE_ACTION_2 #undef DEFINE_ACTION_SIG -// Set up synfigapp actions - /*{ - synfigapp::Action::Book::iterator iter; - - for(iter=synfigapp::Action::book().begin();iter!=synfigapp::Action::book().end();++iter) - { - Gtk::StockID stock_id; - - if(!(iter->second.category&synfigapp::Action::CATEGORY_HIDDEN)) - { - //Gtk::Image* image(manage(new Gtk::Image())); - if(iter->second.task=="raise") stock_id=Gtk::Stock::GO_UP; - else if(iter->second.task=="lower") stock_id=Gtk::Stock::GO_DOWN; - else if(iter->second.task=="move_top") stock_id=Gtk::Stock::GOTO_TOP; - else if(iter->second.task=="move_bottom") stock_id=Gtk::Stock::GOTO_BOTTOM; - else if(iter->second.task=="remove") stock_id=Gtk::Stock::DELETE; - else if(iter->second.task=="set_on") stock_id=Gtk::Stock::YES; - else if(iter->second.task=="set_off") stock_id=Gtk::Stock::NO; - //else if(iter->second.task=="duplicate") stock_id=Gtk::Stock::COPY; - else if(iter->second.task=="remove") stock_id=Gtk::Stock::DELETE; - else stock_id=Gtk::StockID("synfig-"+iter->second.task); - - actions_action_group->add(Gtk::Action::create( - "action-"+iter->second.name, - stock_id, - iter->second.local_name,iter->second.local_name - )); - } - } - } -*/ - - Glib::ustring ui_info = "" " " diff --git a/synfig-studio/src/gtkmm/dialog_setup.cpp b/synfig-studio/src/gtkmm/dialog_setup.cpp index 400854c..6272cb3 100644 --- a/synfig-studio/src/gtkmm/dialog_setup.cpp +++ b/synfig-studio/src/gtkmm/dialog_setup.cpp @@ -113,7 +113,6 @@ Dialog_Setup::Dialog_Setup(): // Gamma Gtk::Table *gamma_table=manage(new Gtk::Table(2,2,false)); notebook->append_page(*gamma_table,_("Gamma")); - //gamma_frame->add(*gamma_table); gamma_table->attach(gamma_pattern, 0, 2, 0, 1, Gtk::EXPAND, Gtk::SHRINK|Gtk::FILL, 0, 0); diff --git a/synfig-studio/src/gtkmm/dialog_tooloptions.cpp b/synfig-studio/src/gtkmm/dialog_tooloptions.cpp index b31fe6c..da759c8 100644 --- a/synfig-studio/src/gtkmm/dialog_tooloptions.cpp +++ b/synfig-studio/src/gtkmm/dialog_tooloptions.cpp @@ -57,11 +57,6 @@ Dialog_ToolOptions::Dialog_ToolOptions(): Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-about")), empty_label(_("This tool has no options")) { - //scrolled_.add(sub_vbox_); - //scrolled_.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC); - //scrolled_.show(); - //get_vbox()->pack_start(scrolled_); - add(sub_vbox_); set_widget(empty_label); diff --git a/synfig-studio/src/gtkmm/dialog_tooloptions.h b/synfig-studio/src/gtkmm/dialog_tooloptions.h index e8ae362..69680e0 100644 --- a/synfig-studio/src/gtkmm/dialog_tooloptions.h +++ b/synfig-studio/src/gtkmm/dialog_tooloptions.h @@ -43,7 +43,6 @@ namespace studio { class Dialog_ToolOptions : public Dockable { Gtk::Label empty_label; - Gtk::ScrolledWindow scrolled_; Gtk::VBox sub_vbox_; public: diff --git a/synfig-studio/src/gtkmm/dock_canvases.cpp b/synfig-studio/src/gtkmm/dock_canvases.cpp index 1e39a0a..f230820 100644 --- a/synfig-studio/src/gtkmm/dock_canvases.cpp +++ b/synfig-studio/src/gtkmm/dock_canvases.cpp @@ -62,7 +62,7 @@ Dock_Canvases::Dock_Canvases(): add(*create_canvas_tree()); -/* +/* // \todo Implement canvas management in canvas browser add_button( Gtk::StockID("synfig-canvas_new"), _("Insert a new canvas") @@ -92,7 +92,7 @@ Dock_Canvases::Dock_Canvases(): &Dock_Canvases::menu_rename ) ); - */ +*/ } Dock_Canvases::~Dock_Canvases() diff --git a/synfig-studio/src/gtkmm/dock_children.cpp b/synfig-studio/src/gtkmm/dock_children.cpp index d997a0c..0b65306 100644 --- a/synfig-studio/src/gtkmm/dock_children.cpp +++ b/synfig-studio/src/gtkmm/dock_children.cpp @@ -71,19 +71,6 @@ Dock_Children::Dock_Children(): //! Dockable::prev_widget_ is left referencing a //! ChildrenTree that has already been destroyed. // set_use_scrolled(false); -/* - add(*create_action_tree()); - - add_button( - Gtk::StockID("synfig-clear_redo"), - _("Clear the REDO Stack") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_Children::clear_redo - ) - ); -*/ } Dock_Children::~Dock_Children() diff --git a/synfig-studio/src/gtkmm/dock_curves.cpp b/synfig-studio/src/gtkmm/dock_curves.cpp index 9268fc2..142b842 100644 --- a/synfig-studio/src/gtkmm/dock_curves.cpp +++ b/synfig-studio/src/gtkmm/dock_curves.cpp @@ -99,14 +99,9 @@ _curve_selection_changed(Gtk::TreeView* param_tree_view,Widget_Curves* curves) std::list value_descs; - //std::list path_list( - //param_tree_view->get_selection()->selected_foreach_iter(tmp); iter=param_tree_view->get_selection()->get_selected(); - value_descs.push_back((*iter)[model.value_desc]); curves->set_value_descs(value_descs); - - //curves->set_value_descs(tmp.value_descs); } void diff --git a/synfig-studio/src/gtkmm/dock_history.cpp b/synfig-studio/src/gtkmm/dock_history.cpp index 6479c7d..cddf07b 100644 --- a/synfig-studio/src/gtkmm/dock_history.cpp +++ b/synfig-studio/src/gtkmm/dock_history.cpp @@ -143,27 +143,6 @@ Dock_History::Dock_History(): set_toolbar(*dynamic_cast(App::ui_manager()->get_widget("/toolbar-history"))); add(*create_action_tree()); - - /* - add_button( - Gtk::StockID("synfig-clear_undo"), - _("Clear the UNDO Stack") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_History::clear_undo - ) - ); - add_button( - Gtk::StockID("synfig-clear_redo"), - _("Clear the REDO Stack") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_History::clear_redo - ) - ); - */ } Dock_History::~Dock_History() diff --git a/synfig-studio/src/gtkmm/dock_info.h b/synfig-studio/src/gtkmm/dock_info.h index a324f86..4ecd337 100644 --- a/synfig-studio/src/gtkmm/dock_info.h +++ b/synfig-studio/src/gtkmm/dock_info.h @@ -41,9 +41,6 @@ namespace studio { class Dock_Info : public Dock_CanvasSpecific { - //bool valid; - //synfig::Point pos; - Gtk::Label r,g,b,a; Gtk::Label x,y; diff --git a/synfig-studio/src/gtkmm/dock_keyframes.cpp b/synfig-studio/src/gtkmm/dock_keyframes.cpp index d4dab66..44e9893 100644 --- a/synfig-studio/src/gtkmm/dock_keyframes.cpp +++ b/synfig-studio/src/gtkmm/dock_keyframes.cpp @@ -71,36 +71,7 @@ Dock_Keyframes::Dock_Keyframes(): keyframe_action_manager->signal_show_keyframe_properties().connect( sigc::mem_fun(*this,&Dock_Keyframes::show_keyframe_properties) ); -/* add_button( - Gtk::StockID("gtk-add"), - _("Inserts a Keyframe at the current time") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_Keyframes::add_keyframe_pressed - ) - ); - - add_button( - Gtk::StockID("synfig-duplicate"), - _("Duplicates the selected keyframe at the current time") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_Keyframes::duplicate_keyframe_pressed - ) - ); - add_button( - Gtk::StockID("gtk-delete"), - _("Deletes the selected Keyframe") - )->signal_clicked().connect( - sigc::mem_fun( - *this, - &Dock_Keyframes::delete_keyframe_pressed - ) - ); -*/ Glib::ustring ui_info = "" " " @@ -128,29 +99,6 @@ Dock_Keyframes::show_keyframe_properties() get_canvas_view()->show_keyframe_dialog(); } -/* -void -Dock_Keyframes::add_keyframe_pressed() -{ - if(get_canvas_view()) - get_canvas_view()->on_keyframe_add_pressed(); -} - -void -Dock_Keyframes::duplicate_keyframe_pressed() -{ - if(get_canvas_view()) - get_canvas_view()->on_keyframe_duplicate_pressed(); -} - -void -Dock_Keyframes::delete_keyframe_pressed() -{ - if(get_canvas_view()) - get_canvas_view()->on_keyframe_remove_pressed(); -} -*/ - void Dock_Keyframes::init_canvas_view_vfunc(etl::loose_handle canvas_view) { diff --git a/synfig-studio/src/gtkmm/dock_layers.cpp b/synfig-studio/src/gtkmm/dock_layers.cpp index 72cf0be..2c75e83 100644 --- a/synfig-studio/src/gtkmm/dock_layers.cpp +++ b/synfig-studio/src/gtkmm/dock_layers.cpp @@ -72,7 +72,6 @@ using namespace studio; Dock_Layers::Dock_Layers(): Dock_CanvasSpecific("layers",_("Layers"),Gtk::StockID("synfig-layer")), -// layer_action_manager(0) layer_action_manager(new LayerActionManager) { if(layer_action_manager)layer_action_manager->set_ui_manager(App::ui_manager()); diff --git a/synfig-studio/src/gtkmm/dock_navigator.cpp b/synfig-studio/src/gtkmm/dock_navigator.cpp index 62a18c3..ad5061e 100644 --- a/synfig-studio/src/gtkmm/dock_navigator.cpp +++ b/synfig-studio/src/gtkmm/dock_navigator.cpp @@ -159,7 +159,6 @@ void studio::Widget_NavView::on_start_render() //get the pw and ph //float pw = r.get_pw(); //float ph = r.get_ph(); - //synfig::warning("Nav: pixel size is %f x %f", pw,ph); //this renders that single frame diff --git a/synfig-studio/src/gtkmm/dock_params.cpp b/synfig-studio/src/gtkmm/dock_params.cpp index 8e7c41f..7b3d360 100644 --- a/synfig-studio/src/gtkmm/dock_params.cpp +++ b/synfig-studio/src/gtkmm/dock_params.cpp @@ -65,20 +65,6 @@ Dock_Params::Dock_Params(): Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("synfig-params")*/), action_group(Gtk::ActionGroup::create("action_group_dock_params")) { -/* - App::ui_manager()->insert_action_group(action_group_layer_ops); - - Glib::ustring ui_info = - "" - " " - " " - " " - " " - "" - ; - - App::ui_manager()->add_ui_from_string(ui_info); - */ } Dock_Params::~Dock_Params() diff --git a/synfig-studio/src/gtkmm/dock_timetrack.cpp b/synfig-studio/src/gtkmm/dock_timetrack.cpp index 7a6139a..29105e4 100644 --- a/synfig-studio/src/gtkmm/dock_timetrack.cpp +++ b/synfig-studio/src/gtkmm/dock_timetrack.cpp @@ -171,39 +171,6 @@ public: return true; //return signal_param_user_click()(event->button.button,row,COLUMNID_TIME_TRACK); } -/* else - { - if(event->button.button==3) - { - LayerList layer_list(get_selected_layers()); - if(layer_list.size()<=1) - { - synfigapp::ValueDesc value_desc(row[model.value_desc]); - Gtk::Menu* menu(manage(new Gtk::Menu())); - menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu)); - App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f); - menu->popup(event->button.button,gtk_get_current_event_time()); - return true; - } - Gtk::Menu* menu(manage(new Gtk::Menu())); - menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu)); - std::list value_desc_list; - ParamDesc param_desc(row[model.param_desc]); - for(;!layer_list.empty();layer_list.pop_back()) - value_desc_list.push_back(synfigapp::ValueDesc(layer_list.back(),param_desc.get_name())); - App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc_list); - menu->popup(event->button.button,gtk_get_current_event_time()); - return true; - } - else - { - if(column->get_first_cell_renderer()==cellrenderer_value) - return signal_param_user_click()(event->button.button,row,COLUMNID_VALUE); - else - return signal_param_user_click()(event->button.button,row,COLUMNID_NAME); - } - } - */ } break; @@ -309,7 +276,7 @@ public: void on_waypoint_changed( synfig::Waypoint waypoint , synfig::ValueNode::Handle value_node) { - // is this code used? + // \todo is this code used? assert(0); synfigapp::Action::ParamList param_list; diff --git a/synfig-studio/src/gtkmm/dockable.cpp b/synfig-studio/src/gtkmm/dockable.cpp index 4745311..f0a3dce 100644 --- a/synfig-studio/src/gtkmm/dockable.cpp +++ b/synfig-studio/src/gtkmm/dockable.cpp @@ -87,18 +87,8 @@ Dockable::Dockable(const synfig::String& name,const synfig::String& local_name,G use_scrolled_=true; - //set_title(local_name); - //set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY); - - - title_label_.show(); - attach_dnd_to(title_label_); - //scrolled_.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC); - //scrolled_.show(); - //scrolled_.set_shadow_type(Gtk::SHADOW_NONE); - toolbar_=0; //button_box_.show(); @@ -106,6 +96,7 @@ Dockable::Dockable(const synfig::String& name,const synfig::String& local_name,G { title_label_.set_padding(0,0); + //title_label_.show(); Gtk::EventBox* event_box(manage(new Gtk::EventBox())); event_box->set_border_width(0); event_box->add(title_label_); @@ -139,7 +130,6 @@ Dockable::Dockable(const synfig::String& name,const synfig::String& local_name,G prev_widget_->show(); set_size_request(175,120); - //scrolled_.set_shadow_type(Gtk::SHADOW_NONE); } @@ -150,20 +140,6 @@ Dockable::~Dockable() delete scrolled_; scrolled_=0; } - - /*if(App::dock_manager)try{ - App::dock_manager->unregister_dockable(*this); - std::list::iterator iter; - for(iter=App::dock_manager->dockable_list_.begin();iter!=App::dock_manager->dockable_list_.end();++iter) - if(*iter==this) - { - App::dock_manager->dockable_list_.erase(iter); - return; - } - } catch(...) { } -*/ - //if(App::dock_manager) - // App::dock_manager->dockable_list_.erase(this); } void @@ -271,7 +247,6 @@ Dockable::add(Gtk::Widget& x) if(prev_widget_) { remove(*prev_widget_); - //prev_widget_=0; clear_previous(); } @@ -362,8 +337,10 @@ Dockable::present() { DockDialog* dock_dialog(new DockDialog()); dock_dialog->get_dock_book().add(*this); - //if(get_name()=="canvases") - // dock_dialog->set_composition_selector(true); +/* //hack: always display composition selector on top of canvas browser + if(get_name()=="canvases") + dock_dialog->set_composition_selector(true); +*/ dock_dialog->present(); } } diff --git a/synfig-studio/src/gtkmm/dockable.h b/synfig-studio/src/gtkmm/dockable.h index 7b0083a..e1a2ad1 100644 --- a/synfig-studio/src/gtkmm/dockable.h +++ b/synfig-studio/src/gtkmm/dockable.h @@ -76,7 +76,6 @@ private: Gtk::Label title_label_; //Gtk::HBox button_box_; Gtk::HBox header_box_; - //Gtk::VBox vbox_; //Gtk::HandleBox handle_box_; Gtk::ScrolledWindow *scrolled_; @@ -91,7 +90,6 @@ private: bool dnd_success_; public: - //Gtk::VBox* get_vbox() { return &vbox_; } void set_toolbar(Gtk::Toolbar& toolbar); diff --git a/synfig-studio/src/gtkmm/dockbook.cpp b/synfig-studio/src/gtkmm/dockbook.cpp index 62047f7..707352e 100644 --- a/synfig-studio/src/gtkmm/dockbook.cpp +++ b/synfig-studio/src/gtkmm/dockbook.cpp @@ -127,8 +127,6 @@ DockBook::add(Dockable& dockable, int position) dockable.show(); - //set_current_page(get_n_pages()-1); - signal_changed_(); } diff --git a/synfig-studio/src/gtkmm/iconcontroller.cpp b/synfig-studio/src/gtkmm/iconcontroller.cpp index ea2a3a6..de86bbb 100644 --- a/synfig-studio/src/gtkmm/iconcontroller.cpp +++ b/synfig-studio/src/gtkmm/iconcontroller.cpp @@ -111,14 +111,6 @@ IconController::IconController(const synfig::String& /*basepath*/) synfig::warning("Unable to open "+path_to_icons+"synfig_icon."+IMAGE_EXT); } -/* -#define INIT_STOCK_ICON(name,iconfile,desc) \ - stock_##name=Gtk::StockItem(Gtk::StockID("synfig-" #name),desc); \ - Gtk::Stock::add(stock_##name); \ - icon_source.set_filename(path_to_icons+iconfile); \ - icon_##name.add_source(icon_source); \ - icon_factory->add(stock_##name.get_stock_id(),icon_##name) -*/ #define INIT_STOCK_ICON(name,iconfile,desc){ \ Gtk::StockItem stockitem(Gtk::StockID("synfig-" #name),desc); \ Gtk::Stock::add(stockitem); \ @@ -241,6 +233,9 @@ IconController::IconController(const synfig::String& /*basepath*/) INIT_STOCK_ICON(gradient,"gradient_icon."IMAGE_EXT,_("Gradient Tool")); INIT_STOCK_ICON(star,"star_icon."IMAGE_EXT,_("Star Tool")); +#undef INIT_STOCK_ICON +#undef INIT_STOCK_ICON + icon_factory->add_default(); Gtk::IconSize::register_new("synfig-small_icon",12,12); @@ -268,6 +263,11 @@ IconController::get_normal_cursor() Gdk::Cursor IconController::get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr& window) { + //this function is never called + //it is commented out in WorkArea::refresh_cursor() + assert(0); + // \todo Do we still need it? + Glib::RefPtr pixmap; pixmap=Gdk::Pixmap::create(window, 64, 64, 8); pixmap->set_colormap(window->get_colormap()); diff --git a/synfig-studio/src/gtkmm/workarea.cpp b/synfig-studio/src/gtkmm/workarea.cpp index a5f851f..d2a1f3b 100644 --- a/synfig-studio/src/gtkmm/workarea.cpp +++ b/synfig-studio/src/gtkmm/workarea.cpp @@ -2721,8 +2721,7 @@ studio::WorkArea::set_cursor(Gdk::CursorType x) drawing_area->get_window()->set_cursor(Gdk::Cursor(x)); } -#include "iconcontroller.h" - +//#include "iconcontroller.h" void studio::WorkArea::refresh_cursor() {