Cleanup: use bool for poll functions

This commit is contained in:
Campbell Barton 2018-07-02 11:47:00 +02:00
parent bfbfb1c47e
commit b88e51dd55
187 changed files with 600 additions and 595 deletions

@ -202,9 +202,9 @@ typedef struct bNodeType {
void (*copyfunc_api)(struct PointerRNA *ptr, struct bNode *src_node);
/* can this node type be added to a node tree */
int (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
bool (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
/* can this node be added to a node tree */
int (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
bool (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
/* optional handling of link insertion */
void (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link);
@ -283,7 +283,7 @@ typedef struct bNodeTreeType {
void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node);
void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func); /* iteration over all node classes */
/* Check visibility in the node editor */
int (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
/* Select a node tree from the context */
void (*get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype,
struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from);
@ -296,7 +296,7 @@ typedef struct bNodeTreeType {
/* Tree update. Overrides nodetype->updatetreefunc! */
void (*update)(struct bNodeTree *ntree);
int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
bool (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode);

@ -185,7 +185,7 @@ typedef struct PanelType {
int flag;
/* verify if the panel should draw or not */
int (*poll)(const struct bContext *C, struct PanelType *pt);
bool (*poll)(const struct bContext *C, struct PanelType *pt);
/* draw header (optional) */
void (*draw_header)(const struct bContext *C, struct Panel *pa);
/* draw entirely, view changes should be handled here */
@ -256,7 +256,7 @@ typedef struct MenuType {
const char *description;
/* verify if the menu should draw or not */
int (*poll)(const struct bContext *C, struct MenuType *mt);
bool (*poll)(const struct bContext *C, struct MenuType *mt);
/* draw entirely, view changes should be handled here */
void (*draw)(const struct bContext *C, struct Menu *menu);

@ -3232,13 +3232,13 @@ static void node_type_base_defaults(bNodeType *ntype)
}
/* allow this node for any tree type */
static int node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
static bool node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
{
return true;
}
/* use the basic poll function */
static int node_poll_instance_default(bNode *node, bNodeTree *ntree)
static bool node_poll_instance_default(bNode *node, bNodeTree *ntree)
{
return node->typeinfo->poll(node->typeinfo, ntree);
}
@ -3431,7 +3431,7 @@ void node_type_compatibility(struct bNodeType *ntype, short compatibility)
/* callbacks for undefined types */
static int node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
static bool node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
{
/* this type can not be added deliberately, it's just a placeholder */
return false;

@ -657,7 +657,7 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
/* ****************** Operator Utilities ********************************** */
/* poll callback for being in an Animation Editor channels list region */
static int animedit_poll_channels_active(bContext *C)
static bool animedit_poll_channels_active(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
@ -673,7 +673,7 @@ static int animedit_poll_channels_active(bContext *C)
}
/* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */
static int animedit_poll_channels_nla_tweakmode_off(bContext *C)
static bool animedit_poll_channels_nla_tweakmode_off(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);
@ -1413,7 +1413,7 @@ static void ANIM_OT_channels_move(wmOperatorType *ot)
/* ******************** Group Channel Operator ************************ */
static int animchannels_grouping_poll(bContext *C)
static bool animchannels_grouping_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
SpaceLink *sl;
@ -2188,7 +2188,7 @@ static void ANIM_OT_channels_clean_empty(wmOperatorType *ot)
/* ******************* Reenable Disabled Operator ******************* */
static int animchannels_enable_poll(bContext *C)
static bool animchannels_enable_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
@ -2262,7 +2262,7 @@ static void ANIM_OT_channels_fcurves_enable(wmOperatorType *ot)
/* ****************** Find / Set Filter Operator ******************** */
/* XXX: make this generic? */
static int animchannels_find_poll(bContext *C)
static bool animchannels_find_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);

@ -492,7 +492,7 @@ void ED_markers_draw(const bContext *C, int flag)
/* ------------------------ */
/* special poll() which checks if there are selected markers first */
static int ed_markers_poll_selected_markers(bContext *C)
static bool ed_markers_poll_selected_markers(bContext *C)
{
ListBase *markers = ED_context_get_markers(C);
@ -504,7 +504,7 @@ static int ed_markers_poll_selected_markers(bContext *C)
return ED_markers_get_first_selected(markers) != NULL;
}
static int ed_markers_poll_selected_no_locked_markers(bContext *C)
static bool ed_markers_poll_selected_no_locked_markers(bContext *C)
{
ListBase *markers = ED_context_get_markers(C);
ToolSettings *ts = CTX_data_tool_settings(C);
@ -522,7 +522,7 @@ static int ed_markers_poll_selected_no_locked_markers(bContext *C)
/* special poll() which checks if there are any markers at all first */
static int ed_markers_poll_markers_exist(bContext *C)
static bool ed_markers_poll_markers_exist(bContext *C)
{
ListBase *markers = ED_context_get_markers(C);
ToolSettings *ts = CTX_data_tool_settings(C);

@ -64,7 +64,7 @@
/* ********************** frame change operator ***************************/
/* Check if the operator can be run from the current context */
static int change_frame_poll(bContext *C)
static bool change_frame_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);

@ -806,7 +806,7 @@ static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, PointerRN
/* Add Driver Button Operator ------------------------ */
static int add_driver_button_poll(bContext *C)
static bool add_driver_button_poll(bContext *C)
{
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;

@ -1312,7 +1312,7 @@ enum {
* This is based on the standard ED_operator_areaactive callback,
* except that it does special checks for a few spacetypes too...
*/
static int modify_key_op_poll(bContext *C)
static bool modify_key_op_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);

@ -73,14 +73,14 @@
*/
/* poll callback for adding default KeyingSet */
static int keyingset_poll_default_add(bContext *C)
static bool keyingset_poll_default_add(bContext *C)
{
/* as long as there's an active Scene, it's fine */
return (CTX_data_scene(C) != NULL);
}
/* poll callback for editing active KeyingSet */
static int keyingset_poll_active_edit(bContext *C)
static bool keyingset_poll_active_edit(bContext *C)
{
Scene *scene = CTX_data_scene(C);
@ -92,7 +92,7 @@ static int keyingset_poll_active_edit(bContext *C)
}
/* poll callback for editing active KeyingSet Path */
static int keyingset_poll_activePath_edit(bContext *C)
static bool keyingset_poll_activePath_edit(bContext *C)
{
Scene *scene = CTX_data_scene(C);
KeyingSet *ks;

@ -251,7 +251,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEv
return OPERATOR_FINISHED;
}
static int armature_select_linked_poll(bContext *C)
static bool armature_select_linked_poll(bContext *C)
{
return (ED_operator_view3d_active(C) && ED_operator_editarmature(C));
}

@ -2456,7 +2456,7 @@ static int sketch_draw_preview(bContext *C, wmOperator *op, const wmEvent *event
/* ============================================== Poll Functions ============================================= */
int ED_operator_sketch_mode_active_stroke(bContext *C)
bool ED_operator_sketch_mode_active_stroke(bContext *C)
{
ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0);
@ -2472,7 +2472,7 @@ int ED_operator_sketch_mode_active_stroke(bContext *C)
}
}
static int ED_operator_sketch_mode_gesture(bContext *C)
static bool ED_operator_sketch_mode_gesture(bContext *C)
{
ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0);
@ -2489,7 +2489,7 @@ static int ED_operator_sketch_mode_gesture(bContext *C)
}
}
int ED_operator_sketch_full_mode(bContext *C)
bool ED_operator_sketch_full_mode(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
ToolSettings *ts = CTX_data_tool_settings(C);
@ -2506,7 +2506,7 @@ int ED_operator_sketch_full_mode(bContext *C)
}
}
int ED_operator_sketch_mode(const bContext *C)
bool ED_operator_sketch_mode(const bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
ToolSettings *ts = CTX_data_tool_settings(C);
@ -2634,7 +2634,7 @@ void SKETCH_OT_draw_stroke(wmOperatorType *ot)
ot->modal = sketch_draw_stroke_modal;
ot->cancel = sketch_draw_stroke_cancel;
ot->poll = (int (*)(bContext *))ED_operator_sketch_mode;
ot->poll = (bool (*)(bContext *))ED_operator_sketch_mode;
RNA_def_boolean(ot->srna, "snap", 0, "Snap", "");

@ -277,7 +277,7 @@ void POSE_OT_paths_calculate(wmOperatorType *ot)
/* --------- */
static int pose_update_paths_poll(bContext *C)
static bool pose_update_paths_poll(bContext *C)
{
if (ED_operator_posemode_exclusive(C)) {
Object *ob = CTX_data_active_object(C);
@ -760,7 +760,7 @@ void POSE_OT_rotation_mode_set(wmOperatorType *ot)
/* ********************************************** */
static int armature_layers_poll(bContext *C)
static bool armature_layers_poll(bContext *C)
{
/* Armature layers operators can be used in posemode OR editmode for armatures */
return ED_operator_posemode(C) || ED_operator_editarmature(C);

@ -173,7 +173,7 @@ static Object *get_poselib_object(bContext *C)
}
/* Poll callback for operators that require existing PoseLib data (with poses) to work */
static int has_poselib_pose_data_poll(bContext *C)
static bool has_poselib_pose_data_poll(bContext *C)
{
Object *ob = get_poselib_object(C);
return (ob && ob->poselib);
@ -182,7 +182,7 @@ static int has_poselib_pose_data_poll(bContext *C)
/* Poll callback for operators that require existing PoseLib data (with poses)
* as they need to do some editing work on those poses (i.e. not on lib-linked actions)
*/
static int has_poselib_pose_data_for_editing_poll(bContext *C)
static bool has_poselib_pose_data_for_editing_poll(bContext *C)
{
Object *ob = get_poselib_object(C);
return (ob && ob->poselib && !ID_IS_LINKED(ob->poselib));
@ -378,7 +378,7 @@ void POSELIB_OT_action_sanitize(wmOperatorType *ot)
/* ------------------------------------------ */
/* Poll callback for adding poses to a PoseLib */
static int poselib_add_poll(bContext *C)
static bool poselib_add_poll(bContext *C)
{
/* There are 2 cases we need to be careful with:
* 1) When this operator is invoked from a hotkey, there may be no PoseLib yet

@ -320,7 +320,7 @@ static int pose_select_connected_invoke(bContext *C, wmOperator *op, const wmEve
return OPERATOR_FINISHED;
}
static int pose_select_linked_poll(bContext *C)
static bool pose_select_linked_poll(bContext *C)
{
return (ED_operator_view3d_active(C) && ED_operator_posemode(C));
}

@ -6225,7 +6225,7 @@ bool ED_curve_active_center(Curve *cu, float center[3])
/******************** Match texture space operator ***********************/
static int match_texture_space_poll(bContext *C)
static bool match_texture_space_poll(bContext *C)
{
Object *object = CTX_data_active_object(C);

@ -1174,7 +1174,7 @@ static void gpsculpt_brush_exit(bContext *C, wmOperator *op)
}
/* poll callback for stroke sculpting operator(s) */
static int gpsculpt_brush_poll(bContext *C)
static bool gpsculpt_brush_poll(bContext *C)
{
/* NOTE: this is a bit slower, but is the most accurate... */
return CTX_DATA_COUNT(C, editable_gpencil_strokes) != 0;

@ -1282,7 +1282,7 @@ static void gp_convert_set_end_frame(struct Main *UNUSED(main), struct Scene *UN
}
}
static int gp_convert_poll(bContext *C)
static bool gp_convert_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDlayer *gpl = NULL;

@ -131,7 +131,7 @@ void GPENCIL_OT_data_add(wmOperatorType *ot)
/* ******************* Unlink Data ************************ */
/* poll callback for adding data/layers - special */
static int gp_data_unlink_poll(bContext *C)
static bool gp_data_unlink_poll(bContext *C)
{
bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL);
@ -420,7 +420,7 @@ void GPENCIL_OT_hide(wmOperatorType *ot)
/* ********************** Show All Layers ***************************** */
/* poll callback for showing layers */
static int gp_reveal_poll(bContext *C)
static bool gp_reveal_poll(bContext *C)
{
return ED_gpencil_data_get_active(C) != NULL;
}
@ -1811,7 +1811,7 @@ void GPENCIL_OT_palettecolor_hide(wmOperatorType *ot)
/* ********************** Show All Colors ***************************** */
/* poll callback for showing colors */
static int gp_palettecolor_reveal_poll(bContext *C)
static bool gp_palettecolor_reveal_poll(bContext *C)
{
return ED_gpencil_data_get_active(C) != NULL;
}

@ -84,7 +84,7 @@
/* ************************************************ */
/* Stroke Edit Mode Management */
static int gpencil_editmode_toggle_poll(bContext *C)
static bool gpencil_editmode_toggle_poll(bContext *C)
{
return ED_gpencil_data_get_active(C) != NULL;
}
@ -129,7 +129,7 @@ void GPENCIL_OT_editmode_toggle(wmOperatorType *ot)
/* Stroke Editing Operators */
/* poll callback for all stroke editing operators */
static int gp_stroke_edit_poll(bContext *C)
static bool gp_stroke_edit_poll(bContext *C)
{
/* NOTE: this is a bit slower, but is the most accurate... */
return CTX_DATA_COUNT(C, editable_gpencil_strokes) != 0;
@ -515,7 +515,7 @@ void GPENCIL_OT_copy(wmOperatorType *ot)
/* --------------------- */
/* Paste selected strokes */
static int gp_strokes_paste_poll(bContext *C)
static bool gp_strokes_paste_poll(bContext *C)
{
/* 1) Must have GP datablock to paste to
* - We don't need to have an active layer though, as that can easily get added
@ -782,7 +782,7 @@ void GPENCIL_OT_move_to_layer(wmOperatorType *ot)
/* ********************* Add Blank Frame *************************** */
/* Basically the same as the drawing op */
static int UNUSED_FUNCTION(gp_blank_frame_add_poll)(bContext *C)
static bool UNUSED_FUNCTION(gp_blank_frame_add_poll)(bContext *C)
{
if (ED_operator_regionactive(C)) {
/* check if current context can support GPencil data */
@ -862,7 +862,7 @@ void GPENCIL_OT_blank_frame_add(wmOperatorType *ot)
/* ******************* Delete Active Frame ************************ */
static int gp_actframe_delete_poll(bContext *C)
static bool gp_actframe_delete_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd);
@ -914,7 +914,7 @@ void GPENCIL_OT_active_frame_delete(wmOperatorType *ot)
/* **************** Delete All Active Frames ****************** */
static int gp_actframe_delete_all_poll(bContext *C)
static bool gp_actframe_delete_all_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
@ -1368,7 +1368,7 @@ void GPENCIL_OT_dissolve(wmOperatorType *ot)
/* NOTE: For now, we only allow these in the 3D view, as other editors do not
* define a cursor or gridstep which can be used
*/
static int gp_snap_poll(bContext *C)
static bool gp_snap_poll(bContext *C)
{
bGPdata *gpd = CTX_data_gpencil_data(C);
ScrArea *sa = CTX_wm_area(C);
@ -2088,7 +2088,7 @@ typedef enum eGP_ReprojectModes {
GP_REPROJECT_SURFACE,
} eGP_ReprojectModes;
static int gp_strokes_reproject_poll(bContext *C)
static bool gp_strokes_reproject_poll(bContext *C)
{
/* 2 Requirements:
* - 1) Editable GP data

@ -93,12 +93,12 @@ bool gp_point_xy_to_3d(GP_SpaceConversion *gsc, struct Scene *scene, const float
/* Poll Callbacks ------------------------------------ */
/* gpencil_utils.c */
int gp_add_poll(struct bContext *C);
int gp_active_layer_poll(struct bContext *C);
int gp_active_brush_poll(struct bContext *C);
int gp_active_palette_poll(struct bContext *C);
int gp_active_palettecolor_poll(struct bContext *C);
int gp_brush_crt_presets_poll(bContext *C);
bool gp_add_poll(struct bContext *C);
bool gp_active_layer_poll(struct bContext *C);
bool gp_active_brush_poll(struct bContext *C);
bool gp_active_palette_poll(struct bContext *C);
bool gp_active_palettecolor_poll(struct bContext *C);
bool gp_brush_crt_presets_poll(bContext *C);
/* Copy/Paste Buffer --------------------------------- */
/* gpencil_edit.c */

@ -85,7 +85,7 @@
/* Core/Shared Utilities */
/* Poll callback for interpolation operators */
static int gpencil_view3d_poll(bContext *C)
static bool gpencil_view3d_poll(bContext *C)
{
bGPdata *gpd = CTX_data_gpencil_data(C);
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
@ -1032,7 +1032,7 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot)
/* ******************** Remove Breakdowns ************************ */
static int gpencil_interpolate_reverse_poll(bContext *C)
static bool gpencil_interpolate_reverse_poll(bContext *C)
{
if (!gpencil_view3d_poll(C)) {
return 0;

@ -114,7 +114,7 @@ static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
/* ==================== */
/* Poll callback for stroke editing mode */
static int gp_stroke_editmode_poll(bContext *C)
static bool gp_stroke_editmode_poll(bContext *C)
{
bGPdata *gpd = CTX_data_gpencil_data(C);
return (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE));

@ -195,7 +195,7 @@ static void gp_session_validatebuffer(tGPsdata *p);
/* Context Wrangling... */
/* check if context is suitable for drawing */
static int gpencil_draw_poll(bContext *C)
static bool gpencil_draw_poll(bContext *C)
{
if (ED_operator_regionactive(C)) {
/* check if current context can support GPencil data */

@ -67,7 +67,7 @@
/* ********************************************** */
/* Polling callbacks */
static int gpencil_select_poll(bContext *C)
static bool gpencil_select_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);

@ -260,14 +260,14 @@ bool ED_gpencil_has_keyframe_v3d(Scene *scene, Object *ob, int cfra)
/* Poll Callbacks */
/* poll callback for adding data/layers - special */
int gp_add_poll(bContext *C)
bool gp_add_poll(bContext *C)
{
/* the base line we have is that we have somewhere to add Grease Pencil data */
return ED_gpencil_data_get_pointers(C, NULL) != NULL;
}
/* poll callback for checking if there is an active layer */
int gp_active_layer_poll(bContext *C)
bool gp_active_layer_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd);
@ -276,7 +276,7 @@ int gp_active_layer_poll(bContext *C)
}
/* poll callback for checking if there is an active brush */
int gp_active_brush_poll(bContext *C)
bool gp_active_brush_poll(bContext *C)
{
ToolSettings *ts = CTX_data_tool_settings(C);
bGPDbrush *brush = BKE_gpencil_brush_getactive(ts);
@ -285,7 +285,7 @@ int gp_active_brush_poll(bContext *C)
}
/* poll callback for checking if there is an active palette */
int gp_active_palette_poll(bContext *C)
bool gp_active_palette_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDpalette *palette = BKE_gpencil_palette_getactive(gpd);
@ -294,7 +294,7 @@ int gp_active_palette_poll(bContext *C)
}
/* poll callback for checking if there is an active palette color */
int gp_active_palettecolor_poll(bContext *C)
bool gp_active_palettecolor_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDpalette *palette = BKE_gpencil_palette_getactive(gpd);

@ -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);

@ -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]);

@ -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);

@ -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) */

@ -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);

@ -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);
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);
int ED_operator_scene(struct bContext *C);
int ED_operator_scene_editable(struct bContext *C);
int ED_operator_objectmode(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);
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);
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);
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_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 */

@ -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);

@ -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 {

@ -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);

@ -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,

@ -319,7 +319,7 @@ static int eyedropper_exec(bContext *C, wmOperator *op)
}
}
static int eyedropper_poll(bContext *C)
static bool eyedropper_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;

@ -289,7 +289,7 @@ static int eyedropper_colorband_exec(bContext *C, wmOperator *op)
}
}
static int eyedropper_colorband_poll(bContext *C)
static bool eyedropper_colorband_poll(bContext *C)
{
uiBut *but = UI_context_active_but_get(C);
return (but && but->type == UI_BTYPE_COLORBAND);

@ -305,7 +305,7 @@ static int datadropper_exec(bContext *C, wmOperator *op)
}
}
static int datadropper_poll(bContext *C)
static bool datadropper_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;

@ -332,7 +332,7 @@ static int depthdropper_exec(bContext *C, wmOperator *op)
}
}
static int depthdropper_poll(bContext *C)
static bool depthdropper_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;

@ -203,7 +203,7 @@ static int driverdropper_exec(bContext *C, wmOperator *op)
}
}
static int driverdropper_poll(bContext *C)
static bool driverdropper_poll(bContext *C)
{
if (!CTX_wm_window(C)) return 0;
else return 1;

@ -92,7 +92,7 @@ static void UI_OT_reset_default_theme(wmOperatorType *ot)
/* Copy Data Path Operator ------------------------ */
static int copy_data_path_button_poll(bContext *C)
static bool copy_data_path_button_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;
@ -171,7 +171,7 @@ static void UI_OT_copy_data_path_button(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
static int copy_python_command_button_poll(bContext *C)
static bool copy_python_command_button_poll(bContext *C)
{
uiBut *but = UI_context_active_but_get(C);
@ -242,7 +242,7 @@ static int operator_button_property_finish(bContext *C, PointerRNA *ptr, Propert
}
}
static int reset_default_button_poll(bContext *C)
static bool reset_default_button_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;
@ -549,7 +549,7 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
return success;
}
static int copy_to_selected_button_poll(bContext *C)
static bool copy_to_selected_button_poll(bContext *C)
{
return copy_to_selected_button(C, false, true);
}
@ -589,7 +589,7 @@ static void UI_OT_copy_to_selected_button(wmOperatorType *ot)
* when there are too many to display...
*/
static int reports_to_text_poll(bContext *C)
static bool reports_to_text_poll(bContext *C)
{
return CTX_wm_reports(C) != NULL;
}
@ -1021,7 +1021,7 @@ static void UI_OT_reloadtranslation(wmOperatorType *ot)
ot->exec = reloadtranslation_exec;
}
int UI_drop_color_poll(struct bContext *C, wmDrag *drag, const wmEvent *UNUSED(event))
bool UI_drop_color_poll(struct bContext *C, wmDrag *drag, const wmEvent *UNUSED(event))
{
/* should only return true for regions that include buttons, for now
* return true always */

@ -53,7 +53,7 @@
#include "PIL_time.h" /* USER_ZOOM_CONT */
static int view2d_poll(bContext *C)
static bool view2d_poll(bContext *C)
{
ARegion *ar = CTX_wm_region(C);
@ -128,7 +128,7 @@ static int view_pan_init(bContext *C, wmOperator *op)
}
#ifdef WITH_INPUT_NDOF
static int view_pan_poll(bContext *C)
static bool view_pan_poll(bContext *C)
{
ARegion *ar = CTX_wm_region(C);
View2D *v2d;
@ -610,7 +610,7 @@ static int view_zoomdrag_init(bContext *C, wmOperator *op)
}
/* check if step-zoom can be applied */
static int view_zoom_poll(bContext *C)
static bool view_zoom_poll(bContext *C)
{
ARegion *ar = CTX_wm_region(C);
View2D *v2d;

@ -55,7 +55,7 @@
/** \name Make Regular Operator
* \{ */
static int make_regular_poll(bContext *C)
static bool make_regular_poll(bContext *C)
{
Object *ob;

@ -57,7 +57,7 @@
/********************** generic poll functions *********************/
int ED_maskedit_poll(bContext *C)
bool ED_maskedit_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
if (sa) {
@ -73,7 +73,7 @@ int ED_maskedit_poll(bContext *C)
return false;
}
int ED_maskedit_mask_poll(bContext *C)
bool ED_maskedit_mask_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
if (sa) {

@ -121,8 +121,8 @@ void ED_mask_select_toggle_all(struct Mask *mask, int action);
void ED_mask_select_flush_all(struct Mask *mask);
/* mask_editor.c */
int ED_maskedit_poll(struct bContext *C);
int ED_maskedit_mask_poll(struct bContext *C);
bool ED_maskedit_poll(struct bContext *C);
bool ED_maskedit_mask_poll(struct bContext *C);
/* mask_shapekey.c */
void MASK_OT_shape_key_insert(struct wmOperatorType *ot);

@ -2105,7 +2105,7 @@ void MASK_OT_feather_weight_clear(wmOperatorType *ot)
/******************** move mask layer operator *********************/
static int mask_layer_move_poll(bContext *C)
static bool mask_layer_move_poll(bContext *C)
{
if (ED_maskedit_mask_poll(C)) {
Mask *mask = CTX_data_edit_mask(C);
@ -2334,7 +2334,7 @@ void MASK_OT_copy_splines(wmOperatorType *ot)
/********************** paste tracks from clipboard operator *********************/
static int paste_splines_poll(bContext *C)
static bool paste_splines_poll(bContext *C)
{
if (ED_maskedit_mask_poll(C)) {
return BKE_mask_clipboard_is_empty() == false;

@ -3833,7 +3833,7 @@ void MESH_OT_select_random(wmOperatorType *ot)
/** \name Select Ungrouped Operator
* \{ */
static int edbm_select_ungrouped_poll(bContext *C)
static bool edbm_select_ungrouped_poll(bContext *C)
{
if (ED_operator_editmesh(C)) {
Object *obedit = CTX_data_edit_object(C);

@ -1384,7 +1384,7 @@ DerivedMesh *EDBM_mesh_deform_dm_get(BMEditMesh *em)
* \{ */
/* poll call for mesh operators requiring a view3d context */
int EDBM_view3d_poll(bContext *C)
bool EDBM_view3d_poll(bContext *C)
{
if (ED_operator_editmesh(C) && ED_operator_view3d_active(C)) {
return 1;

@ -521,7 +521,7 @@ bool ED_mesh_color_remove_named(Mesh *me, const char *name)
/*********************** UV texture operators ************************/
static int layers_poll(bContext *C)
static bool layers_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -762,7 +762,7 @@ static int mesh_customdata_clear_exec__internal(bContext *C,
}
/* Clear Mask */
static int mesh_customdata_mask_clear_poll(bContext *C)
static bool mesh_customdata_mask_clear_poll(bContext *C)
{
Object *ob = ED_object_context(C);
if (ob && ob->type == OB_MESH) {
@ -835,7 +835,7 @@ static int mesh_customdata_skin_state(bContext *C)
return -1;
}
static int mesh_customdata_skin_add_poll(bContext *C)
static bool mesh_customdata_skin_add_poll(bContext *C)
{
return (mesh_customdata_skin_state(C) == 0);
}
@ -868,7 +868,7 @@ void MESH_OT_customdata_skin_add(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int mesh_customdata_skin_clear_poll(bContext *C)
static bool mesh_customdata_skin_clear_poll(bContext *C)
{
return (mesh_customdata_skin_state(C) == 1);
}

@ -73,7 +73,7 @@ bool EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
void EDBM_stats_update(struct BMEditMesh *em);
int EDBM_view3d_poll(struct bContext *C);
bool EDBM_view3d_poll(struct bContext *C);
struct BMElem *EDBM_elem_from_selectmode(
struct BMEditMesh *em,

@ -654,7 +654,7 @@ void MESH_OT_navmesh_face_add(struct wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int navmesh_obmode_data_poll(bContext *C)
static bool navmesh_obmode_data_poll(bContext *C)
{
Object *ob = ED_object_active_context(C);
if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
@ -664,7 +664,7 @@ static int navmesh_obmode_data_poll(bContext *C)
return false;
}
static int navmesh_obmode_poll(bContext *C)
static bool navmesh_obmode_poll(bContext *C)
{
Object *ob = ED_object_active_context(C);
if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {

@ -1582,7 +1582,7 @@ static void curvetomesh(Main *bmain, Scene *scene, Object *ob)
}
}
static int convert_poll(bContext *C)
static bool convert_poll(bContext *C)
{
Object *obact = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
@ -2425,7 +2425,7 @@ void OBJECT_OT_add_named(wmOperatorType *ot)
/**************************** Join *************************/
static int join_poll(bContext *C)
static bool join_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@ -2478,7 +2478,7 @@ void OBJECT_OT_join(wmOperatorType *ot)
/**************************** Join as Shape Key*************************/
static int join_shapes_poll(bContext *C)
static bool join_shapes_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);

@ -576,7 +576,7 @@ static const EnumPropertyItem constraint_owner_items[] = {
{0, NULL, 0, NULL, NULL}};
static int edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
static bool edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", rna_type);
Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C);
@ -599,7 +599,7 @@ static int edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
return 1;
}
static int edit_constraint_poll(bContext *C)
static bool edit_constraint_poll(bContext *C)
{
return edit_constraint_poll_generic(C, &RNA_Constraint);
}
@ -1251,7 +1251,7 @@ void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstr
DAG_relations_tag_update(bmain);
}
static int constraint_poll(bContext *C)
static bool constraint_poll(bContext *C)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint);
return (ptr.id.data && ptr.data);

@ -445,7 +445,7 @@ static int data_transfer_exec(bContext *C, wmOperator *op)
/* Used by both OBJECT_OT_data_transfer and OBJECT_OT_datalayout_transfer */
/* Note this context poll is only really partial, it cannot check for all possible invalid cases. */
static int data_transfer_poll(bContext *C)
static bool data_transfer_poll(bContext *C)
{
Object *ob = ED_object_active_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -613,7 +613,7 @@ void OBJECT_OT_data_transfer(wmOperatorType *ot)
* or as a DataTransfer modifier tool.
*/
static int datalayout_transfer_poll(bContext *C)
static bool datalayout_transfer_poll(bContext *C)
{
return (edit_modifier_poll_generic(C, &RNA_DataTransferModifier, (1 << OB_MESH)) || data_transfer_poll(C));
}

@ -654,7 +654,7 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
static int editmode_toggle_poll(bContext *C)
static bool editmode_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@ -1348,7 +1348,7 @@ void OBJECT_OT_paths_calculate(wmOperatorType *ot)
/* --------- */
static int object_update_paths_poll(bContext *C)
static bool object_update_paths_poll(bContext *C)
{
if (ED_operator_object_active_editable(C)) {
Object *ob = ED_object_active_context(C);
@ -1516,7 +1516,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
return (done) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static int shade_poll(bContext *C)
static bool shade_poll(bContext *C)
{
return (CTX_data_edit_object(C) == NULL);
}
@ -1665,7 +1665,7 @@ static const EnumPropertyItem *object_mode_set_itemsf(
return item;
}
static int object_mode_set_poll(bContext *C)
static bool object_mode_set_poll(bContext *C)
{
/* Since Grease Pencil editmode is also handled here,
* we have a special exception for allowing this operator

@ -431,7 +431,7 @@ static void object_hook_select(Object *ob, HookModifierData *hmd)
/* special poll operators for hook operators */
/* TODO: check for properties window modifier context too as alternative? */
static int hook_op_edit_poll(bContext *C)
static bool hook_op_edit_poll(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);

@ -148,8 +148,8 @@ void GROUP_OT_objects_add_active(struct wmOperatorType *ot);
void GROUP_OT_objects_remove_active(struct wmOperatorType *ot);
/* object_modifier.c */
int edit_modifier_poll_generic(struct bContext *C, struct StructRNA *rna_type, int obtype_flag);
int edit_modifier_poll(struct bContext *C);
bool edit_modifier_poll_generic(struct bContext *C, struct StructRNA *rna_type, int obtype_flag);
bool edit_modifier_poll(struct bContext *C);
void edit_modifier_properties(struct wmOperatorType *ot);
int edit_modifier_invoke_properties(struct bContext *C, struct wmOperator *op);
struct ModifierData *edit_modifier_property_get(struct wmOperator *op, struct Object *ob, int type);

@ -814,7 +814,7 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot)
/************************ generic functions for operators using mod names and data context *********************/
int edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag)
bool edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type);
Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C);
@ -826,7 +826,7 @@ int edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag
return 1;
}
int edit_modifier_poll(bContext *C)
bool edit_modifier_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_Modifier, 0);
}
@ -1127,7 +1127,7 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot)
/************* multires delete higher levels operator ****************/
static int multires_poll(bContext *C)
static bool multires_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_MultiresModifier, (1 << OB_MESH));
}
@ -1452,13 +1452,13 @@ static void modifier_skin_customdata_delete(Object *ob)
CustomData_free_layer_active(&me->vdata, CD_MVERT_SKIN, me->totvert);
}
static int skin_poll(bContext *C)
static bool skin_poll(bContext *C)
{
return (!CTX_data_edit_object(C) &&
edit_modifier_poll_generic(C, &RNA_SkinModifier, (1 << OB_MESH)));
}
static int skin_edit_poll(bContext *C)
static bool skin_edit_poll(bContext *C)
{
return (CTX_data_edit_object(C) &&
edit_modifier_poll_generic(C, &RNA_SkinModifier, (1 << OB_MESH)));
@ -1824,7 +1824,7 @@ void OBJECT_OT_skin_armature_create(wmOperatorType *ot)
}
/************************ delta mush bind operator *********************/
static int correctivesmooth_poll(bContext *C)
static bool correctivesmooth_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_CorrectiveSmoothModifier, 0);
}
@ -1892,7 +1892,7 @@ void OBJECT_OT_correctivesmooth_bind(wmOperatorType *ot)
/************************ mdef bind operator *********************/
static int meshdeform_poll(bContext *C)
static bool meshdeform_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_MeshDeformModifier, 0);
}
@ -1988,7 +1988,7 @@ void OBJECT_OT_meshdeform_bind(wmOperatorType *ot)
/****************** explode refresh operator *********************/
static int explode_poll(bContext *C)
static bool explode_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_ExplodeModifier, 0);
}
@ -2036,7 +2036,7 @@ void OBJECT_OT_explode_refresh(wmOperatorType *ot)
/****************** ocean bake operator *********************/
static int ocean_bake_poll(bContext *C)
static bool ocean_bake_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_OceanModifier, 0);
}
@ -2254,7 +2254,7 @@ void OBJECT_OT_ocean_bake(wmOperatorType *ot)
/************************ LaplacianDeform bind operator *********************/
static int laplaciandeform_poll(bContext *C)
static bool laplaciandeform_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_LaplacianDeformModifier, 0);
}
@ -2304,7 +2304,7 @@ void OBJECT_OT_laplaciandeform_bind(wmOperatorType *ot)
/************************ sdef bind operator *********************/
static int surfacedeform_bind_poll(bContext *C)
static bool surfacedeform_bind_poll(bContext *C)
{
return edit_modifier_poll_generic(C, &RNA_SurfaceDeformModifier, 0);
}

@ -274,7 +274,7 @@ void ED_operatormacros_object(void)
}
static int object_mode_poll(bContext *C)
static bool object_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return (!ob || ob->mode == OB_MODE_OBJECT);

@ -114,7 +114,7 @@
/*********************** Make Vertex Parent Operator ************************/
static int vertex_parent_set_poll(bContext *C)
static bool vertex_parent_set_poll(bContext *C)
{
return ED_operator_editmesh(C) || ED_operator_editsurfcurve(C) || ED_operator_editlattice(C);
}

@ -121,7 +121,7 @@ void ED_base_object_activate(bContext *C, Base *base)
/********************** Selection Operators **********************/
static int objects_selectable_poll(bContext *C)
static bool objects_selectable_poll(bContext *C)
{
/* we don't check for linked scenes here, selection is
* still allowed then for inspection of scene */

@ -222,14 +222,14 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
/********************** shape key operators *********************/
static int shape_key_mode_poll(bContext *C)
static bool shape_key_mode_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) && ob->mode != OB_MODE_EDIT);
}
static int shape_key_mode_exists_poll(bContext *C)
static bool shape_key_mode_exists_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -240,7 +240,7 @@ static int shape_key_mode_exists_poll(bContext *C)
(BKE_keyblock_from_object(ob) != NULL);
}
static int shape_key_move_poll(bContext *C)
static bool shape_key_move_poll(bContext *C)
{
/* Same as shape_key_mode_exists_poll above, but ensure we have at least two shapes! */
Object *ob = ED_object_context(C);
@ -251,7 +251,7 @@ static int shape_key_move_poll(bContext *C)
ob->mode != OB_MODE_EDIT && key && key->totkey > 1);
}
static int shape_key_poll(bContext *C)
static bool shape_key_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;

@ -2480,7 +2480,7 @@ static void vgroup_assign_verts(Object *ob, const float weight)
/********************** vertex group operators *********************/
static int vertex_group_poll(bContext *C)
static bool vertex_group_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2491,7 +2491,7 @@ static int vertex_group_poll(bContext *C)
ob->defbase.first);
}
static int vertex_group_supported_poll(bContext *C)
static bool vertex_group_supported_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2499,7 +2499,7 @@ static int vertex_group_supported_poll(bContext *C)
data && !ID_IS_LINKED(data));
}
static int vertex_group_mesh_poll(bContext *C)
static bool vertex_group_mesh_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2510,7 +2510,7 @@ static int vertex_group_mesh_poll(bContext *C)
ob->defbase.first);
}
static int UNUSED_FUNCTION(vertex_group_mesh_supported_poll)(bContext *C)
static bool UNUSED_FUNCTION(vertex_group_mesh_supported_poll)(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2518,7 +2518,7 @@ static int UNUSED_FUNCTION(vertex_group_mesh_supported_poll)(bContext *C)
}
static int UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
static bool UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2530,7 +2530,7 @@ static int UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
}
/* editmode _or_ weight paint vertex sel */
static int vertex_group_vert_poll_ex(bContext *C, const bool needs_select, const short ob_type_flag)
static bool vertex_group_vert_poll_ex(bContext *C, const bool needs_select, const short ob_type_flag)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2565,25 +2565,25 @@ static int vertex_group_vert_poll_ex(bContext *C, const bool needs_select, const
}
#if 0
static int vertex_group_vert_poll(bContext *C)
static bool vertex_group_vert_poll(bContext *C)
{
return vertex_group_vert_poll_ex(C, false, 0);
}
#endif
static int vertex_group_mesh_vert_poll(bContext *C)
static bool vertex_group_mesh_vert_poll(bContext *C)
{
return vertex_group_vert_poll_ex(C, false, (1 << OB_MESH));
}
static int vertex_group_vert_select_poll(bContext *C)
static bool vertex_group_vert_select_poll(bContext *C)
{
return vertex_group_vert_poll_ex(C, true, 0);
}
#if 0
static int vertex_group_mesh_vert_select_poll(bContext *C)
static bool vertex_group_mesh_vert_select_poll(bContext *C)
{
return vertex_group_vert_poll_ex(C, true, (1 << OB_MESH));
}
@ -2591,7 +2591,7 @@ static int vertex_group_mesh_vert_select_poll(bContext *C)
/* editmode _or_ weight paint vertex sel and active group unlocked */
static int vertex_group_vert_select_unlocked_poll(bContext *C)
static bool vertex_group_vert_select_unlocked_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2614,7 +2614,7 @@ static int vertex_group_vert_select_unlocked_poll(bContext *C)
return 1;
}
static int vertex_group_vert_select_mesh_poll(bContext *C)
static bool vertex_group_vert_select_mesh_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;

@ -86,7 +86,7 @@
/**************************** utilities *******************************/
int PE_poll(bContext *C)
bool PE_poll(bContext *C)
{
Main *bmain = CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
@ -98,7 +98,7 @@ int PE_poll(bContext *C)
return (PE_get_current(bmain, scene, ob) != NULL);
}
int PE_hair_poll(bContext *C)
bool PE_hair_poll(bContext *C)
{
Main *bmain = CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
@ -113,7 +113,7 @@ int PE_hair_poll(bContext *C)
return (edit && edit->psys);
}
int PE_poll_view3d(bContext *C)
bool PE_poll_view3d(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
@ -4071,7 +4071,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
/*********************** cut shape ***************************/
static int shape_cut_poll(bContext *C)
static bool shape_cut_poll(bContext *C)
{
if (PE_hair_poll(C)) {
Scene *scene = CTX_data_scene(C);
@ -4397,7 +4397,7 @@ void PE_create_particle_edit(Main *bmain, Scene *scene, Object *ob, PointCache *
}
}
static int particle_edit_toggle_poll(bContext *C)
static bool particle_edit_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);

@ -154,7 +154,7 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
/********************** new particle settings operator *********************/
static int psys_poll(bContext *C)
static bool psys_poll(bContext *C)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
return (ptr.data != NULL);
@ -1105,7 +1105,7 @@ static bool copy_particle_systems_to_object(Main *bmain,
return true;
}
static int copy_particle_systems_poll(bContext *C)
static bool copy_particle_systems_poll(bContext *C)
{
Object *ob;
if (!ED_operator_object_active_editable(C))
@ -1182,7 +1182,7 @@ void PARTICLE_OT_copy_particle_systems(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "use_active", false, "Use Active", "Use the active particle system from the context");
}
static int duplicate_particle_systems_poll(bContext *C)
static bool duplicate_particle_systems_poll(bContext *C)
{
if (!ED_operator_object_active_editable(C)) {
return false;

@ -56,12 +56,12 @@
#include "physics_intern.h"
static int ptcache_bake_all_poll(bContext *C)
static bool ptcache_bake_all_poll(bContext *C)
{
return CTX_data_scene(C) != NULL;
}
static int ptcache_poll(bContext *C)
static bool ptcache_poll(bContext *C)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
return (ptr.data && ptr.id.data);

@ -59,7 +59,7 @@
/* ********************************************** */
/* Helper API's for RigidBody Constraint Editing */
static int ED_operator_rigidbody_con_active_poll(bContext *C)
static bool ED_operator_rigidbody_con_active_poll(bContext *C)
{
if (ED_operator_object_active_editable(C)) {
Object *ob = CTX_data_active_object(C);

@ -65,7 +65,7 @@
/* ********************************************** */
/* Helper API's for RigidBody Objects Editing */
static int ED_operator_rigidbody_active_poll(bContext *C)
static bool ED_operator_rigidbody_active_poll(bContext *C)
{
if (ED_operator_object_active_editable(C)) {
Object *ob = ED_object_active_context(C);
@ -75,7 +75,7 @@ static int ED_operator_rigidbody_active_poll(bContext *C)
return 0;
}
static int ED_operator_rigidbody_add_poll(bContext *C)
static bool ED_operator_rigidbody_add_poll(bContext *C)
{
if (ED_operator_object_active_editable(C)) {
Object *ob = ED_object_active_context(C);

@ -58,12 +58,12 @@
/* API */
/* check if there is an active rigid body world */
static int ED_rigidbody_world_active_poll(bContext *C)
static bool ED_rigidbody_world_active_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
return (scene && scene->rigidbody_world);
}
static int ED_rigidbody_world_add_poll(bContext *C)
static bool ED_rigidbody_world_add_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
return (scene && scene->rigidbody_world == NULL);

@ -682,7 +682,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot)
/********************** render view operators *********************/
static int render_view_remove_poll(bContext *C)
static bool render_view_remove_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
@ -760,7 +760,7 @@ static bool freestyle_linestyle_check_report(FreestyleLineSet *lineset, ReportLi
return true;
}
static int freestyle_active_module_poll(bContext *C)
static bool freestyle_active_module_poll(bContext *C)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
FreestyleModuleConfig *module = ptr.data;
@ -893,7 +893,7 @@ void SCENE_OT_freestyle_lineset_add(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
static int freestyle_active_lineset_poll(bContext *C)
static bool freestyle_active_lineset_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
@ -1585,7 +1585,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED
return OPERATOR_RUNNING_MODAL;
}
static int envmap_save_poll(bContext *C)
static bool envmap_save_poll(bContext *C)
{
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
@ -1639,7 +1639,7 @@ static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static int envmap_clear_poll(bContext *C)
static bool envmap_clear_poll(bContext *C)
{
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
@ -1858,7 +1858,7 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static int copy_mtex_poll(bContext *C)
static bool copy_mtex_poll(bContext *C)
{
ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;

@ -95,7 +95,7 @@
/** \name Public Poll API
* \{ */
int ED_operator_regionactive(bContext *C)
bool ED_operator_regionactive(bContext *C)
{
if (CTX_wm_window(C) == NULL) return 0;
if (CTX_wm_screen(C) == NULL) return 0;
@ -103,7 +103,7 @@ int ED_operator_regionactive(bContext *C)
return 1;
}
int ED_operator_areaactive(bContext *C)
bool ED_operator_areaactive(bContext *C)
{
if (CTX_wm_window(C) == NULL) return 0;
if (CTX_wm_screen(C) == NULL) return 0;
@ -111,7 +111,7 @@ int ED_operator_areaactive(bContext *C)
return 1;
}
int ED_operator_screenactive(bContext *C)
bool ED_operator_screenactive(bContext *C)
{
if (CTX_wm_window(C) == NULL) return 0;
if (CTX_wm_screen(C) == NULL) return 0;
@ -119,7 +119,7 @@ int ED_operator_screenactive(bContext *C)
}
/* XXX added this to prevent anim state to change during renders */
static int ED_operator_screenactive_norender(bContext *C)
static bool ED_operator_screenactive_norender(bContext *C)
{
if (G.is_rendering) return 0;
if (CTX_wm_window(C) == NULL) return 0;
@ -128,7 +128,7 @@ static int ED_operator_screenactive_norender(bContext *C)
}
/* when mouse is over area-edge */
int ED_operator_screen_mainwinactive(bContext *C)
bool ED_operator_screen_mainwinactive(bContext *C)
{
bScreen *screen;
if (CTX_wm_window(C) == NULL) return 0;
@ -138,7 +138,7 @@ int ED_operator_screen_mainwinactive(bContext *C)
return 1;
}
int ED_operator_scene(bContext *C)
bool ED_operator_scene(bContext *C)
{
Scene *scene = CTX_data_scene(C);
if (scene)
@ -146,7 +146,7 @@ int ED_operator_scene(bContext *C)
return 0;
}
int ED_operator_scene_editable(bContext *C)
bool ED_operator_scene_editable(bContext *C)
{
Scene *scene = CTX_data_scene(C);
if (scene && !ID_IS_LINKED(scene))
@ -154,7 +154,7 @@ int ED_operator_scene_editable(bContext *C)
return 0;
}
int ED_operator_objectmode(bContext *C)
bool ED_operator_objectmode(bContext *C)
{
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
@ -181,12 +181,12 @@ static bool ed_spacetype_test(bContext *C, int type)
return 0;
}
int ED_operator_view3d_active(bContext *C)
bool ED_operator_view3d_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_VIEW3D);
}
int ED_operator_region_view3d_active(bContext *C)
bool ED_operator_region_view3d_active(bContext *C)
{
if (CTX_wm_region_view3d(C))
return true;
@ -196,7 +196,7 @@ int ED_operator_region_view3d_active(bContext *C)
}
/* generic for any view2d which uses anim_ops */
int ED_operator_animview_active(bContext *C)
bool ED_operator_animview_active(bContext *C)
{
if (ED_operator_areaactive(C)) {
SpaceLink *sl = (SpaceLink *)CTX_wm_space_data(C);
@ -208,17 +208,17 @@ int ED_operator_animview_active(bContext *C)
return 0;
}
int ED_operator_timeline_active(bContext *C)
bool ED_operator_timeline_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_TIME);
}
int ED_operator_outliner_active(bContext *C)
bool ED_operator_outliner_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_OUTLINER);
}
int ED_operator_outliner_active_no_editobject(bContext *C)
bool ED_operator_outliner_active_no_editobject(bContext *C)
{
if (ed_spacetype_test(C, SPACE_OUTLINER)) {
Object *ob = ED_object_active_context(C);
@ -231,22 +231,22 @@ int ED_operator_outliner_active_no_editobject(bContext *C)
return 0;
}
int ED_operator_file_active(bContext *C)
bool ED_operator_file_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_FILE);
}
int ED_operator_action_active(bContext *C)
bool ED_operator_action_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_ACTION);
}
int ED_operator_buttons_active(bContext *C)
bool ED_operator_buttons_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_BUTS);
}
int ED_operator_node_active(bContext *C)
bool ED_operator_node_active(bContext *C)
{
SpaceNode *snode = CTX_wm_space_node(C);
@ -256,7 +256,7 @@ int ED_operator_node_active(bContext *C)
return 0;
}
int ED_operator_node_editable(bContext *C)
bool ED_operator_node_editable(bContext *C)
{
SpaceNode *snode = CTX_wm_space_node(C);
@ -266,80 +266,80 @@ int ED_operator_node_editable(bContext *C)
return 0;
}
int ED_operator_graphedit_active(bContext *C)
bool ED_operator_graphedit_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_IPO);
}
int ED_operator_sequencer_active(bContext *C)
bool ED_operator_sequencer_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_SEQ);
}
int ED_operator_sequencer_active_editable(bContext *C)
bool ED_operator_sequencer_active_editable(bContext *C)
{
return ed_spacetype_test(C, SPACE_SEQ) && ED_operator_scene_editable(C);
}
int ED_operator_image_active(bContext *C)
bool ED_operator_image_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_IMAGE);
}
int ED_operator_nla_active(bContext *C)
bool ED_operator_nla_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_NLA);
}
int ED_operator_logic_active(bContext *C)
bool ED_operator_logic_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_LOGIC);
}
int ED_operator_info_active(bContext *C)
bool ED_operator_info_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_INFO);
}
int ED_operator_console_active(bContext *C)
bool ED_operator_console_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_CONSOLE);
}
static int ed_object_hidden(Object *ob)
static bool ed_object_hidden(Object *ob)
{
/* if hidden but in edit mode, we still display, can happen with animation */
return ((ob->restrictflag & OB_RESTRICT_VIEW) && !(ob->mode & OB_MODE_EDIT));
}
int ED_operator_object_active(bContext *C)
bool ED_operator_object_active(bContext *C)
{
Object *ob = ED_object_active_context(C);
return ((ob != NULL) && !ed_object_hidden(ob));
}
int ED_operator_object_active_editable(bContext *C)
bool ED_operator_object_active_editable(bContext *C)
{
Object *ob = ED_object_active_context(C);
return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob));
}
int ED_operator_object_active_editable_mesh(bContext *C)
bool ED_operator_object_active_editable_mesh(bContext *C)
{
Object *ob = ED_object_active_context(C);
return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob) &&
(ob->type == OB_MESH) && !ID_IS_LINKED(ob->data));
}
int ED_operator_object_active_editable_font(bContext *C)
bool ED_operator_object_active_editable_font(bContext *C)
{
Object *ob = ED_object_active_context(C);
return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob) &&
(ob->type == OB_FONT));
}
int ED_operator_editmesh(bContext *C)
bool ED_operator_editmesh(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_MESH)
@ -347,12 +347,12 @@ int ED_operator_editmesh(bContext *C)
return 0;
}
int ED_operator_editmesh_view3d(bContext *C)
bool ED_operator_editmesh_view3d(bContext *C)
{
return ED_operator_editmesh(C) && ED_operator_view3d_active(C);
}
int ED_operator_editmesh_region_view3d(bContext *C)
bool ED_operator_editmesh_region_view3d(bContext *C)
{
if (ED_operator_editmesh(C) && CTX_wm_region_view3d(C))
return 1;
@ -361,7 +361,7 @@ int ED_operator_editmesh_region_view3d(bContext *C)
return 0;
}
int ED_operator_editarmature(bContext *C)
bool ED_operator_editarmature(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_ARMATURE)
@ -376,7 +376,7 @@ int ED_operator_editarmature(bContext *C)
* when it comes to transforming bones, but managing bones layers/groups
* can be left for pose mode only. (not weight paint mode)
*/
int ED_operator_posemode_exclusive(bContext *C)
bool ED_operator_posemode_exclusive(bContext *C)
{
Object *obact = CTX_data_active_object(C);
@ -394,7 +394,7 @@ int ED_operator_posemode_exclusive(bContext *C)
/* allows for pinned pose objects to be used in the object buttons
* and the non-active pose object to be used in the 3D view */
int ED_operator_posemode_context(bContext *C)
bool ED_operator_posemode_context(bContext *C)
{
Object *obpose = ED_pose_object_from_context(C);
@ -407,7 +407,7 @@ int ED_operator_posemode_context(bContext *C)
return 0;
}
int ED_operator_posemode(bContext *C)
bool ED_operator_posemode(bContext *C)
{
Object *obact = CTX_data_active_object(C);
@ -423,7 +423,7 @@ int ED_operator_posemode(bContext *C)
return 0;
}
int ED_operator_posemode_local(bContext *C)
bool ED_operator_posemode_local(bContext *C)
{
if (ED_operator_posemode(C)) {
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
@ -435,21 +435,21 @@ int ED_operator_posemode_local(bContext *C)
}
/* wrapper for ED_space_image_show_uvedit */
int ED_operator_uvedit(bContext *C)
bool ED_operator_uvedit(bContext *C)
{
SpaceImage *sima = CTX_wm_space_image(C);
Object *obedit = CTX_data_edit_object(C);
return ED_space_image_show_uvedit(sima, obedit);
}
int ED_operator_uvedit_space_image(bContext *C)
bool ED_operator_uvedit_space_image(bContext *C)
{
SpaceImage *sima = CTX_wm_space_image(C);
Object *obedit = CTX_data_edit_object(C);
return sima && ED_space_image_show_uvedit(sima, obedit);
}
int ED_operator_uvmap(bContext *C)
bool ED_operator_uvmap(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = NULL;
@ -465,7 +465,7 @@ int ED_operator_uvmap(bContext *C)
return false;
}
int ED_operator_editsurfcurve(bContext *C)
bool ED_operator_editsurfcurve(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF))
@ -473,7 +473,7 @@ int ED_operator_editsurfcurve(bContext *C)
return 0;
}
int ED_operator_editsurfcurve_region_view3d(bContext *C)
bool ED_operator_editsurfcurve_region_view3d(bContext *C)
{
if (ED_operator_editsurfcurve(C) && CTX_wm_region_view3d(C))
return 1;
@ -482,7 +482,7 @@ int ED_operator_editsurfcurve_region_view3d(bContext *C)
return 0;
}
int ED_operator_editcurve(bContext *C)
bool ED_operator_editcurve(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_CURVE)
@ -490,7 +490,7 @@ int ED_operator_editcurve(bContext *C)
return 0;
}
int ED_operator_editcurve_3d(bContext *C)
bool ED_operator_editcurve_3d(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_CURVE) {
@ -501,7 +501,7 @@ int ED_operator_editcurve_3d(bContext *C)
return 0;
}
int ED_operator_editsurf(bContext *C)
bool ED_operator_editsurf(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_SURF)
@ -509,7 +509,7 @@ int ED_operator_editsurf(bContext *C)
return 0;
}
int ED_operator_editfont(bContext *C)
bool ED_operator_editfont(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_FONT)
@ -517,7 +517,7 @@ int ED_operator_editfont(bContext *C)
return 0;
}
int ED_operator_editlattice(bContext *C)
bool ED_operator_editlattice(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_LATTICE)
@ -525,7 +525,7 @@ int ED_operator_editlattice(bContext *C)
return 0;
}
int ED_operator_editmball(bContext *C)
bool ED_operator_editmball(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_MBALL)
@ -533,7 +533,7 @@ int ED_operator_editmball(bContext *C)
return 0;
}
int ED_operator_mask(bContext *C)
bool ED_operator_mask(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
if (sa && sa->spacedata.first) {
@ -567,7 +567,7 @@ int ED_operator_mask(bContext *C)
/** \name Internal Screen Utilities
* \{ */
static int screen_active_editable(bContext *C)
static bool screen_active_editable(bContext *C)
{
if (ED_operator_screenactive(C)) {
/* no full window splitting allowed */
@ -631,7 +631,7 @@ typedef struct sActionzoneData {
} sActionzoneData;
/* quick poll to save operators to be created and handled */
static int actionzone_area_poll(bContext *C)
static bool actionzone_area_poll(bContext *C)
{
wmWindow *win = CTX_wm_window(C);
ScrArea *sa = CTX_wm_area(C);
@ -4391,7 +4391,7 @@ static const EnumPropertyItem space_context_cycle_direction[] = {
{0, NULL, 0, NULL, NULL}
};
static int space_context_cycle_poll(bContext *C)
static bool space_context_cycle_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
/* sa might be NULL if called out of window bounds */
@ -4555,7 +4555,7 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
}
static int open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static bool open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
{
if (drag->type == WM_DRAG_PATH) {
if (drag->icon == ICON_FILE_BLEND)

@ -269,7 +269,7 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0');
}
static int screenshot_poll(bContext *C)
static bool screenshot_poll(bContext *C)
{
if (G.background)
return false;

@ -1103,7 +1103,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* Public API */
void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
void paint_cursor_start(bContext *C, bool (*poll)(bContext *C))
{
Paint *p = BKE_paint_get_active_from_context(C);
@ -1114,7 +1114,7 @@ void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
BKE_paint_invalidate_overlay_all();
}
void paint_cursor_start_explicit(Paint *p, wmWindowManager *wm, int (*poll)(bContext *C))
void paint_cursor_start_explicit(Paint *p, wmWindowManager *wm, bool (*poll)(bContext *C))
{
if (p && !p->paint_cursor)
p->paint_cursor = WM_paint_cursor_activate(wm, poll, paint_draw_cursor, NULL);

@ -55,7 +55,7 @@
#define PAINT_CURVE_SELECT_THRESHOLD 40.0f
#define PAINT_CURVE_POINT_SELECT(pcp, i) (*(&pcp->bez.f1 + i) = SELECT)
int paint_curve_poll(bContext *C)
bool paint_curve_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Paint *p;

@ -264,7 +264,7 @@ static Brush *image_paint_brush(bContext *C)
return BKE_paint_brush(&settings->imapaint.paint);
}
static int image_paint_poll(bContext *C)
static bool image_paint_poll(bContext *C)
{
Object *obact;
@ -290,7 +290,7 @@ static int image_paint_poll(bContext *C)
return 0;
}
static int image_paint_2d_clone_poll(bContext *C)
static bool image_paint_2d_clone_poll(bContext *C)
{
Brush *brush = image_paint_brush(C);
@ -976,7 +976,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
static int sample_color_poll(bContext *C)
static bool sample_color_poll(bContext *C)
{
return (image_paint_poll(C) || vertex_paint_poll(C));
}
@ -1009,7 +1009,7 @@ void PAINT_OT_sample_color(wmOperatorType *ot)
/******************** texture paint toggle operator ********************/
static int texture_paint_toggle_poll(bContext *C)
static bool texture_paint_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH)
@ -1145,7 +1145,7 @@ static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static int brush_colors_flip_poll(bContext *C)
static bool brush_colors_flip_poll(bContext *C)
{
if (image_paint_poll(C)) {
Brush *br = image_paint_brush(C);
@ -1195,7 +1195,7 @@ void ED_imapaint_bucket_fill(struct bContext *C, float color[3], wmOperator *op)
}
static int texture_paint_poll(bContext *C)
static bool texture_paint_poll(bContext *C)
{
if (texture_paint_toggle_poll(C))
if (CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
@ -1204,22 +1204,22 @@ static int texture_paint_poll(bContext *C)
return 0;
}
int image_texture_paint_poll(bContext *C)
bool image_texture_paint_poll(bContext *C)
{
return (texture_paint_poll(C) || image_paint_poll(C));
}
int facemask_paint_poll(bContext *C)
bool facemask_paint_poll(bContext *C)
{
return BKE_paint_select_face_test(CTX_data_active_object(C));
}
int vert_paint_poll(bContext *C)
bool vert_paint_poll(bContext *C)
{
return BKE_paint_select_vert_test(CTX_data_active_object(C));
}
int mask_paint_poll(bContext *C)
bool mask_paint_poll(bContext *C)
{
return BKE_paint_select_elem_test(CTX_data_active_object(C));
}

@ -5921,7 +5921,7 @@ static int add_simple_uvs_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static int add_simple_uvs_poll(bContext *C)
static bool add_simple_uvs_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);

@ -87,16 +87,16 @@ struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke);
void *paint_stroke_mode_data(struct PaintStroke *stroke);
float paint_stroke_distance_get(struct PaintStroke *stroke);
void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data);
int paint_poll(struct bContext *C);
void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C));
void paint_cursor_start_explicit(struct Paint *p, struct wmWindowManager *wm, int (*poll)(struct bContext *C));
bool paint_poll(struct bContext *C);
void paint_cursor_start(struct bContext *C, bool (*poll)(struct bContext *C));
void paint_cursor_start_explicit(struct Paint *p, struct wmWindowManager *wm, bool (*poll)(struct bContext *C));
void paint_cursor_delete_textures(void);
/* paint_vertex.c */
int weight_paint_poll(struct bContext *C);
int weight_paint_mode_poll(struct bContext *C);
int vertex_paint_poll(struct bContext *C);
int vertex_paint_mode_poll(struct bContext *C);
bool weight_paint_poll(struct bContext *C);
bool weight_paint_mode_poll(struct bContext *C);
bool vertex_paint_poll(struct bContext *C);
bool vertex_paint_mode_poll(struct bContext *C);
typedef void (*VPaintTransform_Callback)(const float col[3], const void *user_data, float r_col[3]);
@ -177,7 +177,7 @@ typedef struct ImagePaintPartialRedraw {
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
#define IMAPAINT_TILE_NUMBER(size) (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS)
int image_texture_paint_poll(struct bContext *C);
bool image_texture_paint_poll(struct bContext *C);
void imapaint_image_update(struct SpaceImage *sima, struct Image *image, struct ImBuf *ibuf, short texpaint);
struct ImagePaintPartialRedraw *get_imapaintpartial(void);
void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr);
@ -237,8 +237,8 @@ struct ListBase *ED_image_undosys_step_get_tiles(struct UndoStep *us_p);
struct ListBase *ED_image_undo_get_tiles(void);
/* sculpt_uv.c */
int uv_sculpt_poll(struct bContext *C);
int uv_sculpt_keymap_poll(struct bContext *C);
bool uv_sculpt_poll(struct bContext *C);
bool uv_sculpt_keymap_poll(struct bContext *C);
void SCULPT_OT_uv_sculpt_stroke(struct wmOperatorType *ot);
@ -282,11 +282,11 @@ void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
void PAINT_OT_vert_select_all(struct wmOperatorType *ot);
void PAINT_OT_vert_select_ungrouped(struct wmOperatorType *ot);
int vert_paint_poll(struct bContext *C);
int mask_paint_poll(struct bContext *C);
int paint_curve_poll(struct bContext *C);
bool vert_paint_poll(struct bContext *C);
bool mask_paint_poll(struct bContext *C);
bool paint_curve_poll(struct bContext *C);
int facemask_paint_poll(struct bContext *C);
bool facemask_paint_poll(struct bContext *C);
void flip_v3_v3(float out[3], const float in[3], const char symm);
void flip_qt_qt(float out[3], const float in[3], const char symm);

@ -183,7 +183,7 @@ static void PALETTE_OT_new(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int palette_poll(bContext *C)
static bool palette_poll(bContext *C)
{
Paint *paint = BKE_paint_get_active_from_context(C);
@ -778,7 +778,7 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
return OPERATOR_RUNNING_MODAL;
}
static int stencil_control_poll(bContext *C)
static bool stencil_control_poll(bContext *C)
{
ePaintMode mode = BKE_paintmode_get_active_from_context(C);

@ -1312,7 +1312,7 @@ void paint_stroke_set_mode_data(PaintStroke *stroke, void *mode_data)
stroke->mode_data = mode_data;
}
int paint_poll(bContext *C)
bool paint_poll(bContext *C)
{
Paint *p = BKE_paint_get_active_from_context(C);
Object *ob = CTX_data_active_object(C);

@ -571,7 +571,7 @@ static int brush_curve_preset_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
static int brush_curve_preset_poll(bContext *C)
static bool brush_curve_preset_poll(bContext *C)
{
Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C));

@ -197,14 +197,14 @@ static void paint_last_stroke_update(Scene *scene, ARegion *ar, const float mval
/* polling - retrieve whether cursor should be set or operator should be done */
/* Returns true if vertex paint mode is active */
int vertex_paint_mode_poll(bContext *C)
bool vertex_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode == OB_MODE_VERTEX_PAINT && ((Mesh *)ob->data)->totpoly;
}
int vertex_paint_poll(bContext *C)
bool vertex_paint_poll(bContext *C)
{
if (vertex_paint_mode_poll(C) &&
BKE_paint_brush(&CTX_data_tool_settings(C)->vpaint->paint))
@ -219,14 +219,14 @@ int vertex_paint_poll(bContext *C)
return 0;
}
int weight_paint_mode_poll(bContext *C)
bool weight_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode == OB_MODE_WEIGHT_PAINT && ((Mesh *)ob->data)->totpoly;
}
int weight_paint_poll(bContext *C)
bool weight_paint_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
ScrArea *sa;
@ -1232,7 +1232,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
}
/* for switching to/from mode */
static int paint_poll_test(bContext *C)
static bool paint_poll_test(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH)

@ -48,7 +48,7 @@
#include "paint_intern.h" /* own include */
static int vertex_weight_paint_mode_poll(bContext *C)
static bool vertex_weight_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Mesh *me = BKE_mesh_from_object(ob);

@ -115,7 +115,7 @@ static void wpaint_prev_destroy(struct WPaintPrev *wpp)
/** \name Weight from Bones Operator
* \{ */
static int weight_from_bones_poll(bContext *C)
static bool weight_from_bones_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);

@ -4079,25 +4079,25 @@ static void sculpt_update_tex(const Scene *scene, Sculpt *sd, SculptSession *ss)
int sculpt_mode_poll(bContext *C)
bool sculpt_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode & OB_MODE_SCULPT;
}
int sculpt_mode_poll_view3d(bContext *C)
bool sculpt_mode_poll_view3d(bContext *C)
{
return (sculpt_mode_poll(C) &&
CTX_wm_region_view3d(C));
}
int sculpt_poll_view3d(bContext *C)
bool sculpt_poll_view3d(bContext *C)
{
return (sculpt_poll(C) &&
CTX_wm_region_view3d(C));
}
int sculpt_poll(bContext *C)
bool sculpt_poll(bContext *C)
{
return sculpt_mode_poll(C) && paint_poll(C);
}
@ -5527,7 +5527,7 @@ static int sculpt_optimize_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
static int sculpt_and_dynamic_topology_poll(bContext *C)
static bool sculpt_and_dynamic_topology_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@ -5826,7 +5826,7 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
}
static int sculpt_and_dynamic_topology_constant_detail_poll(bContext *C)
static bool sculpt_and_dynamic_topology_constant_detail_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;

@ -48,11 +48,11 @@ struct Object;
struct SculptUndoNode;
struct SculptOrigVertData;
int sculpt_mode_poll(struct bContext *C);
int sculpt_mode_poll_view3d(struct bContext *C);
bool sculpt_mode_poll(struct bContext *C);
bool sculpt_mode_poll_view3d(struct bContext *C);
/* checks for a brush, not just sculpt mode */
int sculpt_poll(struct bContext *C);
int sculpt_poll_view3d(struct bContext *C);
bool sculpt_poll(struct bContext *C);
bool sculpt_poll_view3d(struct bContext *C);
/* Stroke */
bool sculpt_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]);

@ -158,7 +158,7 @@ static Brush *uv_sculpt_brush(bContext *C)
}
static int uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
static bool uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
{
BMEditMesh *em;
int ret;
@ -186,7 +186,7 @@ static int uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
return ret;
}
static int uv_sculpt_brush_poll(bContext *C)
static bool uv_sculpt_brush_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, true);
}
@ -246,8 +246,9 @@ void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *sc
BKE_paint_init(bmain, scene, ePaintSculptUV, PAINT_CURSOR_SCULPT);
settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
brush_drawcursor_uvsculpt, NULL);
settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(
wm, uv_sculpt_brush_poll,
brush_drawcursor_uvsculpt, NULL);
}
else {
if (settings->uvsculpt) {
@ -257,12 +258,12 @@ void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *sc
}
}
int uv_sculpt_poll(bContext *C)
bool uv_sculpt_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, true);
}
int uv_sculpt_keymap_poll(bContext *C)
bool uv_sculpt_keymap_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, false);
}

@ -702,7 +702,7 @@ static void SOUND_OT_mixdown(wmOperatorType *ot)
/* ******************************************************* */
static int sound_poll(bContext *C)
static bool sound_poll(bContext *C)
{
Editing *ed = CTX_data_scene(C)->ed;

@ -175,7 +175,7 @@ static void actedit_change_action(bContext *C, bAction *act)
* The NLA Editor is active (i.e. Animation Data panel -> new action)
* 2) The associated AnimData block must not be in tweakmode
*/
static int action_new_poll(bContext *C)
static bool action_new_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
@ -295,7 +295,7 @@ void ACTION_OT_new(wmOperatorType *ot)
* 2) There must be an action active
* 3) The associated AnimData block must not be in tweakmode
*/
static int action_pushdown_poll(bContext *C)
static bool action_pushdown_poll(bContext *C)
{
if (ED_operator_action_active(C)) {
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
@ -426,7 +426,7 @@ void ACTION_OT_stash(wmOperatorType *ot)
* 1) There must be an dopesheet/action editor, and it must be in a mode which uses actions
* 2) The associated AnimData block must not be in tweakmode
*/
static int action_stash_create_poll(bContext *C)
static bool action_stash_create_poll(bContext *C)
{
if (ED_operator_action_active(C)) {
AnimData *adt = ED_actedit_animdata_from_context(C);
@ -618,7 +618,7 @@ void ED_animedit_unlink_action(bContext *C, ID *id, AnimData *adt, bAction *act,
/* -------------------------- */
static int action_unlink_poll(bContext *C)
static bool action_unlink_poll(bContext *C)
{
if (ED_operator_action_active(C)) {
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
@ -749,7 +749,7 @@ static void action_layer_switch_strip(AnimData *adt,
/* ********************** One Layer Up Operator ************************** */
static int action_layer_next_poll(bContext *C)
static bool action_layer_next_poll(bContext *C)
{
/* Action Editor's action editing modes only */
if (ED_operator_action_active(C)) {
@ -860,7 +860,7 @@ void ACTION_OT_layer_next(wmOperatorType *ot)
/* ********************* One Layer Down Operator ************************* */
static int action_layer_prev_poll(bContext *C)
static bool action_layer_prev_poll(bContext *C)
{
/* Action Editor's action editing modes only */
if (ED_operator_action_active(C)) {

@ -93,7 +93,7 @@
* 3) that the set of markers being shown are the scene markers, not the list we're merging
* 4) that there are some selected markers
*/
static int act_markers_make_local_poll(bContext *C)
static bool act_markers_make_local_poll(bContext *C)
{
SpaceAction *sact = CTX_wm_space_action(C);
@ -1480,7 +1480,7 @@ void ACTION_OT_keyframe_type(wmOperatorType *ot)
/* ***************** Jump to Selected Frames Operator *********************** */
static int actkeys_framejump_poll(bContext *C)
static bool actkeys_framejump_poll(bContext *C)
{
/* prevent changes during render */
if (G.is_rendering)

@ -53,7 +53,7 @@
#include "clip_intern.h" // own include
static int space_clip_dopesheet_poll(bContext *C)
static bool space_clip_dopesheet_poll(bContext *C)
{
if (ED_space_clip_tracking_poll(C)) {
SpaceClip *sc = CTX_wm_space_clip(C);
@ -70,7 +70,7 @@ static int space_clip_dopesheet_poll(bContext *C)
/********************** select channel operator *********************/
static int dopesheet_select_channel_poll(bContext *C)
static bool dopesheet_select_channel_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);

@ -76,7 +76,7 @@
/* ******** operactor poll functions ******** */
int ED_space_clip_poll(bContext *C)
bool ED_space_clip_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
@ -86,7 +86,7 @@ int ED_space_clip_poll(bContext *C)
return false;
}
int ED_space_clip_view_clip_poll(bContext *C)
bool ED_space_clip_view_clip_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
@ -97,7 +97,7 @@ int ED_space_clip_view_clip_poll(bContext *C)
return false;
}
int ED_space_clip_tracking_poll(bContext *C)
bool ED_space_clip_tracking_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
@ -107,7 +107,7 @@ int ED_space_clip_tracking_poll(bContext *C)
return false;
}
int ED_space_clip_maskedit_poll(bContext *C)
bool ED_space_clip_maskedit_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
@ -118,7 +118,7 @@ int ED_space_clip_maskedit_poll(bContext *C)
return false;
}
int ED_space_clip_maskedit_mask_poll(bContext *C)
bool ED_space_clip_maskedit_mask_poll(bContext *C)
{
if (ED_space_clip_maskedit_poll(C)) {
MovieClip *clip = CTX_data_edit_movieclip(C);

@ -54,7 +54,7 @@
/******************** common graph-editing utilities ********************/
static int ED_space_clip_graph_poll(bContext *C)
static bool ED_space_clip_graph_poll(bContext *C)
{
if (ED_space_clip_tracking_poll(C)) {
SpaceClip *sc = CTX_wm_space_clip(C);
@ -65,7 +65,7 @@ static int ED_space_clip_graph_poll(bContext *C)
return false;
}
static int clip_graph_knots_poll(bContext *C)
static bool clip_graph_knots_poll(bContext *C)
{
if (ED_space_clip_graph_poll(C)) {
SpaceClip *sc = CTX_wm_space_clip(C);

@ -898,7 +898,7 @@ void CLIP_OT_view_selected(wmOperatorType *ot)
/********************** change frame operator *********************/
static int change_frame_poll(bContext *C)
static bool change_frame_poll(bContext *C)
{
/* prevent changes during render */
if (G.is_rendering)

@ -86,7 +86,7 @@ ARegion *ED_clip_has_properties_region(ScrArea *sa)
return arnew;
}
static int properties_poll(bContext *C)
static bool properties_poll(bContext *C)
{
return (CTX_wm_space_clip(C) != NULL);
}
@ -161,7 +161,7 @@ static ARegion *clip_has_tools_region(ScrArea *sa)
return artool;
}
static int tools_poll(bContext *C)
static bool tools_poll(bContext *C)
{
return (CTX_wm_space_clip(C) != NULL);
}

@ -848,7 +848,7 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul
}
/* dropboxes */
static int clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
{
if (drag->type == WM_DRAG_PATH)
if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */

@ -2106,7 +2106,7 @@ void CLIP_OT_copy_tracks(wmOperatorType *ot)
/********************* paste tracks from clipboard operator ********************/
static int paste_tracks_poll(bContext *C)
static bool paste_tracks_poll(bContext *C)
{
if (ED_space_clip_tracking_poll(C)) {
return BKE_tracking_clipboard_has_tracks();

@ -106,7 +106,7 @@ static Object *get_orientation_object(bContext *C)
return object;
}
static int set_orientation_poll(bContext *C)
static bool set_orientation_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
if (sc != NULL) {
@ -746,7 +746,7 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
/********************** set solution scale operator *********************/
static int set_solution_scale_poll(bContext *C)
static bool set_solution_scale_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
if (sc != NULL) {
@ -806,7 +806,7 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot)
/********************** apply solution scale operator *********************/
static int apply_solution_scale_poll(bContext *C)
static bool apply_solution_scale_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
if (sc != NULL) {

@ -49,7 +49,7 @@
/********************* add 2d stabilization tracks operator ********************/
static int stabilize_2d_poll(bContext *C)
static bool stabilize_2d_poll(bContext *C)
{
if (ED_space_clip_tracking_poll(C)) {
SpaceClip *sc = CTX_wm_space_clip(C);

@ -350,7 +350,7 @@ static int mouse_select(bContext *C, float co[2], int extend)
return OPERATOR_FINISHED;
}
static int select_poll(bContext *C)
static bool select_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);

@ -169,7 +169,7 @@ static void console_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
/* ************* dropboxes ************* */
static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static bool id_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
{
// SpaceConsole *sc = CTX_wm_space_console(C);
if (drag->type == WM_DRAG_ID)
@ -188,7 +188,7 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
MEM_freeN(text);
}
static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static bool path_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
{
// SpaceConsole *sc = CTX_wm_space_console(C);
if (drag->type == WM_DRAG_PATH)

Some files were not shown because too many files have changed in this diff Show More