Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "DNA_ID.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "BLT_translation.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
#include "wm_event_system.h"
Go to the source code of this file.
Classes | |
struct | MacroData |
Macros | |
#define | UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)") |
Operator Type Registry | |
static GHash * | global_ops_hash = NULL |
static int | ot_prop_basic_count = -1 |
wmOperatorType * | WM_operatortype_find (const char *idname, bool quiet) |
void | WM_operatortype_iter (GHashIterator *ghi) |
Operator Registry.
Definition in file wm_operator_type.c.
Definition at line 39 of file wm_operator_type.c.
|
static |
Definition at line 179 of file wm_operator_type.c.
References ListBase::first, wmOperatorType::idname, IDP_FreeProperty(), wmOperatorType::last_properties, wmOperatorType::macro, MEM_freeN, ot, wmOperatorType::rna_ext, ExtensionRNA::srna, and wm_operatortype_free_macro().
Referenced by wm_operatortype_free().
|
static |
Definition at line 447 of file wm_operator_type.c.
References C, wmOperatorType::cancel, OPERATOR_CANCELLED, wmOperator::opm, wmOperator::type, and wm_macro_end().
Referenced by WM_operatortype_append_macro(), and WM_operatortype_append_macro_ptr().
|
static |
Definition at line 287 of file wm_operator_type.c.
References wmOperator::customdata, MEM_freeN, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, and MacroData::retval.
Referenced by wm_macro_cancel(), wm_macro_exec(), wm_macro_invoke_internal(), and wm_macro_modal().
|
static |
Definition at line 310 of file wm_operator_type.c.
References C, CLOG_WARN, wmOperator::customdata, LISTBASE_FOREACH, wmOperator::macro, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, MacroData::retval, CLG_LogRef::type, WM_LOG_OPERATORS, wm_macro_end(), and wm_macro_start().
Referenced by WM_operatortype_append_macro(), and WM_operatortype_append_macro_ptr().
|
static |
Definition at line 369 of file wm_operator_type.c.
References C, ListBase::first, wmOperator::macro, wm_macro_invoke_internal(), and wm_macro_start().
Referenced by WM_operatortype_append_macro(), and WM_operatortype_append_macro_ptr().
|
static |
Definition at line 337 of file wm_operator_type.c.
References BLI_movelisttolist(), C, wmOperator::customdata, wmOperatorType::exec, wmOperatorType::invoke, ReportList::list, wmOperator::next, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, wmOperator::reports, MacroData::retval, wmOperator::type, and wm_macro_end().
Referenced by wm_macro_invoke(), and wm_macro_modal().
|
static |
Definition at line 375 of file wm_operator_type.c.
References BLI_findptr(), BLI_remlink(), bounds(), C, CLOG_ERROR, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, wmOperator::flag, wmOperatorType::flag, wmEventHandler_Op::head, wmOperatorType::modal, wmWindow::modalhandlers, wmOperator::next, NULL, OP_IS_MODAL_GRAB_CURSOR, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, wmOperator::opm, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_X, OPTYPE_GRAB_CURSOR_XY, OPTYPE_GRAB_CURSOR_Y, wmOperator::ptr, MacroData::retval, wmOperator::type, ARegion::winrct, WM_cursor_grab_enable(), WM_CURSOR_WRAP_NONE, WM_CURSOR_WRAP_X, WM_CURSOR_WRAP_XY, WM_CURSOR_WRAP_Y, wm_event_free_handler(), WM_LOG_OPERATORS, wm_macro_end(), wm_macro_invoke_internal(), WM_operator_properties_clear(), blender::bke::image::partial_update::wrap(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by WM_operatortype_append_macro(), and WM_operatortype_append_macro_ptr().
|
static |
Definition at line 280 of file wm_operator_type.c.
References wmOperator::customdata, MEM_callocN, and NULL.
Referenced by wm_macro_exec(), and wm_macro_invoke().
void WM_operatortype_append | ( | void(*)(wmOperatorType *) | opfunc | ) |
Definition at line 123 of file wm_operator_type.c.
References ot, wm_operatortype_append__begin(), and wm_operatortype_append__end().
Referenced by action_operatortypes(), buttons_operatortypes(), clip_operatortypes(), console_operatortypes(), ED_operatortypes_anim(), ED_operatortypes_animchannels(), ED_operatortypes_armature(), ED_operatortypes_asset(), ED_operatortypes_curve(), ED_operatortypes_curves(), ED_operatortypes_edutils(), ED_operatortypes_geometry(), ED_operatortypes_gpencil(), ED_operatortypes_io(), ED_operatortypes_lattice(), ED_operatortypes_marker(), ED_operatortypes_mask(), ED_operatortypes_mesh(), ED_operatortypes_metaball(), ED_operatortypes_object(), ED_operatortypes_paint(), ED_operatortypes_render(), ED_operatortypes_scene(), ED_operatortypes_screen(), ED_operatortypes_sculpt(), ED_operatortypes_sculpt_curves(), ED_operatortypes_sound(), ED_operatortypes_ui(), ED_operatortypes_userpref(), ED_operatortypes_uvedit(), ED_operatortypes_view2d(), ED_operatortypes_workspace(), file_operatortypes(), graphedit_operatortypes(), image_operatortypes(), info_operatortypes(), nla_operatortypes(), blender::ed::space_node::node_operatortypes(), operatortypes_boids(), operatortypes_dynamicpaint(), operatortypes_fluid(), operatortypes_particle(), operatortypes_pointcache(), outliner_operatortypes(), script_operatortypes(), sequencer_operatortypes(), spreadsheet_operatortypes(), text_operatortypes(), transform_operatortypes(), view3d_operatortypes(), WM_operatortypes_lineart(), wm_operatortypes_register(), and wm_xr_operatortypes_register().
|
static |
Definition at line 88 of file wm_operator_type.c.
References BLENDER_RNA, BLI_assert, BLT_I18NCONTEXT_OPERATOR_DEFAULT, wmOperatorType::cursor_pending, MEM_callocN, ot, ot_prop_basic_count, RNA_def_struct_property_tags(), RNA_def_struct_ptr(), RNA_def_struct_translation_context(), rna_enum_operator_property_tags, wmOperatorType::srna, wmOperatorType::translation_context, and WM_CURSOR_PICK_AREA.
Referenced by WM_operatortype_append(), and WM_operatortype_append_ptr().
|
static |
Definition at line 103 of file wm_operator_type.c.
References BLENDER_RNA, BLI_assert, BLI_ghash_insert(), CLOG_ERROR, wmOperatorType::description, global_ops_hash, wmOperatorType::idname, wmOperatorType::name, NULL, ot, RNA_def_struct_identifier(), RNA_def_struct_ui_text(), wmOperatorType::srna, UNDOCUMENTED_OPERATOR_TIP, WM_LOG_OPERATORS, and WM_operatortype_props_advanced_end().
Referenced by WM_operatortype_append(), and WM_operatortype_append_ptr().
wmOperatorType* WM_operatortype_append_macro | ( | const char * | idname, |
const char * | name, | ||
const char * | description, | ||
int | flag | ||
) |
Definition at line 457 of file wm_operator_type.c.
References BLENDER_RNA, BLI_assert, BLI_ghash_insert(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, wmOperatorType::cancel, CLOG_ERROR, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, global_ops_hash, wmOperatorType::idname, wmOperatorType::invoke, MEM_callocN, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_MACRO, ot, wmOperatorType::poll, RNA_def_struct_identifier(), RNA_def_struct_ptr(), RNA_def_struct_translation_context(), RNA_def_struct_ui_text(), wmOperatorType::rna_ext, RNA_struct_translation_context(), ExtensionRNA::srna, wmOperatorType::srna, wmOperatorType::translation_context, UNDOCUMENTED_OPERATOR_TIP, WM_LOG_OPERATORS, wm_macro_cancel(), wm_macro_exec(), wm_macro_invoke(), wm_macro_modal(), and WM_operatortype_find().
Referenced by ED_operatormacros_action(), ED_operatormacros_armature(), ED_operatormacros_clip(), ED_operatormacros_curve(), ED_operatormacros_gpencil(), ED_operatormacros_graph(), ED_operatormacros_mask(), ED_operatormacros_mesh(), ED_operatormacros_metaball(), ED_operatormacros_nla(), ED_operatormacros_node(), ED_operatormacros_object(), ED_operatormacros_paint(), ED_operatormacros_sequencer(), and ED_operatormacros_uvedit().
void WM_operatortype_append_macro_ptr | ( | void(*)(wmOperatorType *, void *) | opfunc, |
void * | userdata | ||
) |
Definition at line 501 of file wm_operator_type.c.
References BLENDER_RNA, BLI_assert, BLI_ghash_insert(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, global_ops_hash, wmOperatorType::idname, wmOperatorType::invoke, MEM_callocN, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_MACRO, ot, wmOperatorType::poll, RNA_def_struct_identifier(), RNA_def_struct_ptr(), RNA_def_struct_translation_context(), RNA_def_struct_ui_text(), wmOperatorType::srna, wmOperatorType::translation_context, UNDOCUMENTED_OPERATOR_TIP, wm_macro_cancel(), wm_macro_exec(), wm_macro_invoke(), and wm_macro_modal().
void WM_operatortype_append_ptr | ( | void(*)(wmOperatorType *, void *) | opfunc, |
void * | userdata | ||
) |
Definition at line 130 of file wm_operator_type.c.
References ot, wm_operatortype_append__begin(), and wm_operatortype_append__end().
char* WM_operatortype_description | ( | struct bContext * | C, |
struct wmOperatorType * | ot, | ||
struct PointerRNA * | properties | ||
) |
Definition at line 576 of file wm_operator_type.c.
References BLI_strdup(), C, wmOperatorType::get_description, MEM_freeN, NULL, ot, RNA_struct_ui_description(), and wmOperatorType::srna.
Referenced by UI_but_extra_icon_string_info_get(), UI_but_string_info_get(), and WM_operatortype_description_or_name().
char* WM_operatortype_description_or_name | ( | struct bContext * | C, |
struct wmOperatorType * | ot, | ||
struct PointerRNA * | properties | ||
) |
Use when we want a label, preferring the description.
Definition at line 598 of file wm_operator_type.c.
References BLI_strdup(), C, NULL, ot, WM_operatortype_description(), and WM_operatortype_name().
Referenced by ui_tooltip_data_from_gizmo().
wmOperatorType* WM_operatortype_find | ( | const char * | idname, |
bool | quiet | ||
) |
Definition at line 51 of file wm_operator_type.c.
References BLI_ghash_lookup(), CLOG_INFO, global_ops_hash, NULL, OP_MAX_TYPENAME, ot, WM_LOG_OPERATORS, and WM_operator_bl_idname().
Referenced by add_driver_button_menu_exec(), bone_mouse_select_menu(), constraint_reorder(), doc_view_manual_ui_context_exec(), ED_object_mode_compat_set(), ED_object_mode_set_ex(), file_browse_invoke(), file_directory_enter_handle(), ghost_event_proc(), gizmo2d_resize_setup(), gizmo2d_rotate_setup(), gizmo2d_xform_setup(), gizmo_mesh_extrude_setup(), gizmo_mesh_spin_init_setup(), gizmo_mesh_spin_redo_setup(), gizmogroup_init_properties_from_twtype(), gpencil_modifier_reorder(), id_remap_fn(), image_file_browse_invoke(), keymap_handler_log_kmi_op_str(), lib_reload_fn(), lib_relocate_fn(), blender::ed::space_node::link_drag_search_exec_fn(), modifier_reorder(), blender::nodes::node_composite_output_file_cc::node_composit_buts_file_output_ex(), object_mouse_select_menu(), ot_lookup_from_py_string(), outliner_item_drag_drop_invoke(), outliner_lib_relocate_invoke_do(), outliner_operator_menu(), panel_activate_state(), poselib_add_menu_invoke__replacemenu(), pyop_as_string(), pyop_call(), pyop_poll(), PYOP_wrap_macro_define(), screen_user_menu_draw(), sculpt_detail_size_set_radial_control(), shaderfx_reorder(), template_operator_property_buts_draw_single(), transform_from_gizmo_invoke(), transform_modal(), ui_but_anim_decorate_cb(), UI_but_extra_operator_icon_add(), UI_but_is_tool(), ui_but_menu_add_path_operators(), UI_but_operatortype_get_from_enum_menu(), ui_but_predefined_extra_operator_icons_add(), UI_list_custom_activate_operator_set(), UI_list_custom_drag_operator_set(), ui_popup_context_menu_for_button(), ui_tooltip_data_from_tool(), uiDefButO(), uiDefIconButO(), uiDefIconTextButO(), uiItemBooleanO(), uiItemEnumO(), uiItemEnumO_string(), uiItemEnumO_value(), uiItemFloatO(), uiItemFullO(), uiItemIntO(), uiItemMenuEnumFullO(), uiItemsFullEnumO(), uiItemStringO(), uiTemplateEditModeSelection(), unpack_menu(), view3d_interactive_add_modal(), view3d_lightcache_update(), view3d_panel_vgroup(), WIDGETGROUP_light_target_setup(), WIDGETGROUP_navigate_setup(), WIDGETGROUP_ruler_setup(), WIDGETGROUP_xform_cage_setup(), WIDGETGROUP_xform_shear_setup(), WM_dropbox_add(), WM_event_match_keymap_item(), wm_handler_operator_call(), wm_handlers_do_gizmo_handler(), wm_keymap_item_find(), wm_keymap_item_find_in_keymap(), wm_keymap_item_properties_update_ot(), WM_menu_name_call(), WM_modalkeymap_assign(), WM_operator_check_ui_empty(), wm_operator_create(), WM_operator_name_call(), WM_operator_name_call_ptr(), WM_operator_name_call_ptr_with_depends_on_cursor(), WM_operator_name_call_with_properties(), WM_operator_name_poll(), WM_operator_poll(), WM_operator_properties_create(), WM_operator_repeat_check(), WM_operatortype_append_macro(), WM_operatortype_macro_define(), WM_operatortype_remove(), WM_operatortype_remove_ptr(), wm_test_autorun_revert_action_exec(), WM_toolsystem_ref_set_by_id_ex(), WM_window_cursor_keymap_status_refresh(), WM_xr_actionmap_item_properties_update_ot(), and workspace_add_menu().
Definition at line 197 of file wm_operator_type.c.
References BLI_ghash_free(), global_ops_hash, NULL, and operatortype_ghash_free_cb().
Referenced by WM_exit_ex().
|
static |
Definition at line 554 of file wm_operator_type.c.
References BLI_freelistN(), LISTBASE_FOREACH, wmOperatorType::macro, MEM_freeN, ot, and WM_operator_properties_free().
Referenced by operatortype_ghash_free_cb(), and WM_operatortype_remove_ptr().
void WM_operatortype_idname_visit_for_search | ( | const bContext * | UNUSEDC, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
const char * | UNUSEDedit_text, | ||
StringPropertySearchVisitFunc | visit_fn, | ||
void * | visit_user_data | ||
) |
Definition at line 249 of file wm_operator_type.c.
References BLI_ghashIterator_getValue(), GHASH_ITER, global_ops_hash, wmOperatorType::idname, StringPropertySearchVisitParams::info, wmOperatorType::name, NULL, OP_MAX_TYPENAME, ot, StringPropertySearchVisitParams::text, and WM_operator_py_idname().
Called on initialize WM_init().
Definition at line 173 of file wm_operator_type.c.
References BLI_ghash_str_new_ex(), and global_ops_hash.
Referenced by WM_init().
void WM_operatortype_iter | ( | struct GHashIterator * | ghi | ) |
Definition at line 79 of file wm_operator_type.c.
References BLI_ghashIterator_init(), and global_ops_hash.
Referenced by menu_items_from_all_operators(), operator_search_update_fn(), pyop_dir(), and WM_operatortype_last_properties_clear_all().
Remove memory of all previously executed tools.
Definition at line 234 of file wm_operator_type.c.
References BLI_ghashIterator_done(), BLI_ghashIterator_getValue(), BLI_ghashIterator_step(), IDP_FreeProperty(), wmOperatorType::last_properties, NULL, ot, and WM_operatortype_iter().
Referenced by wm_file_read_post().
wmOperatorTypeMacro* WM_operatortype_macro_define | ( | wmOperatorType * | ot, |
const char * | idname | ||
) |
Definition at line 530 of file wm_operator_type.c.
References BLI_addtail(), BLI_strncpy(), wmOperatorType::description, wmOperatorTypeMacro::idname, wmOperatorType::idname, wmOperatorType::macro, MEM_callocN, wmOperatorType::name, OP_MAX_TYPENAME, ot, wmOperatorTypeMacro::properties, wmOperatorTypeMacro::ptr, RNA_def_pointer_runtime(), wmOperatorType::srna, WM_operator_properties_alloc(), WM_operator_properties_sanitize(), and WM_operatortype_find().
Referenced by ED_operatormacros_action(), ED_operatormacros_armature(), ED_operatormacros_clip(), ED_operatormacros_curve(), ED_operatormacros_gpencil(), ED_operatormacros_graph(), ED_operatormacros_mask(), ED_operatormacros_mesh(), ED_operatormacros_metaball(), ED_operatormacros_nla(), ED_operatormacros_node(), ED_operatormacros_object(), ED_operatormacros_paint(), ED_operatormacros_sequencer(), ED_operatormacros_uvedit(), and PYOP_wrap_macro_define().
const char* WM_operatortype_name | ( | struct wmOperatorType * | ot, |
struct PointerRNA * | properties | ||
) |
Definition at line 565 of file wm_operator_type.c.
References wmOperatorType::get_name, NULL, ot, RNA_struct_ui_name(), and wmOperatorType::srna.
Referenced by dropbox_tooltip(), file_panel_operator_header(), fileselect_ensure_updated_file_params(), hud_panel_operator_redo_draw_header(), insert_key_menu_invoke(), menu_items_from_ui_create_item_from_button(), outliner_operator_menu(), repeat_history_invoke(), screen_area_options_invoke(), template_operator_property_buts_draw_single(), UI_but_extra_icon_string_info_get(), UI_but_string_info_get(), ui_def_but_operator_ptr(), uiItemFullO_ptr_ex(), uiItemMenuEnumFullO_ptr(), uiTemplateOperatorRedoProperties(), wm_enum_search_menu(), WM_menu_invoke_ex(), WM_operatortype_description_or_name(), and WM_window_cursor_keymap_status_refresh().
void WM_operatortype_props_advanced_begin | ( | struct wmOperatorType * | ot | ) |
Tag all operator-properties of ot defined after calling this, until the next WM_operatortype_props_advanced_end call (if available), with OP_PROP_TAG_ADVANCED. Previously defined ones properties not touched.
Calling this multiple times without a call to WM_operatortype_props_advanced_end, all calls after the first one are ignored. Meaning all proprieties defined after the first call are tagged as advanced.
This doesn't do the actual tagging, WM_operatortype_props_advanced_end does which is called for all operators during registration (see wm_operatortype_append__end).
Definition at line 203 of file wm_operator_type.c.
References ot, ot_prop_basic_count, RNA_struct_count_properties(), and wmOperatorType::srna.
Referenced by MESH_OT_loopcut(), MESH_OT_mark_seam(), MESH_OT_merge(), MESH_OT_subdivide(), MESH_OT_vertices_smooth(), MESH_OT_vertices_smooth_laplacian(), TRANSFORM_OT_bbone_resize(), TRANSFORM_OT_bend(), TRANSFORM_OT_create_orientation(), TRANSFORM_OT_edge_bevelweight(), TRANSFORM_OT_edge_crease(), TRANSFORM_OT_edge_slide(), TRANSFORM_OT_push_pull(), TRANSFORM_OT_resize(), TRANSFORM_OT_rotate(), TRANSFORM_OT_seq_slide(), TRANSFORM_OT_shear(), TRANSFORM_OT_shrink_fatten(), TRANSFORM_OT_skin_resize(), TRANSFORM_OT_tilt(), TRANSFORM_OT_tosphere(), TRANSFORM_OT_trackball(), TRANSFORM_OT_transform(), TRANSFORM_OT_translate(), TRANSFORM_OT_vert_crease(), and TRANSFORM_OT_vert_slide().
void WM_operatortype_props_advanced_end | ( | struct wmOperatorType * | ot | ) |
Tags all operator-properties of ot defined since the first WM_operatortype_props_advanced_begin call, or the last WM_operatortype_props_advanced_end call, with OP_PROP_TAG_ADVANCED.
Definition at line 211 of file wm_operator_type.c.
References counter, OP_PROP_TAG_ADVANCED, ot, ot_prop_basic_count, RNA_STRUCT_BEGIN, RNA_STRUCT_END, WM_operator_properties_create_ptr(), and WM_operatortype_prop_tag.
Referenced by wm_operatortype_append__end().
bool WM_operatortype_remove | ( | const char * | idname | ) |
Definition at line 160 of file wm_operator_type.c.
References NULL, ot, WM_operatortype_find(), and WM_operatortype_remove_ptr().
void WM_operatortype_remove_ptr | ( | struct wmOperatorType * | ot | ) |
Called on initialize WM_exit().
Definition at line 139 of file wm_operator_type.c.
References BLENDER_RNA, BLI_assert, BLI_ghash_remove(), ListBase::first, global_ops_hash, wmOperatorType::idname, IDP_FreeProperty(), wmOperatorType::last_properties, wmOperatorType::macro, MEM_freeN, NULL, ot, RNA_struct_free(), wmOperatorType::srna, WM_keyconfig_update_operatortype(), WM_operatortype_find(), and wm_operatortype_free_macro().
Referenced by WM_operatortype_remove().
Definition at line 47 of file wm_operator_type.c.
Referenced by wm_operatortype_append__end(), WM_operatortype_append_macro(), WM_operatortype_append_macro_ptr(), WM_operatortype_find(), wm_operatortype_free(), WM_operatortype_idname_visit_for_search(), wm_operatortype_init(), WM_operatortype_iter(), and WM_operatortype_remove_ptr().
|
static |
Counter for operator-properties that should not be tagged with OP_PROP_TAG_ADVANCED.
Definition at line 49 of file wm_operator_type.c.
Referenced by wm_operatortype_append__begin(), WM_operatortype_props_advanced_begin(), and WM_operatortype_props_advanced_end().