96 static void rna_Operator_report(
wmOperator *op,
int type,
const char *msg)
143 static void rna_gizmo_group_type_ensure(
ReportList *reports,
const char *idname)
145 wmGizmoGroupType *gzgt = wm_gizmogrouptype_find_for_add_remove(reports, idname);
151 static void rna_gizmo_group_type_unlink_delayed(
ReportList *reports,
const char *idname)
153 wmGizmoGroupType *gzgt = wm_gizmogrouptype_find_for_add_remove(reports, idname);
160 static struct wmStaticProgress {
164 } wm_progress_state = {0, 0,
false};
170 wm_progress_state.min =
min;
171 wm_progress_state.max =
max;
172 wm_progress_state.is_valid =
true;
175 wm_progress_state.is_valid =
false;
179 static void rna_progress_update(
struct wmWindowManager *wm,
float value)
181 if (wm_progress_state.is_valid) {
185 int val = (int)(10000 * (value - wm_progress_state.min) /
186 (wm_progress_state.max - wm_progress_state.min));
194 if (wm_progress_state.is_valid) {
198 wm_progress_state.is_valid =
false;
213 static int keymap_item_modifier_flag_from_args(
bool any,
int shift,
int ctrl,
int alt,
int oskey)
223 else if (shift ==
KM_ANY) {
230 else if (ctrl ==
KM_ANY) {
244 else if (oskey ==
KM_ANY) {
275 const int modifier = keymap_item_modifier_flag_from_args(
any, shift, ctrl, alt, oskey);
285 .modifier = modifier,
286 .keymodifier = keymodifier,
287 .direction = direction,
328 const char *propvalue_str,
347 const int modifier = keymap_item_modifier_flag_from_args(
any, shift, ctrl, alt, oskey);
353 .modifier = modifier,
354 .keymodifier = keymodifier,
355 .direction = direction,
383 "KeyMapItem '%s' cannot be removed from '%s'",
392 static PointerRNA rna_KeyMap_item_find_from_operator(
ID *
id,
403 km, idname_bl, properties->
data, include_mask, exclude_mask);
447 if (keymap && tool) {
512 C, idname_bl, opcontext, properties->
data, include_mask, exclude_mask, &km);
583 static void rna_WindowManager_tag_script_reload(
void)
589 static PointerRNA rna_WindoManager_operator_properties_last(
const char *idname)
634 if (unicode !=
NULL) {
642 if (unicode !=
NULL) {
644 if (
len == -1 || unicode[
len] !=
'\0') {
671 e.utf8_buf[0] =
'\0';
672 if (unicode !=
NULL) {
684 # define WM_GEN_INVOKE_EVENT (1 << 0)
685 # define WM_GEN_INVOKE_SIZE (1 << 1)
686 # define WM_GEN_INVOKE_RETURN (1 << 2)
693 parm =
RNA_def_pointer(func,
"operator",
"Operator",
"",
"Operator to call");
702 RNA_def_int(func,
"width", 300, 0, INT_MAX,
"",
"Width of the popup", 0, INT_MAX);
718 parm =
RNA_def_int(func,
"x", 0, INT_MIN, INT_MAX,
"",
"", INT_MIN, INT_MAX);
720 parm =
RNA_def_int(func,
"y", 0, INT_MIN, INT_MAX,
"",
"", INT_MIN, INT_MAX);
738 func,
"Restore the previous cursor after calling ``cursor_modal_set``");
741 func =
RNA_def_function(srna,
"event_simulate",
"rna_Window_event_add_simulate");
750 RNA_def_int(func,
"x", 0, INT_MIN, INT_MAX,
"",
"", INT_MIN, INT_MAX);
751 RNA_def_int(func,
"y", 0, INT_MIN, INT_MAX,
"",
"", INT_MIN, INT_MAX);
757 parm =
RNA_def_pointer(func,
"event",
"Event",
"Item",
"Added key map item");
769 "Opens a file selector with an operator. "
770 "The string properties 'filepath', 'filename', 'directory' and a 'files' "
771 "collection are assigned when present in the operator");
774 func =
RNA_def_function(srna,
"modal_handler_add",
"rna_event_modal_handler_add");
777 "Add a modal handler to the window manager, for the given modal operator "
778 "(called by invoke() with self, just before returning {'RUNNING_MODAL'})");
780 parm =
RNA_def_pointer(func,
"operator",
"Operator",
"",
"Operator to call");
783 func,
RNA_def_boolean(func,
"handle", 1,
"",
"Whether adding the handler was successful"));
787 func,
"Add a timer to the given window, to generate periodic 'TIMER' events");
792 RNA_def_pointer(func,
"window",
"Window",
"",
"Window to attach the timer to, or None");
796 func =
RNA_def_function(srna,
"event_timer_remove",
"rna_event_timer_remove");
800 func =
RNA_def_function(srna,
"gizmo_group_type_ensure",
"rna_gizmo_group_type_ensure");
802 func,
"Activate an existing widget group (when the persistent option isn't set)");
808 srna,
"gizmo_group_type_unlink_delayed",
"rna_gizmo_group_type_unlink_delayed");
810 "Unlink a widget group (when the persistent option is set)");
830 parm,
"value",
"Any value between min and max as set in progress_begin()");
836 func =
RNA_def_function(srna,
"invoke_props_popup",
"rna_Operator_props_popup");
839 "Operator popup invoke "
840 "(show operator properties and execute it automatically on changes)");
844 func =
RNA_def_function(srna,
"invoke_props_dialog",
"WM_operator_props_dialog_popup");
847 "Operator dialog (non-autoexec popup) invoke "
848 "(show operator properties and only execute it on click on OK button)");
852 func =
RNA_def_function(srna,
"invoke_search_popup",
"rna_Operator_enum_search_invoke");
855 "Operator search popup invoke which "
856 "searches values of the operator's :class:`bpy.types.Operator.bl_property` "
857 "(which must be an EnumProperty), executing it on confirmation");
863 "Operator popup invoke "
864 "(only shows operator's properties, without executing it)");
870 "Operator confirmation popup "
871 "(only to let user confirm the execution, no operator properties shown)");
875 func =
RNA_def_function(srna,
"popmenu_begin__internal",
"rna_PopMenuBegin");
893 func =
RNA_def_function(srna,
"popover_begin__internal",
"rna_PopoverBegin");
901 func,
"from_active_button", 0,
"Use Button",
"Use the active button for positioning");
908 RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Active key map");
911 func =
RNA_def_function(srna,
"piemenu_begin__internal",
"rna_PieMenuBegin");
932 srna,
"operator_properties_last",
"rna_WindoManager_operator_properties_last");
941 RNA_def_function(srna,
"print_undo_steps",
"rna_WindowManager_print_undo_steps");
944 func =
RNA_def_function(srna,
"tag_script_reload",
"rna_WindowManager_tag_script_reload");
946 func,
"Tag for refreshing the interface after scripts have been reloaded");
952 "Is Interface Locked",
953 "If true, the interface is currently locked by a running job and data shouldn't be modified "
954 "from application timers. Otherwise, the running job might conflict with the handler "
955 "causing unexpected results or even crashes");
1003 func,
"Check the operator settings, return True to signal a change to redraw");
1062 parm =
RNA_def_pointer(func,
"properties",
"OperatorProperties",
"",
"");
1109 parm =
RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Active key map");
1112 func =
RNA_def_function(srna,
"restore_to_default",
"rna_keymap_restore_to_default");
1115 func =
RNA_def_function(srna,
"restore_item_to_default",
"rna_keymap_restore_item_to_default");
1159 RNA_def_boolean(func,
"repeat",
false,
"Repeat",
"When set, accept key-repeat events");
1164 "Force item to be added at start (not end) of key map so that "
1165 "it doesn't get blocked by an existing key map item");
1166 parm =
RNA_def_pointer(func,
"item",
"KeyMapItem",
"Item",
"Added key map item");
1184 RNA_def_boolean(func,
"repeat",
false,
"Repeat",
"When set, accept key-repeat events");
1185 parm =
RNA_def_pointer(func,
"item",
"KeyMapItem",
"Item",
"Added key map item");
1188 func =
RNA_def_function(srna,
"new_from_item",
"rna_KeyMap_item_new_from_item");
1190 parm =
RNA_def_pointer(func,
"item",
"KeyMapItem",
"Item",
"Item to use as a reference");
1193 parm =
RNA_def_pointer(func,
"result",
"KeyMapItem",
"Item",
"Added key map item");
1211 func =
RNA_def_function(srna,
"find_from_operator",
"rna_KeyMap_item_find_from_operator");
1215 parm =
RNA_def_pointer(func,
"properties",
"OperatorProperties",
"",
"");
1224 func =
RNA_def_function(srna,
"match_event",
"rna_KeyMap_item_match_event");
1242 "Ensure the keymap exists. This will return the one with the given name/space type/region "
1243 "type, or create a new one if it does not exist yet.");
1250 RNA_def_boolean(func,
"modal", 0,
"Modal",
"Keymap for modal operators");
1252 parm =
RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Added key map");
1257 parm =
RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Removed key map");
1267 parm =
RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Corresponding key map");
1273 parm =
RNA_def_pointer(func,
"keymap",
"KeyMap",
"Key Map",
"Corresponding key map");
1286 func,
"keyconfig",
"KeyConfig",
"Key Configuration",
"Added key configuration");
1292 func,
"keyconfig",
"KeyConfig",
"Key Configuration",
"Removed key configuration");
1300 srna,
"find_item_from_operator",
"rna_KeyConfig_find_item_from_operator");
1306 parm =
RNA_def_pointer(func,
"properties",
"OperatorProperties",
"",
"");
struct wmWindowManager * CTX_wm_manager(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_undosys_print(UndoStack *ustack)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define STRNCPY(dst, src)
int BLI_str_utf8_size(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
#define RNA_POINTER_INVALIDATE(ptr)
void UI_popover_end(struct bContext *C, struct uiPopover *pup, struct wmKeyMap *keymap)
#define UI_MAX_SHORTCUT_STR
void UI_pie_menu_end(struct bContext *C, uiPieMenu *pie)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
struct uiPieMenu * UI_pie_menu_begin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL()
uiPopover * UI_popover_begin(struct bContext *C, int menu_width, bool from_active_button) ATTR_NONNULL(1)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
@ WM_GIZMOGROUPTYPE_PERSISTENT
__forceinline bool any(const avxb &b)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
const PointerRNA PointerRNA_NULL
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_region_type_items[]
const EnumPropertyItem rna_enum_space_type_items[]
const EnumPropertyItem rna_enum_operator_context_items[]
const EnumPropertyItem rna_enum_icon_items[]
const EnumPropertyItem rna_enum_event_direction_items[]
const EnumPropertyItem rna_enum_event_value_items[]
const EnumPropertyItem rna_enum_event_type_mask_items[]
const EnumPropertyItem rna_enum_event_type_items[]
const EnumPropertyItem rna_enum_wm_report_items[]
const EnumPropertyItem rna_enum_operator_return_items[]
void RNA_api_keymapitem(StructRNA *srna)
#define WM_GEN_INVOKE_EVENT
void RNA_api_window(StructRNA *srna)
void RNA_api_wm(StructRNA *srna)
#define WM_GEN_INVOKE_SIZE
void RNA_api_keyconfigs(StructRNA *srna)
void RNA_api_macro(StructRNA *srna)
void RNA_api_keyconfig(StructRNA *UNUSED(srna))
void RNA_api_keymap(StructRNA *srna)
void RNA_api_keymapitems(StructRNA *srna)
#define WM_GEN_INVOKE_RETURN
void RNA_api_keymaps(StructRNA *srna)
const EnumPropertyItem rna_enum_window_cursor_items[]
static void rna_generic_op_invoke(FunctionRNA *func, int flag)
void RNA_api_operator(StructRNA *srna)
eWM_GizmoFlagGroupTypeFlag flag
struct wmKeyMap * modalkeymap
struct ReportList * reports
struct UndoStack * undo_stack
struct wmWindow * winactive
struct wmKeyConfig * addonconf
struct wmEvent * eventstate
void WM_cursor_modal_restore(wmWindow *win)
void WM_cursor_time(wmWindow *win, int nr)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
wmKeyMapItem * WM_event_match_keymap_item(bContext *C, wmKeyMap *keymap, const wmEvent *event)
void WM_event_tablet_data_default_set(wmTabletData *tablet_data)
wmEvent * WM_event_add_simulate(wmWindow *win, const wmEvent *event_to_add)
bool WM_operator_is_repeat(const bContext *C, const wmOperator *op)
#define ISMOUSE_BUTTON(event_type)
#define ISMOUSE_MOTION(event_type)
#define ISKEYBOARD(event_type)
#define EVT_TYPE_MASK_ALL
bool WM_gizmo_group_type_ensure_ptr(wmGizmoGroupType *gzgt)
void WM_gizmo_group_type_unlink_delayed_ptr(wmGizmoGroupType *gzgt)
wmGizmoGroupType * WM_gizmogrouptype_find(const char *idname, bool quiet)
void WM_script_tag_reload(void)
void WM_keymap_item_restore_to_default(wmWindowManager *wm, wmKeyMap *keymap, wmKeyMapItem *kmi)
void WM_keymap_restore_to_default(wmKeyMap *keymap, wmWindowManager *wm)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
void WM_keyconfig_update(wmWindowManager *wm)
wmKeyMapItem * WM_key_event_operator_from_keymap(wmKeyMap *keymap, const char *opname, IDProperty *properties, const short include_mask, const short exclude_mask)
wmKeyMap * WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid)
int WM_keymap_item_to_string(const wmKeyMapItem *kmi, const bool compact, char *result, const int result_len)
bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
wmKeyMap * WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap)
wmKeyMapItem * WM_modalkeymap_add_item(wmKeyMap *km, const KeyMapItem_Params *params, int value)
bool WM_keyconfig_remove(wmWindowManager *wm, wmKeyConfig *keyconf)
bool WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap)
wmKeyMapItem * WM_key_event_operator(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const short include_mask, const short exclude_mask, wmKeyMap **r_keymap)
wmKeyMapItem * WM_keymap_add_item(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params)
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
bool WM_keymap_item_compare(const wmKeyMapItem *k1, const wmKeyMapItem *k2)
wmKeyMapItem * WM_modalkeymap_add_item_str(wmKeyMap *km, const KeyMapItem_Params *params, const char *value)
wmKeyMapItem * WM_keymap_add_item_copy(struct wmKeyMap *keymap, wmKeyMapItem *kmi_src)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void WM_operator_last_properties_ensure(wmOperatorType *ot, PointerRNA *ptr)
size_t WM_operator_bl_idname(char *dst, const char *src)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)