diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-09-28 12:52:22 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-09-28 12:52:22 +0300 |
commit | 808b03da437043d7bb809a4d0e9e523bbfad95f9 (patch) | |
tree | 4a3ef1f74b09328b2e97bf827fa1fc700a9e2e41 /source/blender/editors/space_userpref/space_userpref.c | |
parent | 5270ac5ed87fb5f9b5605fdc332f16ea0f7ee59d (diff) |
Cleanup: decentralize .blend I/O for space types
This adds callbacks to `SpaceType` to make each editor responsible to
manage their own .blend I/O, and moves relevant code from `screen.c`
to the editors files.
Differential Revision: D11069
Diffstat (limited to 'source/blender/editors/space_userpref/space_userpref.c')
-rw-r--r-- | source/blender/editors/space_userpref/space_userpref.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 06a4c1d8702..1516435c6fc 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -27,6 +27,8 @@ #include "UI_interface.h" +#include "BLO_read_write.h" + /* ******************** default callbacks for userpref space ***************** */ static SpaceLink *userpref_create(const ScrArea *area, const Scene *UNUSED(scene)) @@ -183,6 +185,11 @@ static void userpref_execute_region_listener(const wmRegionListenerParams *UNUSE { } +static void userpref_blend_write(BlendWriter *writer, SpaceLink *sl) +{ + BLO_write_struct(writer, SpaceUserPref, sl); +} + void ED_spacetype_userpref(void) { SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype userpref"); @@ -197,6 +204,7 @@ void ED_spacetype_userpref(void) st->duplicate = userpref_duplicate; st->operatortypes = userpref_operatortypes; st->keymap = userpref_keymap; + st->blend_write = userpref_blend_write; /* regions: main window */ art = MEM_callocN(sizeof(ARegionType), "spacetype userpref region"); |