Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / stable / src / gtkmm / dock_canvases.cpp
index e6c8d01..1e39a0a 100644 (file)
@@ -1,20 +1,21 @@
-/* === S I N F G =========================================================== */
-/*!    \file dialog_history.cpp
+/* === S Y N F I G ========================================================= */
+/*!    \file dock_canvases.cpp
 **     \brief Template File
 **
-**     $Id: dock_canvases.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
+**     $Id$
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned 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.
 **
-**     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 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
 */
 /* ========================================================================= */
 #include "dock_canvases.h"
 #include "app.h"
 #include "canvasview.h"
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -49,19 +52,19 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Canvases::Dock_Canvases():
-       Dockable("canvases",_("Canvas Browser"),Gtk::StockID("sinfg-canvas"))
+       Dockable("canvases",_("Canvas Browser"),Gtk::StockID("synfig-canvas"))
 {
 
        App::signal_instance_created().connect(sigc::mem_fun(*this,&studio::Dock_Canvases::new_instance));
        App::signal_instance_deleted().connect(sigc::mem_fun(*this,&studio::Dock_Canvases::delete_instance));
        App::signal_instance_selected().connect(sigc::mem_fun(*this,&studio::Dock_Canvases::set_selected_instance_signal));
 
-       
+
        add(*create_canvas_tree());
 
 /*
        add_button(
-               Gtk::StockID("sinfg-canvas_new"),
+               Gtk::StockID("synfig-canvas_new"),
                _("Insert a new canvas")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -81,7 +84,7 @@ Dock_Canvases::Dock_Canvases():
        );
 
        add_button(
-               Gtk::StockID("sinfg-rename"),
+               Gtk::StockID("synfig-rename"),
                _("Rename selected canvas")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -102,7 +105,7 @@ Dock_Canvases::create_canvas_tree()
        studio::Instance::CanvasTreeModel canvas_tree_model;
        canvas_tree=manage(new class Gtk::TreeView());
        {
-               Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column("ID") );
+               Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("ID")) );
 //             Gtk::CellRendererPixbuf* icon_cellrenderer = Gtk::manage( new Gtk::CellRendererPixbuf() );
 
                //column->pack_start(*icon_cellrenderer,false);
@@ -112,7 +115,7 @@ Dock_Canvases::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();
@@ -122,7 +125,7 @@ Dock_Canvases::create_canvas_tree()
        canvas_tree->add_events(Gdk::BUTTON1_MOTION_MASK);
        canvas_tree->show();
        canvas_tree->set_headers_visible(false);
-       
+
        Gtk::ScrolledWindow *scrolledwindow = manage(new class Gtk::ScrolledWindow());
        scrolledwindow->set_flags(Gtk::CAN_FOCUS);
        scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
@@ -139,7 +142,7 @@ Dock_Canvases::get_selected_canvas_view()
        return get_selected_instance()->find_canvas_view(get_selected_canvas());
 }
 
-etl::loose_handle<sinfg::Canvas>
+etl::loose_handle<synfig::Canvas>
 Dock_Canvases::get_selected_canvas()
 {
        Glib::RefPtr<Gtk::TreeSelection> selection=canvas_tree->get_selection();
@@ -149,7 +152,7 @@ Dock_Canvases::get_selected_canvas()
 
        studio::Instance::CanvasTreeModel canvas_tree_model;
 
-       return static_cast<etl::handle<sinfg::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
+       return static_cast<etl::handle<synfig::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
 }
 
 
@@ -189,7 +192,7 @@ Dock_Canvases::set_selected_instance(etl::loose_handle<studio::Instance> x)
        if (x==selected_instance)
                return;
 
-       set_selected_instance_(x);      
+       set_selected_instance_(x);
 }
 
 void
@@ -197,21 +200,21 @@ Dock_Canvases::new_instance(etl::handle<studio::Instance> instance)
 {
        if(studio::App::shutdown_in_progress)
                return;
-       
+
        assert(instance);
-       
+
        etl::loose_handle<studio::Instance> loose_instance(instance);
-       
-       instance->sinfgapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Dock_Canvases::refresh_instances));
-       instance->sinfgapp::Instance::signal_filename_changed().connect(
+
+       instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Dock_Canvases::refresh_instances));
+       instance->synfigapp::Instance::signal_filename_changed().connect(
                sigc::bind<etl::loose_handle<studio::Instance> >(
                        sigc::mem_fun(*this,&Dock_Canvases::set_selected_instance),
                        loose_instance
                )
        );
-       
+
        present();
-       
+
 }
 
 void