X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftags%2Fsynfig_0_61_07%2Fsrc%2Fmodules%2Fexample%2Fsimplecircle.cpp;fp=synfig-core%2Ftags%2Fsynfig_0_61_07%2Fsrc%2Fmodules%2Fexample%2Fsimplecircle.cpp;h=0000000000000000000000000000000000000000;hb=6fa8f2f38d4b0b35f8539bf94e27ae27015c7689;hp=10a27a01ec9c8a0fa1faab76a1163e6986e0796f;hpb=47fce282611fbba1044921d22ca887f9b53ad91a;p=synfig.git diff --git a/synfig-core/tags/synfig_0_61_07/src/modules/example/simplecircle.cpp b/synfig-core/tags/synfig_0_61_07/src/modules/example/simplecircle.cpp deleted file mode 100644 index 10a27a0..0000000 --- a/synfig-core/tags/synfig_0_61_07/src/modules/example/simplecircle.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file simplecircle.cpp -** \brief Template Header -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** -** 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 -*/ -/* ========================================================================= */ - -/* === H E A D E R S ======================================================= */ - -#ifdef USING_PCH -# include "pch.h" -#else -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "simplecircle.h" - -#endif - -/* === U S I N G =========================================================== */ - -using namespace etl; -using namespace std; -using namespace synfig; - -/* === G L O B A L S ======================================================= */ - -SYNFIG_LAYER_INIT(SimpleCircle); -SYNFIG_LAYER_SET_NAME(SimpleCircle,"simple_circle"); -SYNFIG_LAYER_SET_LOCAL_NAME(SimpleCircle,_("Simple Circle")); -SYNFIG_LAYER_SET_CATEGORY(SimpleCircle,_("Do Not Use")); -SYNFIG_LAYER_SET_VERSION(SimpleCircle,"0.1"); -SYNFIG_LAYER_SET_CVS_ID(SimpleCircle,"$Id$"); - -/* === P R O C E D U R E S ================================================= */ - -/* === M E T H O D S ======================================================= */ - -/* === E N T R Y P O I N T ================================================= */ - -SimpleCircle::SimpleCircle(): - Layer_Composite(1.0,Color::BLEND_STRAIGHT), - color(Color::black()), - center(0,0), - radius(0.5) -{ -} - -bool -SimpleCircle::set_param(const String & param, const ValueBase &value) -{ - IMPORT(color); - IMPORT(center); - IMPORT(radius); - - return Layer_Composite::set_param(param,value); -} - -ValueBase -SimpleCircle::get_param(const String ¶m)const -{ - EXPORT(color); - EXPORT(center); - EXPORT(radius); - - EXPORT_NAME(); - EXPORT_VERSION(); - - return Layer_Composite::get_param(param); -} - -Layer::Vocab -SimpleCircle::get_param_vocab()const -{ - Layer::Vocab ret(Layer_Composite::get_param_vocab()); - - ret.push_back(ParamDesc("color") - .set_local_name(_("Color")) - ); - - ret.push_back(ParamDesc("center") - .set_local_name(_("Center")) - ); - - ret.push_back(ParamDesc("radius") - .set_local_name(_("Radius")) - .set_description(_("This is the radius of the circle")) - .set_origin("center") - ); - - return ret; -} - -Color -SimpleCircle::get_color(Context context, const Point &pos)const -{ - - if((pos-center).mag()(this); - else - return context.hit_check(pos); -} - -/* -bool -SimpleCircle::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const -{ - if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT) - { - // Mark our progress as starting - if(cb && !cb->amount_complete(0,1000)) - return false; - - surface->set_wh(renddesc.get_w(),renddesc.get_h()); - surface->fill(color); - - // Mark our progress as finished - if(cb && !cb->amount_complete(1000,1000)) - return false; - - return true; - } - - SuperCallback supercb(cb,0,9500,10000); - - if(!context.accelerated_render(surface,quality,renddesc,&supercb)) - return false; - - int x,y; - - Surface::alpha_pen apen(surface->begin()); - - apen.set_value(color); - apen.set_alpha(get_amount()); - apen.set_blend_method(get_blend_method()); - - for(y=0;yamount_complete(10000,10000)) - return false; - - return true; -} -*/