From ef4aa42ea4ffa1bf7f5ad7f8e7f7b6acf9e3c3e6 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 2 Nov 2020 18:32:12 +0100 Subject: [PATCH] UI: Enable writing global area data (top-bar, status-bar) to .blend's There should not be much user visible here (other than T73668 being addressed). I added the writing code already for the initial implementation of workspaces, but we decided to keep it disabled until the top-bar design is more clear. It was never planned to keep this disabled for so long. Fixes T73668. --- source/blender/blenkernel/intern/screen.c | 4 ---- source/blender/blenloader/intern/writefile.c | 10 ---------- source/blender/makesdna/DNA_screen_types.h | 4 ---- source/blender/makesdna/DNA_space_types.h | 12 ------------ 4 files changed, 30 deletions(-) diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index a357b5d98fb..17ea19bd824 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -1368,14 +1368,12 @@ static void write_area_regions(BlendWriter *writer, ScrArea *area) } BLO_write_struct(writer, SpaceConsole, sl); } -#ifdef WITH_GLOBAL_AREA_WRITING else if (sl->spacetype == SPACE_TOPBAR) { BLO_write_struct(writer, SpaceTopBar, sl); } else if (sl->spacetype == SPACE_STATUSBAR) { BLO_write_struct(writer, SpaceStatusBar, sl); } -#endif else if (sl->spacetype == SPACE_USERPREF) { BLO_write_struct(writer, SpaceUserPref, sl); } @@ -1397,9 +1395,7 @@ void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map) BLO_write_struct(writer, ScrArea, area); -#ifdef WITH_GLOBAL_AREA_WRITING BLO_write_struct(writer, ScrGlobalAreaData, area->global); -#endif write_area_regions(writer, area); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 95cfeef4243..e4995c991e1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1639,12 +1639,6 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const write_wm_xr_data(writer, &wm->xr); LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { -#ifndef WITH_GLOBAL_AREA_WRITING - /* Don't write global areas yet, while we make changes to them. */ - ScrAreaMap global_areas = win->global_areas; - memset(&win->global_areas, 0, sizeof(win->global_areas)); -#endif - /* update deprecated screen member (for so loading in 2.7x uses the correct screen) */ win->screen = BKE_workspace_active_screen_get(win->workspace_hook); @@ -1652,11 +1646,7 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook); BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format); -#ifdef WITH_GLOBAL_AREA_WRITING BKE_screen_area_map_blend_write(writer, &win->global_areas); -#else - win->global_areas = global_areas; -#endif /* data is written, clear deprecated data again */ win->screen = NULL; diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index d2360d700d2..bf57dd9ab77 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -322,10 +322,6 @@ typedef struct uiPreview { char _pad1[6]; } uiPreview; -/* These two lines with # tell makesdna this struct can be excluded. - * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */ -# -# typedef struct ScrGlobalAreaData { /* Global areas have a non-dynamic size. That means, changing the window * size doesn't affect their size at all. However, they can still be diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 7785c700e1c..8eb52bb776b 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -59,10 +59,6 @@ struct wmTimer; /* Defined in `buttons_intern.h`. */ typedef struct SpaceProperties_Runtime SpaceProperties_Runtime; -/* TODO 2.8: We don't write the global areas to files currently. Uncomment - * define to enable writing (should become the default in a bit). */ -//#define WITH_GLOBAL_AREA_WRITING - /* -------------------------------------------------------------------- */ /** \name SpaceLink (Base) * \{ */ @@ -1672,10 +1668,6 @@ typedef enum eSpaceClip_GPencil_Source { /** \name Top Bar * \{ */ -/* These two lines with # tell makesdna this struct can be excluded. - * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */ -# -# typedef struct SpaceTopBar { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */ @@ -1692,10 +1684,6 @@ typedef struct SpaceTopBar { /** \name Status Bar * \{ */ -/* These two lines with # tell makesdna this struct can be excluded. - * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */ -# -# typedef struct SpaceStatusBar { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */