code cleanup: use const events for modal and invoke operators.
[blender.git] / source / blender / editors / space_action / action_select.c
index 1602d3b65918e1e7ba0fe5b3e8d84ef5ca88d9bf..c814c0b4d8cb1571b1ee2e402e5a5fa3cfa42517 100644 (file)
@@ -259,12 +259,35 @@ static void borderselect_action(bAnimContext *ac, rcti rect, short mode, short s
                    !((ymax < rectf.ymin) || (ymin > rectf.ymax)))
                {
                        /* loop over data selecting */
                    !((ymax < rectf.ymin) || (ymin > rectf.ymax)))
                {
                        /* loop over data selecting */
-                       if (ale->type == ANIMTYPE_GPLAYER)
-                               ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
-                       else if (ale->type == ANIMTYPE_MASKLAYER)
-                               ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
-                       else
-                               ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
+                       switch (ale->type) {
+                               case ANIMTYPE_GPDATABLOCK:
+                               {
+                                       bGPdata *gpd = ale->data;
+                                       bGPDlayer *gpl;
+                                       for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+                                               ED_gplayer_frames_select_border(gpl, rectf.xmin, rectf.xmax, selectmode);
+                                       }
+                                       break;
+                               }
+                               case ANIMTYPE_GPLAYER:
+                                       ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+                                       break;
+                               case ANIMTYPE_MASKDATABLOCK:
+                               {
+                                       Mask *mask = ale->data;
+                                       MaskLayer *masklay;
+                                       for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
+                                               ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+                                       }
+                                       break;
+                               }
+                               case ANIMTYPE_MASKLAYER:
+                                       ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+                                       break;
+                               default:
+                                       ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
+                                       break;
+                       }
                }
                
                /* set minimum extent to be the maximum of the next channel */
                }
                
                /* set minimum extent to be the maximum of the next channel */
@@ -849,7 +872,7 @@ static int actkeys_select_leftright_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
 
-static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
        bAnimContext ac;
        short leftright = RNA_enum_get(op->ptr, "mode");
 {
        bAnimContext ac;
        short leftright = RNA_enum_get(op->ptr, "mode");
@@ -944,6 +967,7 @@ static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, short s
                                else if (ale->type == ANIMTYPE_MASKLAYER)
                                        ED_mask_select_frame(ale->data, selx, select_mode);
                        }
                                else if (ale->type == ANIMTYPE_MASKLAYER)
                                        ED_mask_select_frame(ale->data, selx, select_mode);
                        }
+                       BLI_freelistN(&anim_data);
                }
                else {
                        ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
                }
                else {
                        ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
@@ -1199,7 +1223,7 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
 }
 
 /* handle clicking */
 }
 
 /* handle clicking */
-static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
        bAnimContext ac;
        /* ARegion *ar; */ /* UNUSED */
 {
        bAnimContext ac;
        /* ARegion *ar; */ /* UNUSED */
@@ -1210,7 +1234,7 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
-       /* ar= ac.ar; */ /* UNUSED */
+       /* ar = ac.ar; */ /* UNUSED */
 
        /* select mode is either replace (deselect all, then add) or add/extend */
        if (RNA_boolean_get(op->ptr, "extend"))
 
        /* select mode is either replace (deselect all, then add) or add/extend */
        if (RNA_boolean_get(op->ptr, "extend"))