From b88e51dd55c62bdc160f33f9b2ae1727a892560a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Jul 2018 11:47:00 +0200 Subject: Cleanup: use bool for poll functions --- source/blender/editors/include/ED_armature.h | 6 +- source/blender/editors/include/ED_clip.h | 10 +-- source/blender/editors/include/ED_image.h | 4 +- source/blender/editors/include/ED_keyframing.h | 2 +- source/blender/editors/include/ED_physics.h | 6 +- source/blender/editors/include/ED_screen.h | 108 ++++++++++++------------- source/blender/editors/include/ED_sequencer.h | 4 +- source/blender/editors/include/ED_transverts.h | 2 +- source/blender/editors/include/ED_view3d.h | 2 +- source/blender/editors/include/UI_interface.h | 2 +- 10 files changed, 73 insertions(+), 73 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 1bc0c8fab64..d6e385ab5a6 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -208,9 +208,9 @@ struct Object *ED_pose_object_from_context(struct bContext *C); /* sketch */ -int ED_operator_sketch_mode_active_stroke(struct bContext *C); -int ED_operator_sketch_full_mode(struct bContext *C); -int ED_operator_sketch_mode(const struct bContext *C); +bool ED_operator_sketch_mode_active_stroke(struct bContext *C); +bool ED_operator_sketch_full_mode(struct bContext *C); +bool ED_operator_sketch_mode(const struct bContext *C); void BIF_convertSketch(struct bContext *C); void BIF_deleteSketch(struct bContext *C); diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 91f8b39f7b9..4844d96e6e8 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -44,13 +44,13 @@ struct Scene; /* ** clip_editor.c ** */ /* common poll functions */ -int ED_space_clip_poll(struct bContext *C); +bool ED_space_clip_poll(struct bContext *C); -int ED_space_clip_view_clip_poll(struct bContext *C); +bool ED_space_clip_view_clip_poll(struct bContext *C); -int ED_space_clip_tracking_poll(struct bContext *C); -int ED_space_clip_maskedit_poll(struct bContext *C); -int ED_space_clip_maskedit_mask_poll(struct bContext *C); +bool ED_space_clip_tracking_poll(struct bContext *C); +bool ED_space_clip_maskedit_poll(struct bContext *C); +bool ED_space_clip_maskedit_mask_poll(struct bContext *C); void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height); void ED_space_clip_get_size_fl(struct SpaceClip *sc, float size[2]); diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 0e56b4c6e40..e5631c4e191 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -76,8 +76,8 @@ bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit); bool ED_space_image_paint_curve(const struct bContext *C); bool ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *sima); -int ED_space_image_maskedit_poll(struct bContext *C); -int ED_space_image_maskedit_mask_poll(struct bContext *C); +bool ED_space_image_maskedit_poll(struct bContext *C); +bool ED_space_image_maskedit_mask_poll(struct bContext *C); void ED_image_draw_info(struct Scene *scene, struct ARegion *ar, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index b73c997060a..06b8197de97 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -131,7 +131,7 @@ struct KeyingSetInfo; struct ExtensionRNA; /* Polling Callback for KeyingSets */ -typedef int (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C); +typedef bool (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C); /* Context Iterator Callback for KeyingSets */ typedef void (*cbKeyingSet_Iterator)(struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks); /* Property Specifier Callback for KeyingSets (called from iterators) */ diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h index 70b54a64d6b..32444beb0fe 100644 --- a/source/blender/editors/include/ED_physics.h +++ b/source/blender/editors/include/ED_physics.h @@ -40,9 +40,9 @@ struct Scene; struct Object; /* particle_edit.c */ -int PE_poll(struct bContext *C); -int PE_hair_poll(struct bContext *C); -int PE_poll_view3d(struct bContext *C); +bool PE_poll(struct bContext *C); +bool PE_hair_poll(struct bContext *C); +bool PE_poll_view3d(struct bContext *C); /* rigidbody_object.c */ bool ED_rigidbody_object_add(struct Main *bmain, struct Scene *scene, struct Object *ob, int type, struct ReportList *reports); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index f031c1775c6..b4d9a2629cf 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -135,60 +135,60 @@ void ED_operatortypes_screen(void); void ED_keymap_screen(struct wmKeyConfig *keyconf); /* operators; context poll callbacks */ -int ED_operator_screenactive(struct bContext *C); -int ED_operator_screen_mainwinactive(struct bContext *C); -int ED_operator_areaactive(struct bContext *C); -int ED_operator_regionactive(struct bContext *C); - -int ED_operator_scene(struct bContext *C); -int ED_operator_scene_editable(struct bContext *C); -int ED_operator_objectmode(struct bContext *C); - -int ED_operator_view3d_active(struct bContext *C); -int ED_operator_region_view3d_active(struct bContext *C); -int ED_operator_animview_active(struct bContext *C); -int ED_operator_timeline_active(struct bContext *C); -int ED_operator_outliner_active(struct bContext *C); -int ED_operator_outliner_active_no_editobject(struct bContext *C); -int ED_operator_file_active(struct bContext *C); -int ED_operator_action_active(struct bContext *C); -int ED_operator_buttons_active(struct bContext *C); -int ED_operator_node_active(struct bContext *C); -int ED_operator_node_editable(struct bContext *C); -int ED_operator_graphedit_active(struct bContext *C); -int ED_operator_sequencer_active(struct bContext *C); -int ED_operator_sequencer_active_editable(struct bContext *C); -int ED_operator_image_active(struct bContext *C); -int ED_operator_nla_active(struct bContext *C); -int ED_operator_logic_active(struct bContext *C); -int ED_operator_info_active(struct bContext *C); -int ED_operator_console_active(struct bContext *C); - - -int ED_operator_object_active(struct bContext *C); -int ED_operator_object_active_editable(struct bContext *C); -int ED_operator_object_active_editable_mesh(struct bContext *C); -int ED_operator_object_active_editable_font(struct bContext *C); -int ED_operator_editmesh(struct bContext *C); -int ED_operator_editmesh_view3d(struct bContext *C); -int ED_operator_editmesh_region_view3d(struct bContext *C); -int ED_operator_editarmature(struct bContext *C); -int ED_operator_editcurve(struct bContext *C); -int ED_operator_editcurve_3d(struct bContext *C); -int ED_operator_editsurf(struct bContext *C); -int ED_operator_editsurfcurve(struct bContext *C); -int ED_operator_editsurfcurve_region_view3d(struct bContext *C); -int ED_operator_editfont(struct bContext *C); -int ED_operator_editlattice(struct bContext *C); -int ED_operator_editmball(struct bContext *C); -int ED_operator_uvedit(struct bContext *C); -int ED_operator_uvedit_space_image(struct bContext *C); -int ED_operator_uvmap(struct bContext *C); -int ED_operator_posemode_exclusive(struct bContext *C); -int ED_operator_posemode_context(struct bContext *C); -int ED_operator_posemode(struct bContext *C); -int ED_operator_posemode_local(struct bContext *C); -int ED_operator_mask(struct bContext *C); +bool ED_operator_screenactive(struct bContext *C); +bool ED_operator_screen_mainwinactive(struct bContext *C); +bool ED_operator_areaactive(struct bContext *C); +bool ED_operator_regionactive(struct bContext *C); + +bool ED_operator_scene(struct bContext *C); +bool ED_operator_scene_editable(struct bContext *C); +bool ED_operator_objectmode(struct bContext *C); + +bool ED_operator_view3d_active(struct bContext *C); +bool ED_operator_region_view3d_active(struct bContext *C); +bool ED_operator_animview_active(struct bContext *C); +bool ED_operator_timeline_active(struct bContext *C); +bool ED_operator_outliner_active(struct bContext *C); +bool ED_operator_outliner_active_no_editobject(struct bContext *C); +bool ED_operator_file_active(struct bContext *C); +bool ED_operator_action_active(struct bContext *C); +bool ED_operator_buttons_active(struct bContext *C); +bool ED_operator_node_active(struct bContext *C); +bool ED_operator_node_editable(struct bContext *C); +bool ED_operator_graphedit_active(struct bContext *C); +bool ED_operator_sequencer_active(struct bContext *C); +bool ED_operator_sequencer_active_editable(struct bContext *C); +bool ED_operator_image_active(struct bContext *C); +bool ED_operator_nla_active(struct bContext *C); +bool ED_operator_logic_active(struct bContext *C); +bool ED_operator_info_active(struct bContext *C); +bool ED_operator_console_active(struct bContext *C); + + +bool ED_operator_object_active(struct bContext *C); +bool ED_operator_object_active_editable(struct bContext *C); +bool ED_operator_object_active_editable_mesh(struct bContext *C); +bool ED_operator_object_active_editable_font(struct bContext *C); +bool ED_operator_editmesh(struct bContext *C); +bool ED_operator_editmesh_view3d(struct bContext *C); +bool ED_operator_editmesh_region_view3d(struct bContext *C); +bool ED_operator_editarmature(struct bContext *C); +bool ED_operator_editcurve(struct bContext *C); +bool ED_operator_editcurve_3d(struct bContext *C); +bool ED_operator_editsurf(struct bContext *C); +bool ED_operator_editsurfcurve(struct bContext *C); +bool ED_operator_editsurfcurve_region_view3d(struct bContext *C); +bool ED_operator_editfont(struct bContext *C); +bool ED_operator_editlattice(struct bContext *C); +bool ED_operator_editmball(struct bContext *C); +bool ED_operator_uvedit(struct bContext *C); +bool ED_operator_uvedit_space_image(struct bContext *C); +bool ED_operator_uvmap(struct bContext *C); +bool ED_operator_posemode_exclusive(struct bContext *C); +bool ED_operator_posemode_context(struct bContext *C); +bool ED_operator_posemode(struct bContext *C); +bool ED_operator_posemode_local(struct bContext *C); +bool ED_operator_mask(struct bContext *C); /* Cache display helpers */ diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index 94885c2abe0..18446966c4f 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -35,9 +35,9 @@ struct SpaceSeq; void ED_sequencer_select_sequence_single(struct Scene *scene, struct Sequence *seq, bool deselect_all); void ED_sequencer_deselect_all(struct Scene *scene); -int ED_space_sequencer_maskedit_mask_poll(struct bContext *C); +bool ED_space_sequencer_maskedit_mask_poll(struct bContext *C); bool ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene); -int ED_space_sequencer_maskedit_poll(struct bContext *C); +bool ED_space_sequencer_maskedit_poll(struct bContext *C); bool ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq); bool ED_space_sequencer_check_show_strip(struct SpaceSeq *sseq); diff --git a/source/blender/editors/include/ED_transverts.h b/source/blender/editors/include/ED_transverts.h index 9005d55feff..363bb31c3dc 100644 --- a/source/blender/editors/include/ED_transverts.h +++ b/source/blender/editors/include/ED_transverts.h @@ -50,7 +50,7 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, struct Object *obedit void ED_transverts_update_obedit(TransVertStore *tvs, struct Object *obedit); void ED_transverts_free(TransVertStore *tvs); bool ED_transverts_check_obedit(Object *obedit); -int ED_transverts_poll(struct bContext *C); +bool ED_transverts_poll(struct bContext *C); /* currently only used for bmesh index values */ enum { diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 43bdafed277..82411ba7401 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -343,7 +343,7 @@ bool edge_inside_circle(const float cent[2], float radius, const float screen_co /* get 3d region from context, also if mouse is in header or toolbar */ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); bool ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, struct ARegion **r_ar); -int ED_operator_rv3d_user_region_poll(struct bContext *C); +bool ED_operator_rv3d_user_region_poll(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 0204301941e..1fd951c23c5 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1065,7 +1065,7 @@ void ED_operatortypes_ui(void); void ED_keymap_ui(struct wmKeyConfig *keyconf); void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop); -int UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event); +bool UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event); bool UI_context_copy_to_selected_list( struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, -- cgit v1.2.3