Fix T64842: crash rendering files with bevel curves
[blender.git] / source / blender / blenkernel / BKE_library_override.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2016 by Blender Foundation.
17  * All rights reserved.
18  */
19
20 #ifndef __BKE_LIBRARY_OVERRIDE_H__
21 #define __BKE_LIBRARY_OVERRIDE_H__
22
23 /** \file
24  * \ingroup bke
25  */
26
27 struct ID;
28 struct IDOverrideStatic;
29 struct IDOverrideStaticProperty;
30 struct IDOverrideStaticPropertyOperation;
31 struct Main;
32
33 void BKE_override_static_enable(const bool do_enable);
34 bool BKE_override_static_is_enabled(void);
35
36 struct IDOverrideStatic *BKE_override_static_init(struct ID *local_id, struct ID *reference_id);
37 void BKE_override_static_copy(struct ID *dst_id, const struct ID *src_id);
38 void BKE_override_static_clear(struct IDOverrideStatic *override);
39 void BKE_override_static_free(struct IDOverrideStatic **override);
40
41 struct ID *BKE_override_static_create_from_id(struct Main *bmain, struct ID *reference_id);
42 bool BKE_override_static_create_from_tag(struct Main *bmain);
43
44 struct IDOverrideStaticProperty *BKE_override_static_property_find(
45     struct IDOverrideStatic *override, const char *rna_path);
46 struct IDOverrideStaticProperty *BKE_override_static_property_get(
47     struct IDOverrideStatic *override, const char *rna_path, bool *r_created);
48 void BKE_override_static_property_delete(struct IDOverrideStatic *override,
49                                          struct IDOverrideStaticProperty *override_property);
50
51 struct IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
52     struct IDOverrideStaticProperty *override_property,
53     const char *subitem_refname,
54     const char *subitem_locname,
55     const int subitem_refindex,
56     const int subitem_locindex,
57     const bool strict,
58     bool *r_strict);
59 struct IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
60     struct IDOverrideStaticProperty *override_property,
61     const short operation,
62     const char *subitem_refname,
63     const char *subitem_locname,
64     const int subitem_refindex,
65     const int subitem_locindex,
66     const bool strict,
67     bool *r_strict,
68     bool *r_created);
69 void BKE_override_static_property_operation_delete(
70     struct IDOverrideStaticProperty *override_property,
71     struct IDOverrideStaticPropertyOperation *override_property_operation);
72
73 bool BKE_override_static_status_check_local(struct Main *bmain, struct ID *local);
74 bool BKE_override_static_status_check_reference(struct Main *bmain, struct ID *local);
75
76 bool BKE_override_static_operations_create(struct Main *bmain,
77                                            struct ID *local,
78                                            const bool force_auto);
79 void BKE_main_override_static_operations_create(struct Main *bmain, const bool force_auto);
80
81 void BKE_override_static_update(struct Main *bmain, struct ID *local);
82 void BKE_main_override_static_update(struct Main *bmain);
83
84 /* Storage (.blend file writing) part. */
85
86 /* For now, we just use a temp main list. */
87 typedef struct Main OverrideStaticStorage;
88
89 OverrideStaticStorage *BKE_override_static_operations_store_initialize(void);
90 struct ID *BKE_override_static_operations_store_start(struct Main *bmain,
91                                                       OverrideStaticStorage *override_storage,
92                                                       struct ID *local);
93 void BKE_override_static_operations_store_end(OverrideStaticStorage *override_storage,
94                                               struct ID *local);
95 void BKE_override_static_operations_store_finalize(OverrideStaticStorage *override_storage);
96
97 #endif /* __BKE_LIBRARY_OVERRIDE_H__ */