**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2008 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
#define ACTION_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
-#define ACTION_INIT(class) \
- Action::Base* class::create() { return new class(); } \
- synfig::String class::get_name()const { return name__; } \
- synfig::String class::get_local_name()const { return local_name__; } \
+//! don't define get_local_name() - allow the action code to define its own
+#define ACTION_INIT_NO_GET_LOCAL_NAME(class) \
+ Action::Base* class::create() { return new class(); } \
+ synfig::String class::get_name()const { return name__; }
+
+#define ACTION_INIT(class) \
+ ACTION_INIT_NO_GET_LOCAL_NAME(class) \
+ synfig::String class::get_local_name()const { return dgettext("synfigstudio",local_name__); }
/* === T Y P E D E F S ===================================================== */
CATEGORY_VALUENODE =(1<<5),
CATEGORY_KEYFRAME =(1<<6),
CATEGORY_GROUP =(1<<7),
+ CATEGORY_BEZIER =(1<<8),
CATEGORY_OTHER =(1<<12),
-//! Action Base Class
+//! Top-level base class for all actions
/*! An action should implement the following functions:
-** static bool is_candidate(const ParamList &x);
+** - static bool is_candidate(const ParamList &x);
** - Checks the ParamList to see if this action could be performed.
-** static ParamVocab get_param_vocab();
+** - static ParamVocab get_param_vocab();
** - Yields the ParamVocab object which describes what
** this action needs before it can perform the act.
-** static Action::Base* create();
+** - static Action::Base* create();
** - Factory for creating this action from a ParamList
**
*/
//! This function will throw an Action::Error() on failure
virtual void perform()=0;
- virtual bool set_param(const synfig::String& name, const Param &) { return false; }
+ virtual bool set_param(const synfig::String& /*name*/, const Param &) { return false; }
virtual bool is_ready()const=0;
virtual synfig::String get_name()const =0;
void set_param_list(const ParamList &);
+ static synfig::String get_layer_descriptions(const std::list<synfig::Layer::Handle> layers, synfig::String singular_prefix = "", synfig::String plural_prefix = "");
+ static synfig::String get_layer_descriptions(const std::list<std::pair<synfig::Layer::Handle,int> > layers, synfig::String singular_prefix = "", synfig::String plural_prefix = "");
}; // END of class Action::Base
typedef Action::Base* (*Factory)();
virtual void prepare() { };
- virtual bool set_param(const synfig::String& name, const Param &)const { return false; }
+ virtual bool set_param(const synfig::String& /*name*/, const Param &)const { return false; }
virtual bool is_ready()const { return ready_; }
void set_name(std::string&x) { name_=x; }