Cleanup: use plural names for Main lists

Convention was not to but after discussion on 918941483f we agree its
best to change the convention.

Names now mostly follow RNA.

Some exceptions:

- Use 'nodetrees' instead of 'nodegroups'
  since the struct is called NodeTree.
- Use 'gpencils' instead of 'grease_pencil'
  since 'gpencil' is a common abbreviation in the C code.

Other exceptions:

- Leave 'wm' as it's a list of one.
- Leave 'ipo' as is for versioning.
This commit is contained in:
2019-03-08 09:29:17 +11:00
parent e68ac2827d
commit 8f817de0cb
130 changed files with 1264 additions and 1264 deletions

View File

@@ -792,7 +792,7 @@ void WM_gizmomaptype_group_init_runtime(
}
/* now create a gizmo for all existing areas */
for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
@@ -837,7 +837,7 @@ void WM_gizmomaptype_group_unlink(
const wmGizmoGroupType *gzgt)
{
/* Free instances. */
for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;

View File

@@ -1266,7 +1266,7 @@ void WM_gizmoconfig_update(struct Main *bmain)
void WM_reinit_gizmomap_all(Main *bmain)
{
for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;

View File

@@ -136,7 +136,7 @@ static void gizmotype_unlink(
bContext *C, Main *bmain, wmGizmoType *gzt)
{
/* Free instances. */
for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;

View File

@@ -274,7 +274,7 @@ void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id)
Main *bmain = G_MAIN;
bScreen *sc;
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
ScrArea *sa;
for (sa = sc->areabase.first; sa; sa = sa->next) {

View File

@@ -447,7 +447,7 @@ void wm_file_read_report(bContext *C, Main *bmain)
ReportList *reports = NULL;
Scene *sce;
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
if (sce->r.engine[0] &&
BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL)
{
@@ -1266,7 +1266,7 @@ static bool wm_file_write(bContext *C, const char *filepath, int fileflags, Repo
* its handy for scripts to save to a predefined name without blender editing it */
/* send the OnSave event */
for (li = bmain->library.first; li; li = li->id.next) {
for (li = bmain->libraries.first; li; li = li->id.next) {
if (BLI_path_cmp(li->filepath, filepath) == 0) {
BKE_reportf(reports, RPT_ERROR, "Cannot overwrite used library '%.240s'", filepath);
return ok;

View File

@@ -2984,7 +2984,7 @@ static int previews_id_ensure_callback(void *userdata, ID *UNUSED(self_id), ID *
static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
ListBase *lb[] = {&bmain->mat, &bmain->tex, &bmain->image, &bmain->world, &bmain->light, NULL};
ListBase *lb[] = {&bmain->materials, &bmain->textures, &bmain->images, &bmain->worlds, &bmain->lights, NULL};
PreviewsIDEnsureData preview_id_data;
Scene *scene;
ID *id;
@@ -2997,7 +2997,7 @@ static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op))
}
preview_id_data.C = C;
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
preview_id_data.scene = scene;
id = (ID *)scene;
@@ -3049,8 +3049,8 @@ static const EnumPropertyItem preview_id_type_items[] = {
static int previews_clear_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
ListBase *lb[] = {&bmain->object, &bmain->collection,
&bmain->mat, &bmain->world, &bmain->light, &bmain->tex, &bmain->image, NULL};
ListBase *lb[] = {&bmain->objects, &bmain->collections,
&bmain->materials, &bmain->worlds, &bmain->lights, &bmain->textures, &bmain->images, NULL};
int i;
const int id_filters = RNA_enum_get(op->ptr, "id_type");
@@ -3390,7 +3390,7 @@ static const EnumPropertyItem *rna_id_itemf(
/* can add more as needed */
const EnumPropertyItem *RNA_action_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->action.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->actions.first : NULL, false, NULL, NULL);
}
#if 0 /* UNUSED */
const EnumPropertyItem *RNA_action_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
@@ -3401,51 +3401,51 @@ const EnumPropertyItem *RNA_action_local_itemf(bContext *C, PointerRNA *ptr, Pro
const EnumPropertyItem *RNA_collection_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collection.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collections.first : NULL, false, NULL, NULL);
}
const EnumPropertyItem *RNA_collection_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collection.first : NULL, true, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collections.first : NULL, true, NULL, NULL);
}
const EnumPropertyItem *RNA_image_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->image.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->images.first : NULL, false, NULL, NULL);
}
const EnumPropertyItem *RNA_image_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->image.first : NULL, true, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->images.first : NULL, true, NULL, NULL);
}
const EnumPropertyItem *RNA_scene_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, false, NULL, NULL);
}
const EnumPropertyItem *RNA_scene_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, true, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, true, NULL, NULL);
}
const EnumPropertyItem *RNA_scene_without_active_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
Scene *scene_active = C ? CTX_data_scene(C) : NULL;
return rna_id_itemf(
C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, true,
C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, true,
rna_id_enum_filter_single, scene_active);
}
const EnumPropertyItem *RNA_movieclip_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclips.first : NULL, false, NULL, NULL);
}
const EnumPropertyItem *RNA_movieclip_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, true, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclips.first : NULL, true, NULL, NULL);
}
const EnumPropertyItem *RNA_mask_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->mask.first : NULL, false, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->masks.first : NULL, false, NULL, NULL);
}
const EnumPropertyItem *RNA_mask_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->mask.first : NULL, true, NULL, NULL);
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->masks.first : NULL, true, NULL, NULL);
}

View File

@@ -546,7 +546,7 @@ void WM_toolsystem_init(bContext *C)
BLI_assert(CTX_wm_window(C) == NULL);
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspace) {
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) {
MEM_SAFE_FREE(tref->runtime);
}