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_info | |
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_info')
-rw-r--r-- | source/blender/editors/space_info/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_info/CMakeLists.txt b/source/blender/editors/space_info/CMakeLists.txt index 4e9df2b93b0..03314158813 100644 --- a/source/blender/editors/space_info/CMakeLists.txt +++ b/source/blender/editors/space_info/CMakeLists.txt @@ -15,6 +15,9 @@ set(INC ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + + # dna_type_offsets.h + ${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna ) @@ -37,5 +40,5 @@ set(LIB blender_add_lib(bf_editor_space_info "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") -# RNA_prototypes.h +# RNA_prototypes.h dna_type_offsets.h add_dependencies(bf_editor_space_info bf_rna) diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 63c8d74c684..11294ed6ecc 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -28,6 +28,8 @@ #include "UI_resources.h" #include "UI_view2d.h" +#include "BLO_read_write.h" + #include "info_intern.h" /* own include */ /* ******************** default callbacks for info space ***************** */ @@ -248,6 +250,11 @@ static void info_header_region_message_subscribe(const wmRegionMessageSubscribeP WM_msg_subscribe_rna_anon_prop(mbus, ViewLayer, name, &msg_sub_value_region_tag_redraw); } +static void info_blend_write(BlendWriter *writer, SpaceLink *sl) +{ + BLO_write_struct(writer, SpaceInfo, sl); +} + void ED_spacetype_info(void) { SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype info"); @@ -262,6 +269,7 @@ void ED_spacetype_info(void) st->duplicate = info_duplicate; st->operatortypes = info_operatortypes; st->keymap = info_keymap; + st->blend_write = info_blend_write; /* regions: main window */ art = MEM_callocN(sizeof(ARegionType), "spacetype info region"); |