Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-03-06 13:27:29 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-03-06 13:27:54 +0300
commit17e1fef85aa45f95d2e7c872901ca1c6140fad73 (patch)
tree7a5e4ef8df279ff660012000be19631ccebb941c /source/blender/blenkernel/intern/library.c
parentc25f6e998bd98533c4a818310dbf5f24f01d221b (diff)
Cleanup: Library: Move to IDTypeInfo, and remove unused BKE API.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 376d5aacbf5..e3ed21aa536 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -34,6 +34,9 @@
#include "BLI_blenlib.h"
+#include "BLT_translation.h"
+
+#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -42,13 +45,30 @@
/* Unused currently. */
// static CLG_LogRef LOG = {.identifier = "bke.library"};
-void BKE_library_free(Library *lib)
+static void library_free_data(ID *id)
{
- if (lib->packedfile) {
- BKE_packedfile_free(lib->packedfile);
+ Library *library = (Library *)id;
+ if (library->packedfile) {
+ BKE_packedfile_free(library->packedfile);
}
}
+IDTypeInfo IDType_ID_LI = {
+ .id_code = ID_LI,
+ .id_filter = 0,
+ .main_listbase_index = INDEX_ID_LI,
+ .struct_size = sizeof(Library),
+ .name = "Library",
+ .name_plural = "libraries",
+ .translation_context = BLT_I18NCONTEXT_ID_LIBRARY,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL,
+
+ .init_data = NULL,
+ .copy_data = NULL,
+ .free_data = library_free_data,
+ .make_local = NULL,
+};
+
void BKE_library_filepath_set(Main *bmain, Library *lib, const char *filepath)
{
/* in some cases this is used to update the absolute path from the