Made a new ACTION_INIT_NO_GET_LOCAL_NAME macro for actions which want to define their...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 10 Jan 2008 23:22:11 +0000 (23:22 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 10 Jan 2008 23:22:11 +0000 (23:22 +0000)
git-svn-id: http://svn.voria.com/code@1318 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/action.h
synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp
synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp

index e01b48e..4458062 100644 (file)
 
 #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 dgettext("synfigstudio",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 ===================================================== */
 
index a051e01..835fd69 100644 (file)
@@ -43,11 +43,8 @@ using namespace synfigapp;
 using namespace Action;
 
 /* === M A C R O S ========================================================= */
-#define ACTION_INIT2(class) \
-       Action::Base* class::create() { return new class(); }   \
-       synfig::String class::get_name()const { return name__; }
 
-ACTION_INIT2(Action::LayerActivate);
+ACTION_INIT_NO_GET_LOCAL_NAME(Action::LayerActivate);
 ACTION_SET_NAME(Action::LayerActivate,"layer_activate");
 ACTION_SET_LOCAL_NAME(Action::LayerActivate,N_("Activate Layer"));
 ACTION_SET_TASK(Action::LayerActivate,"activate");
index 0c5a1b4..8796b6f 100644 (file)
@@ -53,11 +53,8 @@ using namespace synfigapp;
 using namespace Action;
 
 /* === M A C R O S ========================================================= */
-#define ACTION_INIT2(class) \
-       Action::Base* class::create() { return new class(); }   \
-       synfig::String class::get_name()const { return name__; }
 
-ACTION_INIT2(Action::ValueDescSet);
+ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescSet);
 ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set");
 ACTION_SET_LOCAL_NAME(Action::ValueDescSet,N_("Set ValueDesc"));
 ACTION_SET_TASK(Action::ValueDescSet,"set");