1 /* === S I N F G =========================================================== */
2 /*! \file canvasrenddescset.cpp
3 ** \brief Template File
5 ** $Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "canvasrenddescset.h"
32 #include <sinfgapp/canvasinterface.h>
38 using namespace sinfg;
39 using namespace sinfgapp;
40 using namespace Action;
42 /* === M A C R O S ========================================================= */
44 ACTION_INIT(Action::CanvasRendDescSet);
45 ACTION_SET_NAME(Action::CanvasRendDescSet,"canvas_rend_desc_set");
46 ACTION_SET_LOCAL_NAME(Action::CanvasRendDescSet,"Set Canvas RendDesc");
47 ACTION_SET_TASK(Action::CanvasRendDescSet,"set");
48 ACTION_SET_CATEGORY(Action::CanvasRendDescSet,Action::CATEGORY_CANVAS);
49 ACTION_SET_PRIORITY(Action::CanvasRendDescSet,0);
50 ACTION_SET_VERSION(Action::CanvasRendDescSet,"0.0");
51 ACTION_SET_CVS_ID(Action::CanvasRendDescSet,"$Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
53 /* === G L O B A L S ======================================================= */
55 /* === P R O C E D U R E S ================================================= */
57 /* === M E T H O D S ======================================================= */
59 Action::CanvasRendDescSet::CanvasRendDescSet()
65 Action::CanvasRendDescSet::get_param_vocab()
67 ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
69 ret.push_back(ParamDesc("rend_desc",Param::TYPE_RENDDESC)
70 .set_local_name(_("RendDesc"))
77 Action::CanvasRendDescSet::is_canidate(const ParamList &x)
79 return canidate_check(get_param_vocab(),x);
83 Action::CanvasRendDescSet::set_param(const sinfg::String& name, const Action::Param ¶m)
85 if(name=="rend_desc" && param.get_type()==Param::TYPE_RENDDESC)
87 new_rend_desc=param.get_rend_desc();
92 return Action::CanvasSpecific::set_param(name,param);
96 Action::CanvasRendDescSet::is_ready()const
98 return Action::CanvasSpecific::is_ready();
102 Action::CanvasRendDescSet::perform()
104 old_rend_desc=get_canvas()->rend_desc();
106 get_canvas()->rend_desc()=new_rend_desc;
108 if(get_canvas_interface())
110 get_canvas_interface()->signal_rend_desc_changed()();
112 else sinfg::warning("CanvasInterface not set on action");
116 Action::CanvasRendDescSet::undo()
118 get_canvas()->rend_desc()=old_rend_desc;
120 if(get_canvas_interface())
122 get_canvas_interface()->signal_rend_desc_changed()();
124 else sinfg::warning("CanvasInterface not set on action");