Anim Editors: Refactored animchannel type definition callbacks to use bools
Changes: - acf.name_prop() and acf.has_setting() now return bools instead of shorts - Renamed a few name_prop() callbacks whose names ended in "_nameprop" instead of "_name_prop", which made it difficult to safely find all such instances
This commit is contained in:
parent
58ec292fd8
commit
ff66f3d3ad
|
@ -342,7 +342,7 @@ static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for ID block entries */
|
||||
static short acf_generic_idblock_nameprop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_generic_idblock_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
RNA_id_pointer_create(ale->id, ptr);
|
||||
*prop = RNA_struct_name_property(ptr->type);
|
||||
|
@ -352,7 +352,7 @@ static short acf_generic_idblock_nameprop(bAnimListElem *ale, PointerRNA *ptr, P
|
|||
|
||||
|
||||
/* name property for ID block entries which are just subheading "fillers" */
|
||||
static short acf_generic_idfill_nameprop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
/* actual ID we're representing is stored in ale->data not ale->id, as id gives the owner */
|
||||
RNA_id_pointer_create(ale->data, ptr);
|
||||
|
@ -365,19 +365,19 @@ static short acf_generic_idfill_nameprop(bAnimListElem *ale, PointerRNA *ptr, Pr
|
|||
|
||||
#if 0
|
||||
/* channel type has no settings */
|
||||
static short acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* check if some setting exists for this object-based data-expander (datablock only) */
|
||||
static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* expand is always supported */
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
/* mute is only supported for NLA */
|
||||
case ACHANNEL_SETTING_MUTE:
|
||||
|
@ -385,11 +385,11 @@ static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListEle
|
|||
|
||||
/* select is ok for most "ds*" channels (e.g. dsmat) */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
/* other flags are never supported */
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ static int acf_summary_icon(bAnimListElem *UNUSED(ale))
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
/* only expanded is supported, as it is used for hiding all stuff which the summary covers */
|
||||
return (setting == ACHANNEL_SETTING_EXPAND);
|
||||
|
@ -509,7 +509,7 @@ static int acf_scene_icon(bAnimListElem *UNUSED(ale))
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* muted only in NLA */
|
||||
|
@ -523,10 +523,10 @@ static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale
|
|||
/* only select and expand supported otherwise */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,7 +593,7 @@ static bAnimChannelType ACF_SCENE =
|
|||
NULL, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_scene_icon, /* icon */
|
||||
|
||||
acf_scene_setting_valid, /* has setting */
|
||||
|
@ -649,7 +649,7 @@ static void acf_object_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
static bool acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
{
|
||||
Base *base = (Base *)ale->data;
|
||||
Object *ob = base->object;
|
||||
|
@ -666,10 +666,10 @@ static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int
|
|||
/* only select and expand supported otherwise */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -737,7 +737,7 @@ static bAnimChannelType ACF_OBJECT =
|
|||
NULL, /* offset */
|
||||
|
||||
acf_object_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_object_icon, /* icon */
|
||||
|
||||
acf_object_setting_valid, /* has setting */
|
||||
|
@ -803,7 +803,7 @@ static void acf_group_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for group entries */
|
||||
static short acf_group_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_group_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
RNA_pointer_create(ale->id, &RNA_ActionGroup, ale->data, ptr);
|
||||
*prop = RNA_struct_name_property(ptr->type);
|
||||
|
@ -812,20 +812,20 @@ static short acf_group_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRN
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
/* for now, all settings are supported, though some are only conditionally */
|
||||
switch (setting) {
|
||||
/* unsupported */
|
||||
case ACHANNEL_SETTING_SOLO: /* Only available in NLA Editor for tracks */
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* conditionally supported */
|
||||
case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
|
||||
return (ac->spacetype == SPACE_IPO);
|
||||
|
||||
default: /* always supported */
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -903,7 +903,7 @@ static void acf_fcurve_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* "name" property for fcurve entries */
|
||||
static short acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
|
||||
|
@ -924,7 +924,7 @@ static short acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyR
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
static bool acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
|
||||
|
@ -932,21 +932,21 @@ static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int
|
|||
/* unsupported */
|
||||
case ACHANNEL_SETTING_SOLO: /* Solo Flag is only for NLA */
|
||||
case ACHANNEL_SETTING_EXPAND: /* F-Curves are not containers */
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* conditionally available */
|
||||
case ACHANNEL_SETTING_PROTECT: /* Protection is only valid when there's keyframes */
|
||||
if (fcu->bezt)
|
||||
return 1;
|
||||
return true;
|
||||
else
|
||||
return 0; // NOTE: in this special case, we need to draw ICON_ZOOMOUT
|
||||
return false; // NOTE: in this special case, we need to draw ICON_ZOOMOUT
|
||||
|
||||
case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
|
||||
return (ac->spacetype == SPACE_IPO);
|
||||
|
||||
/* always available */
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1012,16 +1012,16 @@ static int acf_fillactd_icon(bAnimListElem *UNUSED(ale))
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* only select and expand supported */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ static bAnimChannelType ACF_FILLACTD =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_fillactd_icon, /* icon */
|
||||
|
||||
acf_fillactd_setting_valid, /* has setting */
|
||||
|
@ -1102,15 +1102,15 @@ static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name)
|
|||
|
||||
/* check if some setting exists for this channel */
|
||||
// TODO: this could be made more generic
|
||||
static short acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* only expand supported */
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1235,7 +1235,7 @@ static bAnimChannelType ACF_DSMAT =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsmat_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1311,7 +1311,7 @@ static bAnimChannelType ACF_DSLAM =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dslam_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1394,7 +1394,7 @@ static bAnimChannelType ACF_DSTEX =
|
|||
acf_dstex_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_dstex_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1470,7 +1470,7 @@ static bAnimChannelType ACF_DSCAM =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_dscam_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1556,7 +1556,7 @@ static bAnimChannelType ACF_DSCUR =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dscur_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1632,7 +1632,7 @@ static bAnimChannelType ACF_DSSKEY =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsskey_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1708,7 +1708,7 @@ static bAnimChannelType ACF_DSWOR =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_dswor_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1784,7 +1784,7 @@ static bAnimChannelType ACF_DSPART =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dspart_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1860,7 +1860,7 @@ static bAnimChannelType ACF_DSMBALL =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsmball_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -1936,7 +1936,7 @@ static bAnimChannelType ACF_DSARM =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsarm_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2023,7 +2023,7 @@ static bAnimChannelType ACF_DSNTREE =
|
|||
acf_dsntree_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsntree_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2099,7 +2099,7 @@ static bAnimChannelType ACF_DSLINESTYLE =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dslinestyle_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2175,7 +2175,7 @@ static bAnimChannelType ACF_DSMESH =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsmesh_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2251,7 +2251,7 @@ static bAnimChannelType ACF_DSLAT =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dslat_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2327,7 +2327,7 @@ static bAnimChannelType ACF_DSSPK =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idblock_nameprop, /* name prop */
|
||||
acf_generic_idblock_name_prop, /* name prop */
|
||||
acf_dsspk_icon, /* icon */
|
||||
|
||||
acf_generic_dataexpand_setting_valid, /* has setting */
|
||||
|
@ -2353,7 +2353,7 @@ static void acf_shapekey_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for ShapeKey entries */
|
||||
static short acf_shapekey_nameprop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_shapekey_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
|
||||
|
@ -2365,21 +2365,21 @@ static short acf_shapekey_nameprop(bAnimListElem *ale, PointerRNA *ptr, Property
|
|||
return (*prop != NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_shapekey_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_shapekey_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
case ACHANNEL_SETTING_SELECT: /* selected */
|
||||
case ACHANNEL_SETTING_MUTE: /* muted */
|
||||
case ACHANNEL_SETTING_PROTECT: /* protected */
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
/* nothing else is supported */
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2434,7 +2434,7 @@ static bAnimChannelType ACF_SHAPEKEY =
|
|||
acf_generic_basic_offset, /* offset */
|
||||
|
||||
acf_shapekey_name, /* name */
|
||||
acf_shapekey_nameprop, /* name prop */
|
||||
acf_shapekey_name_prop, /* name prop */
|
||||
NULL, /* icon */
|
||||
|
||||
acf_shapekey_setting_valid, /* has setting */
|
||||
|
@ -2458,16 +2458,16 @@ static int acf_gpd_icon(bAnimListElem *UNUSED(ale))
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_gpd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_gpd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* only select and expand supported */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2509,7 +2509,7 @@ static bAnimChannelType ACF_GPD =
|
|||
acf_generic_group_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_gpd_icon, /* icon */
|
||||
|
||||
acf_gpd_setting_valid, /* has setting */
|
||||
|
@ -2529,7 +2529,7 @@ static void acf_gpl_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for grease pencil layer entries */
|
||||
static short acf_gpl_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_gpl_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, ptr);
|
||||
|
@ -2538,22 +2538,22 @@ static short acf_gpl_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA
|
|||
return (*prop != NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_gpl_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_gpl_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* unsupported */
|
||||
case ACHANNEL_SETTING_EXPAND: /* gpencil layers are more like F-Curves than groups */
|
||||
case ACHANNEL_SETTING_VISIBLE: /* graph editor only */
|
||||
case ACHANNEL_SETTING_SOLO: /* nla editor only */
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* always available */
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2624,16 +2624,16 @@ static int acf_mask_icon(bAnimListElem *UNUSED(ale))
|
|||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_mask_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_mask_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* only select and expand supported */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_EXPAND:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2675,7 +2675,7 @@ static bAnimChannelType ACF_MASKDATA =
|
|||
acf_generic_group_offset, /* offset */
|
||||
|
||||
acf_generic_idblock_name, /* name */
|
||||
acf_generic_idfill_nameprop, /* name prop */
|
||||
acf_generic_idfill_name_prop, /* name prop */
|
||||
acf_mask_icon, /* icon */
|
||||
|
||||
acf_mask_setting_valid, /* has setting */
|
||||
|
@ -2695,7 +2695,7 @@ static void acf_masklay_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for grease pencil layer entries */
|
||||
static short acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_MaskLayer, ale->data, ptr);
|
||||
|
@ -2704,22 +2704,22 @@ static short acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *ptr, Property
|
|||
return (*prop != NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_masklay_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
static bool acf_masklay_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting)
|
||||
{
|
||||
switch (setting) {
|
||||
/* unsupported */
|
||||
case ACHANNEL_SETTING_EXPAND: /* mask layers are more like F-Curves than groups */
|
||||
case ACHANNEL_SETTING_VISIBLE: /* graph editor only */
|
||||
case ACHANNEL_SETTING_SOLO: /* nla editor only */
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* always available */
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2804,7 +2804,7 @@ static void acf_nlatrack_name(bAnimListElem *ale, char *name)
|
|||
}
|
||||
|
||||
/* name property for nla track entries */
|
||||
static short acf_nlatrack_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
static bool acf_nlatrack_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_NlaTrack, ale->data, ptr);
|
||||
|
@ -2813,11 +2813,11 @@ static short acf_nlatrack_name_prop(bAnimListElem *ale, PointerRNA *ptr, Propert
|
|||
return (*prop != NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if some setting exists for this channel */
|
||||
static short acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *ale, int setting)
|
||||
static bool acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *ale, int setting)
|
||||
{
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
AnimData *adt = ale->adt;
|
||||
|
@ -2827,7 +2827,7 @@ static short acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem
|
|||
/* always supported */
|
||||
case ACHANNEL_SETTING_SELECT:
|
||||
case ACHANNEL_SETTING_SOLO:
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
/* conditionally supported... */
|
||||
case ACHANNEL_SETTING_PROTECT:
|
||||
|
@ -2838,26 +2838,26 @@ static short acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem
|
|||
if ((adt) && (adt->flag & ADT_NLA_SOLO_TRACK)) {
|
||||
if (nlt->flag & NLATRACK_SOLO) {
|
||||
/* ok - we've got a solo track, and this is it */
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
/* not ok - we've got a solo track, but this isn't it, so make it more obvious */
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ok - no tracks are solo'd, and this isn't being tweaked */
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
/* unsupported - this track is being tweaked */
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* unsupported */
|
||||
default:
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -396,13 +396,13 @@ typedef struct bAnimChannelType {
|
|||
/* get name (for channel lists) */
|
||||
void (*name)(bAnimListElem *ale, char *name);
|
||||
/* get RNA property+pointer for editing the name */
|
||||
short (*name_prop)(bAnimListElem *ale, struct PointerRNA *ptr, struct PropertyRNA **prop);
|
||||
bool (*name_prop)(bAnimListElem *ale, struct PointerRNA *ptr, struct PropertyRNA **prop);
|
||||
/* get icon (for channel lists) */
|
||||
int (*icon)(bAnimListElem *ale);
|
||||
|
||||
/* settings */
|
||||
/* check if the given setting is valid in the current context */
|
||||
short (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting);
|
||||
bool (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting);
|
||||
/* get the flag used for this setting */
|
||||
int (*setting_flag)(bAnimContext *ac, int setting, short *neg);
|
||||
/* get the pointer to int/short where data is stored,
|
||||
|
|
Loading…
Reference in New Issue