Cleanup: bScreen: Move to IDTypeInfo and remove unused BKE API.
This commit is contained in:
parent
a5bbdd6998
commit
b201a67faa
|
@ -139,7 +139,7 @@ extern IDTypeInfo IDType_ID_CA;
|
|||
// extern IDTypeInfo IDType_ID_IP;
|
||||
extern IDTypeInfo IDType_ID_KE;
|
||||
extern IDTypeInfo IDType_ID_WO;
|
||||
// extern IDTypeInfo IDType_ID_SCR;
|
||||
extern IDTypeInfo IDType_ID_SCR;
|
||||
// extern IDTypeInfo IDType_ID_VF;
|
||||
// extern IDTypeInfo IDType_ID_TXT;
|
||||
// extern IDTypeInfo IDType_ID_SPK;
|
||||
|
|
|
@ -66,7 +66,7 @@ static void id_type_init(void)
|
|||
// INIT_TYPE(ID_IP);
|
||||
INIT_TYPE(ID_KE);
|
||||
INIT_TYPE(ID_WO);
|
||||
// INIT_TYPE(ID_SCR);
|
||||
INIT_TYPE(ID_SCR);
|
||||
// INIT_TYPE(ID_VF);
|
||||
// INIT_TYPE(ID_TXT);
|
||||
// INIT_TYPE(ID_SPK);
|
||||
|
|
|
@ -182,7 +182,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag))
|
|||
BLI_assert(0);
|
||||
break;
|
||||
case ID_SCR:
|
||||
BKE_screen_free((bScreen *)id);
|
||||
BLI_assert(0);
|
||||
break;
|
||||
case ID_VF:
|
||||
BKE_vfont_free((VFont *)id);
|
||||
|
|
|
@ -43,11 +43,51 @@
|
|||
#include "BLI_rect.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_idprop.h"
|
||||
#include "BKE_idtype.h"
|
||||
#include "BKE_screen.h"
|
||||
#include "BKE_workspace.h"
|
||||
|
||||
static void screen_free_data(ID *id)
|
||||
{
|
||||
bScreen *screen = (bScreen *)id;
|
||||
ARegion *ar;
|
||||
|
||||
/* No animdata here. */
|
||||
|
||||
for (ar = screen->regionbase.first; ar; ar = ar->next) {
|
||||
BKE_area_region_free(NULL, ar);
|
||||
}
|
||||
|
||||
BLI_freelistN(&screen->regionbase);
|
||||
|
||||
BKE_screen_area_map_free(AREAMAP_FROM_SCREEN(screen));
|
||||
|
||||
BKE_previewimg_free(&screen->preview);
|
||||
|
||||
/* Region and timer are freed by the window manager. */
|
||||
MEM_SAFE_FREE(screen->tool_tip);
|
||||
}
|
||||
|
||||
IDTypeInfo IDType_ID_SCR = {
|
||||
.id_code = ID_SCR,
|
||||
.id_filter = 0,
|
||||
.main_listbase_index = INDEX_ID_SCR,
|
||||
.struct_size = sizeof(bScreen),
|
||||
.name = "Screen",
|
||||
.name_plural = "screens",
|
||||
.translation_context = BLT_I18NCONTEXT_ID_SCREEN,
|
||||
.flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_MAKELOCAL,
|
||||
|
||||
.init_data = NULL,
|
||||
.copy_data = NULL,
|
||||
.free_data = screen_free_data,
|
||||
.make_local = NULL,
|
||||
};
|
||||
|
||||
/* ************ Spacetype/regiontype handling ************** */
|
||||
|
||||
/* keep global; this has to be accessible outside of windowmanager */
|
||||
|
@ -474,22 +514,7 @@ void BKE_screen_area_map_free(ScrAreaMap *area_map)
|
|||
/** Free (or release) any data used by this screen (does not free the screen itself). */
|
||||
void BKE_screen_free(bScreen *sc)
|
||||
{
|
||||
ARegion *ar;
|
||||
|
||||
/* No animdata here. */
|
||||
|
||||
for (ar = sc->regionbase.first; ar; ar = ar->next) {
|
||||
BKE_area_region_free(NULL, ar);
|
||||
}
|
||||
|
||||
BLI_freelistN(&sc->regionbase);
|
||||
|
||||
BKE_screen_area_map_free(AREAMAP_FROM_SCREEN(sc));
|
||||
|
||||
BKE_previewimg_free(&sc->preview);
|
||||
|
||||
/* Region and timer are freed by the window manager. */
|
||||
MEM_SAFE_FREE(sc->tool_tip);
|
||||
screen_free_data(&sc->id);
|
||||
}
|
||||
|
||||
/* ***************** Screen edges & verts ***************** */
|
||||
|
|
Loading…
Reference in New Issue