diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-08 01:29:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-08 01:50:00 +0300 |
commit | 8f817de0cbef41dac81e6c7665ada509c3fe2988 (patch) | |
tree | 0802c3287116ce0bf600adc4bed8cba31cfc97b1 /source/blender/editors/screen | |
parent | e68ac2827dd4f8ad346011a8a408b342e2718707 (diff) |
Cleanup: use plural names for Main lists
Convention was not to but after discussion on 918941483f7e 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.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 14 |
3 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 8bf1ca1a6c8..7556a44da1a 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -470,7 +470,7 @@ void ED_screens_initialize(Main *bmain, wmWindowManager *wm) for (win = wm->windows.first; win; win = win->next) { if (BKE_workspace_active_get(win->workspace_hook) == NULL) { - BKE_workspace_active_set(win->workspace_hook, bmain->workspace.first); + BKE_workspace_active_set(win->workspace_hook, bmain->workspaces.first); } ED_screen_refresh(wm, win); @@ -480,7 +480,7 @@ void ED_screens_initialize(Main *bmain, wmWindowManager *wm) } if (U.uiflag & USER_HEADER_FROM_PREF) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { BKE_screen_header_alignment_reset(screen); } } @@ -862,7 +862,7 @@ void ED_screen_global_areas_refresh(wmWindow *win) static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmain, bScreen *screen) { - for (bScreen *screen_iter = bmain->screen.first; screen_iter; screen_iter = screen_iter->id.next) { + for (bScreen *screen_iter = bmain->screens.first; screen_iter; screen_iter = screen_iter->id.next) { ScrArea *sa = screen_iter->areabase.first; if (sa && sa->full == screen) { return screen_iter; @@ -879,7 +879,7 @@ static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmai bScreen *screen_change_prepare(bScreen *screen_old, bScreen *screen_new, Main *bmain, bContext *C, wmWindow *win) { /* validate screen, it's called with notifier reference */ - if (BLI_findindex(&bmain->screen, screen_new) == -1) { + if (BLI_findindex(&bmain->screens, screen_new) == -1) { return NULL; } @@ -1405,7 +1405,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) bScreen *sc; scene->camera = camera; /* are there cameras in the views that are not in the scene? */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { BKE_screen_view3d_scene_sync(sc, scene); } DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); @@ -1424,7 +1424,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) /* update animated texture nodes */ { Tex *tex; - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->use_nodes && tex->nodetree) { ntreeTexTagAnimated(tex->nodetree); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 83004da0ce9..15e8d5a3eb4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3353,7 +3353,7 @@ static int spacedata_cleanup_exec(bContext *C, wmOperator *op) ScrArea *sa; int tot = 0; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { if (sa->spacedata.first != sa->spacedata.last) { SpaceLink *sl = sa->spacedata.first; @@ -4913,7 +4913,7 @@ static int space_workspace_cycle_invoke(bContext *C, wmOperator *op, const wmEve WorkSpace *workspace_dst = NULL; ListBase ordered; - BKE_id_ordered_list(&ordered, &bmain->workspace); + BKE_id_ordered_list(&ordered, &bmain->workspaces); for (LinkData *link = ordered.first; link; link = link->next) { if (link->data == workspace_src) { diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 9f63bdff7c1..b442f718aa1 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -223,7 +223,7 @@ bool ED_workspace_delete( { ID *workspace_id = (ID *)workspace; - if (BLI_listbase_is_single(&bmain->workspace)) { + if (BLI_listbase_is_single(&bmain->workspaces)) { return false; } @@ -355,11 +355,11 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", filepath); if (workspace_append(C, filepath, idname) != OPERATOR_CANCELLED) { - WorkSpace *appended_workspace = BLI_findstring(&bmain->workspace, idname, offsetof(ID, name) + 2); + WorkSpace *appended_workspace = BLI_findstring(&bmain->workspaces, idname, offsetof(ID, name) + 2); BLI_assert(appended_workspace != NULL); /* Reorder to last position. */ - BKE_id_reorder(&bmain->workspace, &appended_workspace->id, NULL, true); + BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); /* Changing workspace changes context. Do delayed! */ WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); @@ -454,7 +454,7 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) if (startup_config) { for (WorkSpace *workspace = startup_config->workspaces.first; workspace; workspace = workspace->id.next) { uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspace, workspace->id.name, offsetof(ID, name))) { + if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { uiLayoutSetActive(row, false); } @@ -479,7 +479,7 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) } uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspace, workspace->id.name, offsetof(ID, name))) { + if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { uiLayoutSetActive(row, false); } @@ -542,7 +542,7 @@ static int workspace_reorder_to_back_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); - BKE_id_reorder(&bmain->workspace, &workspace->id, NULL, true); + BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, true); WM_event_add_notifier(C, NC_WINDOW, NULL); return OPERATOR_INTERFACE; @@ -565,7 +565,7 @@ static int workspace_reorder_to_front_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); - BKE_id_reorder(&bmain->workspace, &workspace->id, NULL, false); + BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, false); WM_event_add_notifier(C, NC_WINDOW, NULL); return OPERATOR_INTERFACE; |