4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2009 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
32 #include "RNA_define.h"
33 #include "RNA_types.h"
35 #include "UI_interface.h"
37 static void api_ui_item_common(FunctionRNA *func)
39 RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item.");
40 RNA_def_int(func, "icon", 0, 0, INT_MAX, "", "Override automatic icon of the item.", 0, INT_MAX);
43 static void api_ui_item_op_common(FunctionRNA *func)
47 api_ui_item_common(func);
48 parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
49 RNA_def_property_flag(parm, PROP_REQUIRED);
52 void RNA_api_ui_layout(StructRNA *srna)
57 /* simple layout specifiers */
58 func= RNA_def_function(srna, "row", "uiLayoutRow");
59 func= RNA_def_function(srna, "column", "uiLayoutColumn");
60 func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
61 parm= RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX);
64 func= RNA_def_function(srna, "box", "uiLayoutBox");
65 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
66 RNA_def_function_return(func, parm);
69 func= RNA_def_function(srna, "split", "uiLayoutSplit");
70 parm= RNA_def_int(func, "number", 2, 0, INT_MAX, "", "Number of splits.", 0, INT_MAX);
71 parm= RNA_def_boolean(func, "lr", 0, "", "LR.");
74 func= RNA_def_function(srna, "sub", "uiLayoutSub");
75 parm= RNA_def_int(func, "n", 0, 0, INT_MAX, "", "Index of sub-layout.", 0, INT_MAX);
76 RNA_def_property_flag(parm, PROP_REQUIRED);
77 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
78 RNA_def_function_return(func, parm);
81 func= RNA_def_function(srna, "itemR", "uiItemR");
82 api_ui_item_common(func);
83 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
84 RNA_def_property_flag(parm, PROP_REQUIRED);
85 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
86 RNA_def_property_flag(parm, PROP_REQUIRED);
87 RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
89 func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR");
90 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
91 RNA_def_property_flag(parm, PROP_REQUIRED);
92 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
93 RNA_def_property_flag(parm, PROP_REQUIRED);
95 func= RNA_def_function(srna, "item_menu_enumR", "uiItemMenuEnumR");
96 api_ui_item_common(func);
97 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
98 RNA_def_property_flag(parm, PROP_REQUIRED);
99 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
100 RNA_def_property_flag(parm, PROP_REQUIRED);
102 /*func= RNA_def_function(srna, "item_enumR", "uiItemEnumR");
103 api_ui_item_common(func);
104 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
105 RNA_def_property_flag(parm, PROP_REQUIRED);
106 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
107 RNA_def_property_flag(parm, PROP_REQUIRED);
108 parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
109 RNA_def_property_flag(parm, PROP_REQUIRED);*/
111 func= RNA_def_function(srna, "itemO", "uiItemO");
112 api_ui_item_op_common(func);
114 /*func= RNA_def_function(srna, "item_enumO", "uiItemEnumO");
115 api_ui_item_op_common(func);
116 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
117 RNA_def_property_flag(parm, PROP_REQUIRED);
118 parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
119 RNA_def_property_flag(parm, PROP_REQUIRED);*/
121 func= RNA_def_function(srna, "items_enumO", "uiItemsEnumO");
122 parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
123 RNA_def_property_flag(parm, PROP_REQUIRED);
124 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
125 RNA_def_property_flag(parm, PROP_REQUIRED);
127 func= RNA_def_function(srna, "item_menu_enumO", "uiItemMenuEnumO");
128 api_ui_item_op_common(func);
129 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
130 RNA_def_property_flag(parm, PROP_REQUIRED);
132 func= RNA_def_function(srna, "item_booleanO", "uiItemBooleanO");
133 api_ui_item_op_common(func);
134 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
135 RNA_def_property_flag(parm, PROP_REQUIRED);
136 parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with.");
137 RNA_def_property_flag(parm, PROP_REQUIRED);
139 func= RNA_def_function(srna, "item_intO", "uiItemIntO");
140 api_ui_item_op_common(func);
141 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
142 RNA_def_property_flag(parm, PROP_REQUIRED);
143 parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX);
144 RNA_def_property_flag(parm, PROP_REQUIRED);
146 func= RNA_def_function(srna, "item_floatO", "uiItemFloatO");
147 api_ui_item_op_common(func);
148 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
149 RNA_def_property_flag(parm, PROP_REQUIRED);
150 parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX);
151 RNA_def_property_flag(parm, PROP_REQUIRED);
153 func= RNA_def_function(srna, "item_stringO", "uiItemStringO");
154 api_ui_item_op_common(func);
155 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
156 RNA_def_property_flag(parm, PROP_REQUIRED);
157 parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with.");
158 RNA_def_property_flag(parm, PROP_REQUIRED);
160 func= RNA_def_function(srna, "itemL", "uiItemL");
161 api_ui_item_common(func);
163 func= RNA_def_function(srna, "itemM", "uiItemM");
164 api_ui_item_common(func);
165 parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu.");
166 RNA_def_property_flag(parm, PROP_REQUIRED);
168 func= RNA_def_function(srna, "itemS", "uiItemS");
171 func= RNA_def_function(srna, "template_header", "uiTemplateHeader");
173 func= RNA_def_function(srna, "template_header_ID", "uiTemplateHeaderID");
174 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
175 RNA_def_property_flag(parm, PROP_REQUIRED);
176 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of pointer property in data.");
177 RNA_def_property_flag(parm, PROP_REQUIRED);
178 RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block.");
179 RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block.");
180 RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block.");