X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fstable%2Fsrc%2Fgtkmm%2Fdockbook.cpp;h=21ed82f00b9fc32d7e68168bc24c91a242addf93;hb=a42ee14a3397a3fbb31d14e6eece4236620ae2db;hp=f9660ec792f53b885e147bef9f90ca9e2a5abe86;hpb=7c6d5426922cb3cda793f688dcd4d534b02765c8;p=synfig.git diff --git a/synfig-studio/tags/stable/src/gtkmm/dockbook.cpp b/synfig-studio/tags/stable/src/gtkmm/dockbook.cpp index f9660ec..21ed82f 100644 --- a/synfig-studio/tags/stable/src/gtkmm/dockbook.cpp +++ b/synfig-studio/tags/stable/src/gtkmm/dockbook.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file dockbook.cpp ** \brief Template File ** -** $Id: dockbook.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 */ /* ========================================================================= */ @@ -43,7 +44,7 @@ using namespace std; using namespace etl; -using namespace sinfg; +using namespace synfig; using namespace studio; /* === M A C R O S ========================================================= */ @@ -78,9 +79,7 @@ void DockBook::clear() { while(get_n_pages()) - { remove(static_cast(*get_nth_page(get_n_pages()-1))); - } } void @@ -95,7 +94,7 @@ DockBook::on_drag_data_received(const Glib::RefPtr& context, i context->drag_finish(true, false, time); return; } - + context->drag_finish(false, false, time); } @@ -103,7 +102,7 @@ void DockBook::add(Dockable& dockable, int position) { dockable.detach(); - + if(position==-1) append_page(dockable, " "); else @@ -120,13 +119,13 @@ DockBook::add(Dockable& dockable, int position) &dockable ) ); - + dockable.parent_=this; dockable.show(); //set_current_page(get_n_pages()-1); - + signal_changed_(); } @@ -134,7 +133,7 @@ void DockBook::refresh_tab(Dockable* dockable) { Gtk::Widget* label(dockable->create_tab_label()); - + label->signal_button_press_event().connect( sigc::bind( sigc::mem_fun( @@ -160,7 +159,7 @@ DockBook::remove(Dockable& dockable) if(!deleting_) { signal_changed_(); - + if(get_n_pages()==0) signal_empty()(); } @@ -172,49 +171,49 @@ DockBook::present() show(); } -sinfg::String +synfig::String DockBook::get_local_contents()const { - sinfg::String ret; - + synfig::String ret; + for(int i(0);i!=const_cast(this)->get_n_pages();i++) { Dockable& dockable(static_cast(*const_cast(this)->get_nth_page(i))); - + if(i) ret+=", "; ret+=dockable.get_local_name(); } - + return ret; } -sinfg::String +synfig::String DockBook::get_contents()const { - sinfg::String ret; - + synfig::String ret; + for(int i(0);i!=const_cast(this)->get_n_pages();i++) { Dockable& dockable(static_cast(*const_cast(this)->get_nth_page(i))); - + if(i) ret+=' '; ret+=dockable.get_name(); } - + return ret; } void -DockBook::set_contents(const sinfg::String& x) +DockBook::set_contents(const synfig::String& x) { - sinfg::String str(x); + synfig::String str(x); while(!str.empty()) { - unsigned int separator=str.find_first_of(' '); - sinfg::String dock; - if(separator==sinfg::String::npos) + synfig::String::size_type separator=str.find_first_of(' '); + synfig::String dock; + if(separator==synfig::String::npos) { dock=str; str.clear(); @@ -224,7 +223,7 @@ DockBook::set_contents(const sinfg::String& x) dock=String(str.begin(),str.begin()+separator); str=String(str.begin()+separator+1,str.end()); } - + try { add(App::dock_manager->find_dockable(dock)); @@ -237,9 +236,9 @@ DockBook::tab_button_pressed(GdkEventButton* event, Dockable* dockable) { if(event->button!=3) return false; - + Gtk::Menu *tabmenu=manage(new class Gtk::Menu()); - + tabmenu->items().push_back( Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-close"), sigc::mem_fun(*dockable,&Dockable::detach) @@ -247,6 +246,6 @@ DockBook::tab_button_pressed(GdkEventButton* event, Dockable* dockable) ); tabmenu->popup(event->button,gtk_get_current_event_time()); - + return true; }