Use macros for the get static and set static members
[synfig.git] / synfig-core / src / synfig / layer.h
index 51bf681..8a6a2e6 100644 (file)
 //! It prevents these layers showing up in the menu.
 #define CATEGORY_DO_NOT_USE "Do Not Use"
 
+//! x=variable name, y=static bool value
+#define SET_STATIC(x,y)                                                                                                                                        \
+       if(param==#x && x ## _static != y)                                                                                                      \
+       {                                                                                                                                                                       \
+               x ## _static = y;                                                                                                                               \
+               return true;                                                                                                                                    \
+       }
+
+#define GET_STATIC(x)                                                                                                                                  \
+       if(param==#x)                                                                                                                                           \
+               return x ## _static;                                                                                                                    \
+
+
 /* === T Y P E D E F S ===================================================== */
 
 /* === C L A S S E S & S T R U C T S ======================================= */