1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_EDITMODE_H
26 #define __SYNFIG_EDITMODE_H
28 /* === H E A D E R S ======================================================= */
30 /* === M A C R O S ========================================================= */
32 /* === T Y P E D E F S ===================================================== */
34 /* === C L A S S E S & S T R U C T S ======================================= */
43 MODE_NORMAL =0, //!< Normal editing mode. Place holder.
45 MODE_ANIMATE =(1<<0), //!< Animated editing mode.
46 MODE_ANIMATE_FUTURE =(1<<1), //!< Respect <i>future</i> keyframes
47 MODE_ANIMATE_PAST =(1<<2), //!< Respect <i>past</i> keyframes
48 MODE_ANIMATE_ALL =(3<<1), //!< Respect <i>all</i> keyframes
50 MODE_UNDEFINED =(~0) //!< Undefined Mode
51 }; // END of enum EditMode
55 operator|(const EditMode& lhs, const EditMode& rhs)
56 { return static_cast<EditMode>(int(lhs)|int(rhs)); }
60 operator-(const EditMode& lhs, const EditMode& rhs)
61 { return static_cast<EditMode>(int(lhs)&~int(rhs)); }
64 operator|=(EditMode& lhs, const EditMode& rhs)
65 { *reinterpret_cast<int*>(&lhs)|=int(rhs); return lhs; }
67 //! Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
68 /*! This function will return true of all of the flags
69 ** in the \a rhs are set in the \a lhs */
71 operator&(const EditMode& lhs, const EditMode& rhs)
72 { return static_cast<EditMode>(int(lhs)&int(rhs)); }
74 //! Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
75 /*! This function will return true of all of the flags
76 ** in the \a rhs are set in the \a lhs */
78 operator<=(const EditMode& lhs, const EditMode& rhs)
79 { return lhs&rhs==int(rhs); }
81 }; // END if namespace synfigapp
82 /* === E N D =============================================================== */