UI: Improve contrast on playhead
[blender.git] / source / blender / makesrna / RNA_enum_types.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
17 #pragma once
18
19 /** \file
20  * \ingroup RNA
21  */
22
23 #include "RNA_types.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 struct ID;
30 struct bNodeSocketType;
31 struct bNodeTreeType;
32 struct bNodeType;
33
34 /* Types */
35 #define DEF_ENUM(id) extern const EnumPropertyItem id[];
36 #include "RNA_enum_items.h"
37
38 extern const EnumPropertyItem *rna_enum_attribute_domain_itemf(struct ID *id, bool *r_free);
39
40 /**
41  * For ID filters (#FILTER_ID_AC, #FILTER_ID_AR, ...) an int isn't enough. This version allows 64
42  * bit integers. So can't use the regular #EnumPropertyItem. Would be nice if RNA supported this
43  * itself.
44  *
45  * Meant to be used with #RNA_def_property_boolean_sdna() which supports 64 bit flags as well.
46  */
47 struct IDFilterEnumPropertyItem {
48   const uint64_t flag;
49   const char *identifier;
50   const int icon;
51   const char *name;
52   const char *description;
53 };
54 extern const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[];
55
56 /* API calls */
57 int rna_node_tree_type_to_enum(struct bNodeTreeType *typeinfo);
58 int rna_node_tree_idname_to_enum(const char *idname);
59 struct bNodeTreeType *rna_node_tree_type_from_enum(int value);
60 const EnumPropertyItem *rna_node_tree_type_itemf(void *data,
61                                                  bool (*poll)(void *data, struct bNodeTreeType *),
62                                                  bool *r_free);
63
64 int rna_node_type_to_enum(struct bNodeType *typeinfo);
65 int rna_node_idname_to_enum(const char *idname);
66 struct bNodeType *rna_node_type_from_enum(int value);
67 const EnumPropertyItem *rna_node_type_itemf(void *data,
68                                             bool (*poll)(void *data, struct bNodeType *),
69                                             bool *r_free);
70
71 int rna_node_socket_type_to_enum(struct bNodeSocketType *typeinfo);
72 int rna_node_socket_idname_to_enum(const char *idname);
73 struct bNodeSocketType *rna_node_socket_type_from_enum(int value);
74 const EnumPropertyItem *rna_node_socket_type_itemf(
75     void *data, bool (*poll)(void *data, struct bNodeSocketType *), bool *r_free);
76
77 struct PointerRNA;
78 struct PropertyRNA;
79 struct bContext;
80
81 const EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C,
82                                                        struct PointerRNA *ptr,
83                                                        struct PropertyRNA *prop,
84                                                        bool *r_free);
85
86 /* Generic functions, return an enum from library data, index is the position
87  * in the linked list can add more for different types as needed */
88 const EnumPropertyItem *RNA_action_itemf(struct bContext *C,
89                                          struct PointerRNA *ptr,
90                                          struct PropertyRNA *prop,
91                                          bool *r_free);
92 #if 0
93 EnumPropertyItem *RNA_action_local_itemf(struct bContext *C,
94                                          struct PointerRNA *ptr,
95                                          struct PropertyRNA *prop,
96                                          bool *r_free);
97 #endif
98 const EnumPropertyItem *RNA_collection_itemf(struct bContext *C,
99                                              struct PointerRNA *ptr,
100                                              struct PropertyRNA *prop,
101                                              bool *r_free);
102 const EnumPropertyItem *RNA_collection_local_itemf(struct bContext *C,
103                                                    struct PointerRNA *ptr,
104                                                    struct PropertyRNA *prop,
105                                                    bool *r_free);
106 const EnumPropertyItem *RNA_image_itemf(struct bContext *C,
107                                         struct PointerRNA *ptr,
108                                         struct PropertyRNA *prop,
109                                         bool *r_free);
110 const EnumPropertyItem *RNA_image_local_itemf(struct bContext *C,
111                                               struct PointerRNA *ptr,
112                                               struct PropertyRNA *prop,
113                                               bool *r_free);
114 const EnumPropertyItem *RNA_scene_itemf(struct bContext *C,
115                                         struct PointerRNA *ptr,
116                                         struct PropertyRNA *prop,
117                                         bool *r_free);
118 const EnumPropertyItem *RNA_scene_without_active_itemf(struct bContext *C,
119                                                        struct PointerRNA *ptr,
120                                                        struct PropertyRNA *prop,
121                                                        bool *r_free);
122 const EnumPropertyItem *RNA_scene_local_itemf(struct bContext *C,
123                                               struct PointerRNA *ptr,
124                                               struct PropertyRNA *prop,
125                                               bool *r_free);
126 const EnumPropertyItem *RNA_movieclip_itemf(struct bContext *C,
127                                             struct PointerRNA *ptr,
128                                             struct PropertyRNA *prop,
129                                             bool *r_free);
130 const EnumPropertyItem *RNA_movieclip_local_itemf(struct bContext *C,
131                                                   struct PointerRNA *ptr,
132                                                   struct PropertyRNA *prop,
133                                                   bool *r_free);
134 const EnumPropertyItem *RNA_mask_itemf(struct bContext *C,
135                                        struct PointerRNA *ptr,
136                                        struct PropertyRNA *prop,
137                                        bool *r_free);
138 const EnumPropertyItem *RNA_mask_local_itemf(struct bContext *C,
139                                              struct PointerRNA *ptr,
140                                              struct PropertyRNA *prop,
141                                              bool *r_free);
142
143 /* Non confirming, utility function. */
144 const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(struct bContext *C, bool *r_free);
145
146 #ifdef __cplusplus
147 }
148 #endif