diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-13 20:54:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-13 20:54:17 +0400 |
commit | f37c971878307d4f618bbbc50574293de9e09141 (patch) | |
tree | 3de7294d6152331d5b06eb4ebab63ad3aa46ee14 /source/blender/editors/gpencil | |
parent | b96172cb054ce22407f8cfeb16592ecc8e216d6e (diff) |
Code cleanup: use ED_gpencil_ prefix for grease pencil
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 12 | ||||
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 18 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_buttons.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 28 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_undo.c | 2 |
6 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 38dd9048790..eb784abb34f 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -676,7 +676,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, * ............................ */ /* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */ -void draw_gpencil_2dimage(const bContext *C) +void ED_gpencil_draw_2dimage(const bContext *C) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -685,7 +685,7 @@ void draw_gpencil_2dimage(const bContext *C) int offsx, offsy, sizex, sizey; int dflag = GP_DRAWDATA_NOSTATUS; - gpd = gpencil_data_get_active(C); // XXX + gpd = ED_gpencil_data_get_active(C); // XXX if (gpd == NULL) return; /* calculate rect */ @@ -738,7 +738,7 @@ void draw_gpencil_2dimage(const bContext *C) /* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, * second time with onlyv2d=0 for screen-aligned strokes */ -void draw_gpencil_view2d(const bContext *C, bool onlyv2d) +void ED_gpencil_draw_view2d(const bContext *C, bool onlyv2d) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -748,7 +748,7 @@ void draw_gpencil_view2d(const bContext *C, bool onlyv2d) /* check that we have grease-pencil stuff to draw */ if (sa == NULL) return; - gpd = gpencil_data_get_active(C); // XXX + gpd = ED_gpencil_data_get_active(C); // XXX if (gpd == NULL) return; /* special hack for Image Editor */ @@ -764,7 +764,7 @@ void draw_gpencil_view2d(const bContext *C, bool onlyv2d) /* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly * Note: this gets called twice - first time with only3d=1 to draw 3d-strokes, * second time with only3d=0 for screen-aligned strokes */ -void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, bool only3d) +void ED_gpencil_draw_view3d(Scene *scene, View3D *v3d, ARegion *ar, bool only3d) { bGPdata *gpd; int dflag = 0; @@ -772,7 +772,7 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, bool only3d) int offsx, offsy, winx, winy; /* check that we have grease-pencil stuff to draw */ - gpd = gpencil_data_get_active_v3d(scene); // XXX + gpd = ED_gpencil_data_get_active_v3d(scene); // XXX if (gpd == NULL) return; /* when rendering to the offscreen buffer we don't want to diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index f5bf1422488..dba80164e93 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -61,30 +61,30 @@ /* Generics - Loopers */ /* Loops over the gp-frames for a gp-layer, and applies the given callback */ -short ED_gplayer_frames_looper(bGPDlayer *gpl, Scene *scene, short (*gpf_cb)(bGPDframe *, Scene *)) +bool ED_gplayer_frames_looper(bGPDlayer *gpl, Scene *scene, short (*gpf_cb)(bGPDframe *, Scene *)) { bGPDframe *gpf; /* error checker */ if (gpl == NULL) - return 0; + return false; /* do loop */ for (gpf = gpl->frames.first; gpf; gpf = gpf->next) { /* execute callback */ if (gpf_cb(gpf, scene)) - return 1; + return true; } /* nothing to return */ - return 0; + return false; } /* ****************************************** */ /* Data Conversion Tools */ /* make a listing all the gp-frames in a layer as cfraelems */ -void ED_gplayer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, short onlysel) +void ED_gplayer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel) { bGPDframe *gpf; CfraElem *ce; @@ -110,22 +110,22 @@ void ED_gplayer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, short onlysel) /* Selection Tools */ /* check if one of the frames in this layer is selected */ -short ED_gplayer_frame_select_check(bGPDlayer *gpl) +bool ED_gplayer_frame_select_check(bGPDlayer *gpl) { bGPDframe *gpf; /* error checking */ if (gpl == NULL) - return 0; + return false; /* stop at the first one found */ for (gpf = gpl->frames.first; gpf; gpf = gpf->next) { if (gpf->flag & GP_FRAME_SELECT) - return 1; + return true; } /* not found */ - return 0; + return false; } /* helper function - select gp-frame based on SELECT_* mode */ diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 0fe4d7e7157..0acff8fc0a5 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -350,7 +350,7 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin } } -void gpencil_panel_standard_header(const bContext *C, Panel *pa) +void ED_gpencil_panel_standard_header(const bContext *C, Panel *pa) { PointerRNA ptr; RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &ptr); @@ -359,7 +359,7 @@ void gpencil_panel_standard_header(const bContext *C, Panel *pa) } /* Standard panel to be included wherever Grease Pencil is used... */ -void gpencil_panel_standard(const bContext *C, Panel *pa) +void ED_gpencil_panel_standard(const bContext *C, Panel *pa) { bGPdata **gpd_ptr = NULL; PointerRNA ptr; @@ -369,7 +369,7 @@ void gpencil_panel_standard(const bContext *C, Panel *pa) draw_gpencil_space_specials(C, pa->layout); /* get pointer to Grease Pencil Data */ - gpd_ptr = gpencil_data_get_pointers((bContext *)C, &ptr); + gpd_ptr = ED_gpencil_data_get_pointers((bContext *)C, &ptr); if (gpd_ptr) draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index d25de906e31..b725f5c773a 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -86,7 +86,7 @@ /* Context Wrangling... */ /* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it */ -bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr) +bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr) { ID *screen_id = (ID *)CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); @@ -180,19 +180,19 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr) } /* Get the active Grease Pencil datablock */ -bGPdata *gpencil_data_get_active(const bContext *C) +bGPdata *ED_gpencil_data_get_active(const bContext *C) { - bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); return (gpd_ptr) ? *(gpd_ptr) : NULL; } /* needed for offscreen rendering */ -bGPdata *gpencil_data_get_active_v3d(Scene *scene) +bGPdata *ED_gpencil_data_get_active_v3d(Scene *scene) { Base *base = scene->basact; bGPdata *gpd = NULL; /* We have to make sure active object is actually visible and selected, else we must use default scene gpd, - * to be consistent with gpencil_data_get_active's behavior. + * to be consistent with ED_gpencil_data_get_active's behavior. */ if (base && (scene->lay & base->lay) && (base->object->flag & SELECT)) { gpd = base->object->gpd; @@ -207,7 +207,7 @@ bGPdata *gpencil_data_get_active_v3d(Scene *scene) static int gp_add_poll(bContext *C) { /* the base line we have is that we have somewhere to add Grease Pencil data */ - return gpencil_data_get_pointers(C, NULL) != NULL; + return ED_gpencil_data_get_pointers(C, NULL) != NULL; } /* ******************* Add New Data ************************ */ @@ -215,7 +215,7 @@ static int gp_add_poll(bContext *C) /* add new datablock - wrapper around API */ static int gp_data_add_exec(bContext *C, wmOperator *op) { - bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); if (gpd_ptr == NULL) { BKE_report(op->reports, RPT_ERROR, "Nowhere for grease pencil data to go"); @@ -253,7 +253,7 @@ void GPENCIL_OT_data_add(wmOperatorType *ot) /* poll callback for adding data/layers - special */ static int gp_data_unlink_poll(bContext *C) { - bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); /* if we have access to some active data, make sure there's a datablock before enabling this */ return (gpd_ptr && *gpd_ptr); @@ -263,7 +263,7 @@ static int gp_data_unlink_poll(bContext *C) /* unlink datablock - wrapper around API */ static int gp_data_unlink_exec(bContext *C, wmOperator *op) { - bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); if (gpd_ptr == NULL) { BKE_report(op->reports, RPT_ERROR, "Nowhere for grease pencil data to go"); @@ -301,7 +301,7 @@ void GPENCIL_OT_data_unlink(wmOperatorType *ot) /* add new layer - wrapper around API */ static int gp_layer_add_exec(bContext *C, wmOperator *op) { - bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); /* if there's no existing Grease-Pencil data there, add some */ if (gpd_ptr == NULL) { @@ -337,7 +337,7 @@ void GPENCIL_OT_layer_add(wmOperatorType *ot) static int gp_actframe_delete_poll(bContext *C) { - bGPdata *gpd = gpencil_data_get_active(C); + bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = gpencil_layer_getactive(gpd); /* only if there's an active layer with an active frame */ @@ -348,7 +348,7 @@ static int gp_actframe_delete_poll(bContext *C) static int gp_actframe_delete_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - bGPdata *gpd = gpencil_data_get_active(C); + bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = gpencil_layer_getactive(gpd); bGPDframe *gpf = gpencil_layer_getframe(gpl, CFRA, 0); @@ -1559,7 +1559,7 @@ static void gp_convert_set_end_frame(struct Main *UNUSED(main), struct Scene *UN static int gp_convert_poll(bContext *C) { - bGPdata *gpd = gpencil_data_get_active(C); + bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = NULL; bGPDframe *gpf = NULL; ScrArea *sa = CTX_wm_area(C); @@ -1578,7 +1578,7 @@ static int gp_convert_poll(bContext *C) static int gp_convert_layer_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "use_timing_data"); - bGPdata *gpd = gpencil_data_get_active(C); + bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = gpencil_layer_getactive(gpd); Scene *scene = CTX_data_scene(C); const int mode = RNA_enum_get(op->ptr, "type"); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 2f941142d9e..4910396ac6f 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -177,7 +177,7 @@ static int gpencil_draw_poll(bContext *C) { if (ED_operator_regionactive(C)) { /* check if current context can support GPencil data */ - if (gpencil_data_get_pointers(C, NULL) != NULL) { + if (ED_gpencil_data_get_pointers(C, NULL) != NULL) { /* check if Grease Pencil isn't already running */ if (ED_gpencil_session_active() == 0) return 1; @@ -1161,7 +1161,7 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) } /* get gp-data */ - gpd_ptr = gpencil_data_get_pointers(C, &p->ownerPtr); + gpd_ptr = ED_gpencil_data_get_pointers(C, &p->ownerPtr); if (gpd_ptr == NULL) { p->status = GP_STATUS_ERROR; if (G.debug & G_DEBUG) diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c index 136e9da389d..ff92d69f39d 100644 --- a/source/blender/editors/gpencil/gpencil_undo.c +++ b/source/blender/editors/gpencil/gpencil_undo.c @@ -70,7 +70,7 @@ int ED_undo_gpencil_step(bContext *C, int step, const char *name) { bGPdata **gpd_ptr = NULL, *new_gpd = NULL; - gpd_ptr = gpencil_data_get_pointers(C, NULL); + gpd_ptr = ED_gpencil_data_get_pointers(C, NULL); if (step == 1) { /* undo */ //printf("\t\tGP - undo step\n"); |