X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fcellrenderer_value.cpp;h=a9f931bc3ad1208f493ea8d14bfe4745b9694dc4;hb=7507f7d178853f71ec615e6ec4936bf2653ce183;hp=9803c56cfba89f4d09da30f593ba6c01ce574f8a;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp index 9803c56..a9f931b 100644 --- a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp +++ b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file cellrenderer_value.cpp ** \brief Template File ** ** $Id: cellrenderer_value.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ ** ** \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 */ /* ========================================================================= */ @@ -55,7 +56,7 @@ #endif -using namespace sinfg; +using namespace synfig; using namespace etl; using namespace std; using namespace studio; @@ -142,7 +143,7 @@ public: } else { - sinfg::error("on_editing_done(): Called twice!"); + synfig::error("on_editing_done(): Called twice!"); } } void set_parent(Gtk::Widget*x) { parent=x; } @@ -181,29 +182,29 @@ public: { path=p; } - void set_value(const sinfg::ValueBase &data) + void set_value(const synfig::ValueBase &data) { if(valuewidget) valuewidget->set_value(data); //valuewidget->grab_focus(); } - void set_canvas(const etl::handle &data) + void set_canvas(const etl::handle &data) { assert(data); if(valuewidget) valuewidget->set_canvas(data); } - void set_param_desc(const sinfg::ParamDesc &data) + void set_param_desc(const synfig::ParamDesc &data) { if(valuewidget) valuewidget->set_param_desc(data); } - const sinfg::ValueBase &get_value() + const synfig::ValueBase &get_value() { if(valuewidget) return valuewidget->get_value(); - return sinfg::ValueBase(); + return synfig::ValueBase(); } const Glib::ustring &get_path() { @@ -214,7 +215,7 @@ public: /* === P R O C E D U R E S ================================================= */ -bool get_paragraph(sinfg::String& text) +bool get_paragraph(synfig::String& text) { Gtk::Dialog dialog( _("Paragraph"), // Title @@ -262,9 +263,9 @@ bool get_paragraph(sinfg::String& text) CellRenderer_ValueBase::CellRenderer_ValueBase(): Glib::ObjectBase (typeid(CellRenderer_ValueBase)), Gtk::CellRendererText (), - property_value_ (*this,"value",sinfg::ValueBase()), - property_canvas_(*this,"canvas",etl::handle()), - property_param_desc_(*this,"param_desc",sinfg::ParamDesc()) + property_value_ (*this,"value",synfig::ValueBase()), + property_canvas_(*this,"canvas",etl::handle()), + property_param_desc_(*this,"param_desc",synfig::ParamDesc()) { CellRendererText::signal_edited().connect(sigc::mem_fun(*this,&CellRenderer_ValueBase::string_edited_)); value_entry=new ValueBase_Entry(); @@ -285,7 +286,7 @@ CellRenderer_ValueBase::CellRenderer_ValueBase(): CellRenderer_ValueBase::~CellRenderer_ValueBase() { -// sinfg::info("CellRenderer_ValueBase::~CellRenderer_ValueBase(): deleted"); +// synfig::info("CellRenderer_ValueBase::~CellRenderer_ValueBase(): deleted"); } void @@ -341,7 +342,7 @@ CellRenderer_ValueBase::render_vfunc( switch(data.get_type()) { case ValueBase::TYPE_REAL: - if(((sinfg::ParamDesc)property_param_desc_).get_is_distance()) + if(((synfig::ParamDesc)property_param_desc_).get_is_distance()) { Distance x(data.get(Real()),Distance::SYSTEM_UNITS); x.convert(App::distance_system,get_canvas()->rend_desc()); @@ -357,15 +358,15 @@ CellRenderer_ValueBase::render_vfunc( property_text()=(Glib::ustring)strprintf("%.2f DEG",(Real)Angle::deg(data.get(Angle())).get()); break; case ValueBase::TYPE_INTEGER: - if(((sinfg::ParamDesc)property_param_desc_).get_hint()!="enum") + if(((synfig::ParamDesc)property_param_desc_).get_hint()!="enum") { property_text()=(Glib::ustring)strprintf("%i",data.get(int())); } else { property_text()=(Glib::ustring)strprintf("(%i)",data.get(int())); - std::list enum_list=((sinfg::ParamDesc)property_param_desc_).get_enum_list(); - std::list::iterator iter; + std::list enum_list=((synfig::ParamDesc)property_param_desc_).get_enum_list(); + std::list::iterator iter; for(iter=enum_list.begin();iter!=enum_list.end();iter++) if(iter->value==data.get(int())) @@ -390,19 +391,19 @@ CellRenderer_ValueBase::render_vfunc( if(data.get_type()==ValueBase::TYPE_STRING) { - if(!data.get(sinfg::String()).empty()) - property_text()=static_cast(data.get(sinfg::String())); + if(!data.get(synfig::String()).empty()) + property_text()=static_cast(data.get(synfig::String())); else property_text()=Glib::ustring(""); } break; case ValueBase::TYPE_CANVAS: - if(data.get(etl::handle())) + if(data.get(etl::handle())) { - if(data.get(etl::handle())->is_inline()) + if(data.get(etl::handle())->is_inline()) property_text()=""; else - property_text()=(Glib::ustring)data.get(etl::handle())->get_id(); + property_text()=(Glib::ustring)data.get(etl::handle())->get_id(); } else property_text()=""; @@ -475,7 +476,7 @@ CellRenderer_ValueBase::activate_vfunc( GdkEvent* event, */ void -CellRenderer_ValueBase::gradient_edited(sinfg::Gradient gradient, Glib::ustring path) +CellRenderer_ValueBase::gradient_edited(synfig::Gradient gradient, Glib::ustring path) { ValueBase old_value(property_value_.get_value()); ValueBase value(gradient); @@ -484,7 +485,7 @@ CellRenderer_ValueBase::gradient_edited(sinfg::Gradient gradient, Glib::ustring } void -CellRenderer_ValueBase::color_edited(sinfg::Color color, Glib::ustring path) +CellRenderer_ValueBase::color_edited(synfig::Color color, Glib::ustring path) { ValueBase old_value(property_value_.get_value()); ValueBase value(color); @@ -544,7 +545,7 @@ CellRenderer_ValueBase::start_editing_vfunc( case ValueBase::TYPE_STRING: if(get_param_desc().get_hint()=="paragraph") { - sinfg::String string; + synfig::String string; string=data.get(string); if(get_paragraph(string)) {