1 /* === S I N F G =========================================================== */
2 /*! \file action_layerremove.cpp
3 ** \brief Template File
5 ** $Id: groupremove.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 "groupremove.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::GroupRemove);
45 ACTION_SET_NAME(Action::GroupRemove,"group_remove");
46 ACTION_SET_LOCAL_NAME(Action::GroupRemove,"Remove Group");
47 ACTION_SET_TASK(Action::GroupRemove,"remove");
48 ACTION_SET_CATEGORY(Action::GroupRemove,Action::CATEGORY_GROUP);
49 ACTION_SET_PRIORITY(Action::GroupRemove,0);
50 ACTION_SET_VERSION(Action::GroupRemove,"0.0");
51 ACTION_SET_CVS_ID(Action::GroupRemove,"$Id: groupremove.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::GroupRemove::GroupRemove()
64 Action::GroupRemove::get_param_vocab()
66 ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
68 ret.push_back(ParamDesc("group",Param::TYPE_STRING)
69 .set_local_name(_("Group"))
70 .set_desc(_("Name of the Group to remove"))
77 Action::GroupRemove::is_canidate(const ParamList &x)
79 bool ret(canidate_check(get_param_vocab(),x));
82 sinfg::info("Action::GroupRemove::is_canidate(): failed canidate check");
83 ParamList::const_iterator iter;
84 for(iter=x.begin();iter!=x.end();++iter)
86 sinfg::info("PARAM: %s",iter->first.c_str());
93 Action::GroupRemove::set_param(const sinfg::String& name, const Action::Param ¶m)
95 if(name=="group" && param.get_type()==Param::TYPE_STRING)
97 group=param.get_string();
102 return Action::CanvasSpecific::set_param(name,param);
106 Action::GroupRemove::is_ready()const
110 return Action::CanvasSpecific::is_ready();
114 Action::GroupRemove::perform()
116 layer_list=get_canvas()->get_layers_in_group(group);
118 std::set<sinfg::Layer::Handle>::iterator iter;
119 for(iter=layer_list.begin();iter!=layer_list.end();++iter)
121 (*iter)->remove_from_group(group);
126 Action::GroupRemove::undo()
128 std::set<sinfg::Layer::Handle>::iterator iter;
129 for(iter=layer_list.begin();iter!=layer_list.end();++iter)
131 (*iter)->add_to_group(group);