diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-04-02 15:18:23 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-04-15 11:05:06 +0300 |
commit | 6bddad2c4e8ea6e0ad710bcf39b7cc361a23a274 (patch) | |
tree | 1f7ae390f3a266341ae1222806171795de727fdc /source/blender | |
parent | 640173069750b2349d2770a848256d3702696f12 (diff) |
Code Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy-paste buffer free callbacks
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/drivers.c | 8 | ||||
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_edit.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 15 |
10 files changed, 23 insertions, 28 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index f75f2ce322c..4ddf37aa3a1 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -61,9 +61,6 @@ #include "anim_intern.h" -/* called by WM */ -void free_anim_drivers_copybuf(void); - /* ************************************************** */ /* Animation Data Validation */ @@ -514,8 +511,7 @@ bool ANIM_remove_driver(ReportList *UNUSED(reports), ID *id, const char rna_path static FCurve *channeldriver_copypaste_buf = NULL; /* This function frees any MEM_calloc'ed copy/paste buffer data */ -// XXX find some header to put this in! -void free_anim_drivers_copybuf(void) +void ANIM_drivers_copybuf_free(void) { /* free the buffer F-Curve if it exists, as if it were just another F-Curve */ if (channeldriver_copypaste_buf) @@ -553,7 +549,7 @@ bool ANIM_copy_driver(ReportList *reports, ID *id, const char rna_path[], int ar fcu = verify_driver_fcurve(id, rna_path, array_index, 0); /* clear copy/paste buffer first (for consistency with other copy/paste buffers) */ - free_anim_drivers_copybuf(); + ANIM_drivers_copybuf_free(); /* copy this to the copy/paste buf if it exists */ if (fcu && fcu->driver) { diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 91705d63286..6bb73416fec 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -697,14 +697,14 @@ static ListBase fmodifier_copypaste_buf = {NULL, NULL}; /* ---------- */ /* free the copy/paste buffer */ -void free_fmodifiers_copybuf(void) +void ANIM_fmodifiers_copybuf_free(void) { /* just free the whole buffer */ free_fmodifiers(&fmodifier_copypaste_buf); } /* copy the given F-Modifiers to the buffer, returning whether anything was copied or not - * assuming that the buffer has been cleared already with free_fmodifiers_copybuf() + * assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free() * - active: only copy the active modifier */ bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active) diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 9733d920b78..1703210f0b6 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -527,8 +527,7 @@ typedef struct tAnimCopybufItem { /* This function frees any MEM_calloc'ed copy/paste buffer data */ -// XXX find some header to put this in! -void free_anim_copybuf(void) +void ANIM_fcurves_copybuf_free(void) { tAnimCopybufItem *aci, *acn; @@ -563,7 +562,7 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) Scene *scene = ac->scene; /* clear buffer first */ - free_anim_copybuf(); + ANIM_fcurves_copybuf_free(); /* assume that each of these is an F-Curve */ for (ale = anim_data->first; ale; ale = ale->next) { diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 3c8442218be..fb4897c6532 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -544,10 +544,10 @@ void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, List /* free the copy/paste buffer */ -void free_fmodifiers_copybuf(void); +void ANIM_fmodifiers_copybuf_free(void); /* copy the given F-Modifiers to the buffer, returning whether anything was copied or not - * assuming that the buffer has been cleared already with free_fmodifiers_copybuf() + * assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free() * - active: only copy the active modifier */ bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active); diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index bbfa8ec7b1d..fae3e3677a0 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -272,7 +272,7 @@ void sample_fcurve(struct FCurve *fcu); /* ----------- */ -void free_anim_copybuf(void); +void ANIM_fcurves_copybuf_free(void); short copy_animedit_keys(struct bAnimContext *ac, ListBase *anim_data); short paste_animedit_keys(struct bAnimContext *ac, ListBase *anim_data, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 0ad1dc4d8c1..9a411975880 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -288,6 +288,11 @@ bool ANIM_remove_driver(struct ReportList *reports, struct ID *id, const char rn /* -------- */ +/* Clear copy-paste buffer for drivers */ +void ANIM_drivers_copybuf_free(void); + +/* -------- */ + /* Returns whether there is a driver in the copy/paste buffer to paste */ bool ANIM_driver_can_paste(void); diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index c66028b17fc..9cc138b2cc4 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -496,7 +496,7 @@ static short copy_action_keys(bAnimContext *ac) int filter, ok = 0; /* clear buffer first */ - free_anim_copybuf(); + ANIM_fcurves_copybuf_free(); /* filter data */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 10baed8508d..4ebb9ceddb3 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -789,7 +789,7 @@ static short copy_graph_keys(bAnimContext *ac) int filter, ok = 0; /* clear buffer first */ - free_anim_copybuf(); + ANIM_fcurves_copybuf_free(); /* filter data */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS); @@ -2487,7 +2487,7 @@ static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* clear buffer first */ - free_fmodifiers_copybuf(); + ANIM_fmodifiers_copybuf_free(); /* get the active F-Curve */ ale = get_active_fcurve_channel(&ac); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index ff71cc47158..fd772aa13b3 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -2346,7 +2346,7 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* clear buffer first */ - free_fmodifiers_copybuf(); + ANIM_fmodifiers_copybuf_free(); /* get a list of the editable tracks being shown in the NLA */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 4dc60a9b729..3d981b66f9c 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -97,9 +97,11 @@ #include "wm_files.h" #include "wm_window.h" +#include "ED_anim_api.h" #include "ED_armature.h" #include "ED_gpencil.h" #include "ED_keyframing.h" +#include "ED_keyframes_edit.h" #include "ED_node.h" #include "ED_render.h" #include "ED_space_api.h" @@ -399,13 +401,6 @@ static void free_openrecent(void) } -/* bad stuff*/ - -// XXX copy/paste buffer stuff... -extern void free_anim_copybuf(void); -extern void free_anim_drivers_copybuf(void); -extern void free_fmodifiers_copybuf(void); - #ifdef WIN32 /* Read console events until there is a key event. Also returns on any error. */ static void wait_for_console_key(void) @@ -513,9 +508,9 @@ void WM_exit_ext(bContext *C, const bool do_python) free_blender(); /* blender.c, does entire library and spacetypes */ // free_matcopybuf(); - free_anim_copybuf(); - free_anim_drivers_copybuf(); - free_fmodifiers_copybuf(); + ANIM_fcurves_copybuf_free(); + ANIM_drivers_copybuf_free(); + ANIM_fmodifiers_copybuf_free(); ED_gpencil_anim_copybuf_free(); ED_gpencil_strokes_copybuf_free(); ED_clipboard_posebuf_free(); |