2.5 - Action Editor / Animation Stuff:
[blender-staging.git] / source / blender / editors / space_action / action_header.c
index 04958aede0f3b6d96605e8009b0185b759c39952..d04ffd0935d84cfc1b28a5a972c4a83a87c48003 100644 (file)
 /* ********************************************************* */
 /* Menu Defines... */
 
-// XXX button events
+/* button events */
 enum {
        B_REDR  = 0,
        B_ACTCOPYKEYS,
        B_ACTPASTEKEYS,
 } eActHeader_ButEvents;
 
-// ---------------- menus 
+/* ------------------------------- */
+/* enums declaring constants that are used as menu event codes  */
+
+enum {
+       ACTMENU_VIEW_CENTERVIEW= 0,
+       ACTMENU_VIEW_AUTOUPDATE,
+       ACTMENU_VIEW_PLAY3D,
+       ACTMENU_VIEW_PLAYALL,
+       ACTMENU_VIEW_ALL,
+       ACTMENU_VIEW_MAXIMIZE,
+       ACTMENU_VIEW_LOCK,
+       ACTMENU_VIEW_SLIDERS,
+       ACTMENU_VIEW_NEXTMARKER,
+       ACTMENU_VIEW_PREVMARKER,
+       ACTMENU_VIEW_NEXTKEYFRAME,
+       ACTMENU_VIEW_PREVKEYFRAME,
+       ACTMENU_VIEW_TIME,
+       ACTMENU_VIEW_NOHIDE,
+       ACTMENU_VIEW_FRANUM,
+       ACTMENU_VIEW_TRANSDELDUPS,
+       ACTMENU_VIEW_HORIZOPTIMISE,
+       ACTMENU_VIEW_GCOLORS,
+       ACTMENU_VIEW_PREVRANGESET,
+       ACTMENU_VIEW_PREVRANGECLEAR,
+       ACTMENU_VIEW_PREVRANGEAUTO
+};
+
+enum {
+       ACTMENU_SEL_BORDER = 0,
+       ACTMENU_SEL_BORDERC,
+       ACTMENU_SEL_BORDERM,
+       ACTMENU_SEL_ALL_KEYS,
+       ACTMENU_SEL_ALL_CHAN,
+       ACTMENU_SEL_ALL_MARKERS,
+       ACTMENU_SEL_INVERSE_KEYS,
+       ACTMENU_SEL_INVERSE_MARKERS,
+       ACTMENU_SEL_INVERSE_CHANNELS,
+       ACTMENU_SEL_LEFTKEYS,
+       ACTMENU_SEL_RIGHTKEYS
+};
+
+enum {
+       ACTMENU_SEL_COLUMN_KEYS = 1,
+       ACTMENU_SEL_COLUMN_CFRA,
+       ACTMENU_SEL_COLUMN_MARKERSCOLUMN,
+       ACTMENU_SEL_COLUMN_MARKERSBETWEEN 
+};
+
+enum {
+       ACTMENU_CHANNELS_OPENLEVELS = 0,
+       ACTMENU_CHANNELS_CLOSELEVELS,
+       ACTMENU_CHANNELS_EXPANDALL,
+       ACTMENU_CHANNELS_SHOWACHANS,
+       ACTMENU_CHANNELS_DELETE
+};
+
+enum {
+       ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP        = 0,
+       ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN,
+       ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP,
+       ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM
+};
+
+enum {
+       ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE     = 0,
+       ACTMENU_CHANNELS_GROUP_ADD_TONEW,
+       ACTMENU_CHANNELS_GROUP_REMOVE,
+       ACTMENU_CHANNELS_GROUP_SYNCPOSE
+};
+
+enum {
+       ACTMENU_CHANNELS_SETTINGS_TOGGLE = 0,
+       ACTMENU_CHANNELS_SETTINGS_ENABLE,
+       ACTMENU_CHANNELS_SETTINGS_DISABLE,
+};
+
+enum {
+       ACTMENU_KEY_DUPLICATE = 0,
+       ACTMENU_KEY_DELETE,
+       ACTMENU_KEY_CLEAN,
+       ACTMENU_KEY_SAMPLEKEYS,
+       ACTMENU_KEY_INSERTKEY
+};
+
+enum {
+       ACTMENU_KEY_TRANSFORM_MOVE  = 0,
+       ACTMENU_KEY_TRANSFORM_SCALE,
+       ACTMENU_KEY_TRANSFORM_SLIDE,
+       ACTMENU_KEY_TRANSFORM_EXTEND
+};
+
+enum {
+       ACTMENU_KEY_HANDLE_AUTO = 0,
+       ACTMENU_KEY_HANDLE_ALIGN,
+       ACTMENU_KEY_HANDLE_FREE,
+       ACTMENU_KEY_HANDLE_VECTOR
+};
+
+enum {
+       ACTMENU_KEY_INTERP_CONST = 0,
+       ACTMENU_KEY_INTERP_LINEAR,
+       ACTMENU_KEY_INTERP_BEZIER
+};
+
+enum {
+       ACTMENU_KEY_EXTEND_CONST = 0,
+       ACTMENU_KEY_EXTEND_EXTRAPOLATION,
+       ACTMENU_KEY_EXTEND_CYCLIC,
+       ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION
+};
+
+enum {
+       ACTMENU_KEY_SNAP_NEARFRAME = 1,
+       ACTMENU_KEY_SNAP_CURFRAME,
+       ACTMENU_KEY_SNAP_NEARMARK,
+       ACTMENU_KEY_SNAP_NEARTIME,
+       ACTMENU_KEY_SNAP_CFRA2KEY,
+};
+
+enum {
+       ACTMENU_KEY_MIRROR_CURFRAME = 1,
+       ACTMENU_KEY_MIRROR_YAXIS,
+       ACTMENU_KEY_MIRROR_XAXIS,
+       ACTMENU_KEY_MIRROR_MARKER
+};
+
+enum {
+       ACTMENU_MARKERS_ADD = 0,
+       ACTMENU_MARKERS_DUPLICATE,
+       ACTMENU_MARKERS_DELETE,
+       ACTMENU_MARKERS_NAME,
+       ACTMENU_MARKERS_MOVE,
+       ACTMENU_MARKERS_LOCALADD,
+       ACTMENU_MARKERS_LOCALRENAME,
+       ACTMENU_MARKERS_LOCALDELETE,
+       ACTMENU_MARKERS_LOCALMOVE
+};
+
+/* ------------------------------- */
+/* macros for easier state testing (only for use here) */
+
+/* test if active action editor is showing any markers */
+#if 0
+       #define G_SACTION_HASMARKERS \
+               ((G.saction->action && G.saction->action->markers.first) \
+                || (G.scene->markers.first))
+#endif
+
+/* ------------------------------- */
+
+/* *************************************************************** */
+/* menus */
 
 /* Key menu ---------------------------  */
 
@@ -288,7 +439,7 @@ static uiBlock *action_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *ar
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
        
-       if(curarea->headertype==HEADERTOP) {
+       if (curarea->headertype==HEADERTOP) {
                uiBlockSetDirection(block, UI_DOWN);
        }
        else {