X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Faction.h;h=0bd843b846efc9da71e7e8df386518ff02e0c190;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=8ead67f16b4aefbd28cd055acd5bc430b4813b90;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/action.h b/synfig-studio/trunk/src/synfigapp/action.h index 8ead67f..0bd843b 100644 --- a/synfig-studio/trunk/src/synfigapp/action.h +++ b/synfig-studio/trunk/src/synfigapp/action.h @@ -6,6 +6,7 @@ ** ** \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 @@ -74,10 +75,14 @@ #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 ===================================================== */ @@ -199,7 +204,7 @@ public: //! 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; @@ -207,6 +212,8 @@ public: void set_param_list(const ParamList &); + static synfig::String get_layer_descriptions(const std::list layers, synfig::String singular_prefix = "", synfig::String plural_prefix = ""); + static synfig::String get_layer_descriptions(const std::list > layers, synfig::String singular_prefix = "", synfig::String plural_prefix = ""); }; // END of class Action::Base typedef Action::Base* (*Factory)(); @@ -322,7 +329,7 @@ public: 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; }