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.
This commit is contained in:
@@ -1368,14 +1368,12 @@ static void write_area_regions(BlendWriter *writer, ScrArea *area)
|
|||||||
}
|
}
|
||||||
BLO_write_struct(writer, SpaceConsole, sl);
|
BLO_write_struct(writer, SpaceConsole, sl);
|
||||||
}
|
}
|
||||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
|
||||||
else if (sl->spacetype == SPACE_TOPBAR) {
|
else if (sl->spacetype == SPACE_TOPBAR) {
|
||||||
BLO_write_struct(writer, SpaceTopBar, sl);
|
BLO_write_struct(writer, SpaceTopBar, sl);
|
||||||
}
|
}
|
||||||
else if (sl->spacetype == SPACE_STATUSBAR) {
|
else if (sl->spacetype == SPACE_STATUSBAR) {
|
||||||
BLO_write_struct(writer, SpaceStatusBar, sl);
|
BLO_write_struct(writer, SpaceStatusBar, sl);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (sl->spacetype == SPACE_USERPREF) {
|
else if (sl->spacetype == SPACE_USERPREF) {
|
||||||
BLO_write_struct(writer, SpaceUserPref, sl);
|
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);
|
BLO_write_struct(writer, ScrArea, area);
|
||||||
|
|
||||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
|
||||||
BLO_write_struct(writer, ScrGlobalAreaData, area->global);
|
BLO_write_struct(writer, ScrGlobalAreaData, area->global);
|
||||||
#endif
|
|
||||||
|
|
||||||
write_area_regions(writer, area);
|
write_area_regions(writer, area);
|
||||||
|
|
||||||
|
@@ -1639,12 +1639,6 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const
|
|||||||
write_wm_xr_data(writer, &wm->xr);
|
write_wm_xr_data(writer, &wm->xr);
|
||||||
|
|
||||||
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
|
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) */
|
/* update deprecated screen member (for so loading in 2.7x uses the correct screen) */
|
||||||
win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
|
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, WorkSpaceInstanceHook, win->workspace_hook);
|
||||||
BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
|
BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
|
||||||
|
|
||||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
|
||||||
BKE_screen_area_map_blend_write(writer, &win->global_areas);
|
BKE_screen_area_map_blend_write(writer, &win->global_areas);
|
||||||
#else
|
|
||||||
win->global_areas = global_areas;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* data is written, clear deprecated data again */
|
/* data is written, clear deprecated data again */
|
||||||
win->screen = NULL;
|
win->screen = NULL;
|
||||||
|
@@ -322,10 +322,6 @@ typedef struct uiPreview {
|
|||||||
char _pad1[6];
|
char _pad1[6];
|
||||||
} uiPreview;
|
} uiPreview;
|
||||||
|
|
||||||
/* These two lines with # tell makesdna this struct can be excluded.
|
|
||||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
|
||||||
#
|
|
||||||
#
|
|
||||||
typedef struct ScrGlobalAreaData {
|
typedef struct ScrGlobalAreaData {
|
||||||
/* Global areas have a non-dynamic size. That means, changing the window
|
/* 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
|
* size doesn't affect their size at all. However, they can still be
|
||||||
|
@@ -59,10 +59,6 @@ struct wmTimer;
|
|||||||
/* Defined in `buttons_intern.h`. */
|
/* Defined in `buttons_intern.h`. */
|
||||||
typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
|
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)
|
/** \name SpaceLink (Base)
|
||||||
* \{ */
|
* \{ */
|
||||||
@@ -1672,10 +1668,6 @@ typedef enum eSpaceClip_GPencil_Source {
|
|||||||
/** \name Top Bar
|
/** \name Top Bar
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
/* These two lines with # tell makesdna this struct can be excluded.
|
|
||||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
|
||||||
#
|
|
||||||
#
|
|
||||||
typedef struct SpaceTopBar {
|
typedef struct SpaceTopBar {
|
||||||
SpaceLink *next, *prev;
|
SpaceLink *next, *prev;
|
||||||
/** Storage of regions for inactive spaces. */
|
/** Storage of regions for inactive spaces. */
|
||||||
@@ -1692,10 +1684,6 @@ typedef struct SpaceTopBar {
|
|||||||
/** \name Status Bar
|
/** \name Status Bar
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
/* These two lines with # tell makesdna this struct can be excluded.
|
|
||||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
|
||||||
#
|
|
||||||
#
|
|
||||||
typedef struct SpaceStatusBar {
|
typedef struct SpaceStatusBar {
|
||||||
SpaceLink *next, *prev;
|
SpaceLink *next, *prev;
|
||||||
/** Storage of regions for inactive spaces. */
|
/** Storage of regions for inactive spaces. */
|
||||||
|
Reference in New Issue
Block a user