Blender V4.3
wm_operator_type.cc File Reference
#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.hh"
#include "BLI_blenlib.h"
#include "BLI_map.hh"
#include "BLI_utildefines.h"
#include "BKE_context.hh"
#include "BKE_idprop.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_prototypes.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "wm.hh"
#include "wm_event_system.hh"

Go to the source code of this file.

Classes

struct  MacroData
 

Macros

#define UNDOCUMENTED_OPERATOR_TIP   N_("(undocumented operator)")
 

Functions

void WM_operatortype_remove_ptr (wmOperatorType *ot)
 
bool WM_operatortype_remove (const char *idname)
 
static void operatortype_ghash_free_cb (wmOperatorType *ot)
 
void wm_operatortype_free ()
 
void WM_operatortype_props_advanced_begin (wmOperatorType *ot)
 
void WM_operatortype_props_advanced_end (wmOperatorType *ot)
 
void WM_operatortype_last_properties_clear_all ()
 
void WM_operatortype_idname_visit_for_search (const bContext *, PointerRNA *, PropertyRNA *, const char *, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
 
Operator Macro Type
static void wm_operatortype_free_macro (wmOperatorType *ot)
 
static void wm_macro_start (wmOperator *op)
 
static int wm_macro_end (wmOperator *op, int retval)
 
static int wm_macro_exec (bContext *C, wmOperator *op)
 
static int wm_macro_invoke_internal (bContext *C, wmOperator *op, const wmEvent *event, wmOperator *opm)
 
static int wm_macro_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int wm_macro_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void wm_macro_cancel (bContext *C, wmOperator *op)
 
wmOperatorTypeWM_operatortype_append_macro (const char *idname, const char *name, const char *description, int flag)
 
void WM_operatortype_append_macro_ptr (void(*opfunc)(wmOperatorType *ot, void *userdata), void *userdata)
 
wmOperatorTypeMacroWM_operatortype_macro_define (wmOperatorType *ot, const char *idname)
 
std::string WM_operatortype_name (wmOperatorType *ot, PointerRNA *properties)
 
std::string WM_operatortype_description (bContext *C, wmOperatorType *ot, PointerRNA *properties)
 
std::string WM_operatortype_description_or_name (bContext *C, wmOperatorType *ot, PointerRNA *properties)
 
bool WM_operator_depends_on_cursor (bContext &C, wmOperatorType &ot, PointerRNA *properties)
 
Operator Type Append
static wmOperatorTypewm_operatortype_append__begin ()
 
static void wm_operatortype_append__end (wmOperatorType *ot)
 
void WM_operatortype_append (void(*opfunc)(wmOperatorType *))
 
void WM_operatortype_append_ptr (void(*opfunc)(wmOperatorType *, void *), void *userdata)
 

Operator Type Registry

static int ot_prop_basic_count = -1
 
static wmOperatorTypeMapget_operators_map ()
 
const wmOperatorTypeMapWM_operatortype_map ()
 
wmOperatorTypeWM_operatortype_find (const char *idname, bool quiet)
 

Detailed Description

Operator Registry.

Definition in file wm_operator_type.cc.

Macro Definition Documentation

◆ UNDOCUMENTED_OPERATOR_TIP

#define UNDOCUMENTED_OPERATOR_TIP   N_("(undocumented operator)")

Function Documentation

◆ get_operators_map()

◆ operatortype_ghash_free_cb()

◆ wm_macro_cancel()

static void wm_macro_cancel ( bContext * C,
wmOperator * op )
static

◆ wm_macro_end()

◆ wm_macro_exec()

◆ wm_macro_invoke()

static int wm_macro_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ wm_macro_invoke_internal()

◆ wm_macro_modal()

◆ wm_macro_start()

static void wm_macro_start ( wmOperator * op)
static

Definition at line 283 of file wm_operator_type.cc.

References wmOperator::customdata, and MEM_callocN.

Referenced by wm_macro_exec(), and wm_macro_invoke().

◆ WM_operator_depends_on_cursor()

bool WM_operator_depends_on_cursor ( bContext & C,
wmOperatorType & ot,
PointerRNA * properties )

◆ WM_operatortype_append()

void WM_operatortype_append ( void(* opfunc )(wmOperatorType *))

Definition at line 137 of file wm_operator_type.cc.

References ot, wm_operatortype_append__begin(), and wm_operatortype_append__end().

Referenced by action_operatortypes(), buttons_operatortypes(), clip_operatortypes(), blender::ed::object::collection_exporter_register(), console_operatortypes(), ED_operatortypes_anim(), ED_operatortypes_animchannels(), ED_operatortypes_armature(), ED_operatortypes_curve(), ED_operatortypes_edutils(), ED_operatortypes_geometry(), ED_operatortypes_gpencil_legacy(), ED_operatortypes_grease_pencil_bake_animation(), ED_operatortypes_grease_pencil_draw(), ED_operatortypes_grease_pencil_edit(), ED_operatortypes_grease_pencil_frames(), ED_operatortypes_grease_pencil_interpolate(), ED_operatortypes_grease_pencil_join(), ED_operatortypes_grease_pencil_layers(), ED_operatortypes_grease_pencil_lineart(), ED_operatortypes_grease_pencil_material(), ED_operatortypes_grease_pencil_modes(), ED_operatortypes_grease_pencil_primitives(), ED_operatortypes_grease_pencil_select(), ED_operatortypes_grease_pencil_trace(), ED_operatortypes_grease_pencil_vertex_paint(), ED_operatortypes_grease_pencil_weight_paint(), ED_operatortypes_io(), ED_operatortypes_lattice(), ED_operatortypes_marker(), ED_operatortypes_mask(), ED_operatortypes_mesh(), ED_operatortypes_metaball(), ED_operatortypes_paint(), ED_operatortypes_render(), ED_operatortypes_scene(), ED_operatortypes_screen(), 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::nodes::node_geo_attribute_capture_cc::node_operators(), blender::nodes::node_geo_bake_cc::node_operators(), blender::nodes::node_geo_foreach_geometry_element_cc::output_node::node_operators(), blender::nodes::node_geo_index_switch_cc::node_operators(), blender::nodes::node_geo_menu_switch_cc::node_operators(), blender::nodes::node_geo_repeat_cc::repeat_output_node::node_operators(), blender::nodes::node_geo_simulation_cc::sim_output_node::node_operators(), blender::ed::space_node::node_operatortypes(), blender::ed::object::object_modifier_add_asset_register(), blender::ed::asset::operatortypes_asset(), operatortypes_boids(), blender::ed::curves::operatortypes_curves(), operatortypes_dynamicpaint(), operatortypes_fluid(), blender::ed::object::operatortypes_object(), operatortypes_particle(), operatortypes_pointcache(), blender::ed::sculpt_paint::operatortypes_sculpt(), blender::ed::outliner::outliner_operatortypes(), script_operatortypes(), sequencer_operatortypes(), blender::ed::spreadsheet::spreadsheet_operatortypes(), text_operatortypes(), transform_operatortypes(), view3d_operatortypes(), wm_operatortypes_register(), and wm_xr_operatortypes_register().

◆ wm_operatortype_append__begin()

◆ wm_operatortype_append__end()

◆ WM_operatortype_append_macro()

wmOperatorType * WM_operatortype_append_macro ( const char * idname,
const char * name,
const char * description,
int flag )

◆ WM_operatortype_append_macro_ptr()

◆ WM_operatortype_append_ptr()

void WM_operatortype_append_ptr ( void(* opfunc )(wmOperatorType *, void *),
void * userdata )

◆ WM_operatortype_description()

◆ WM_operatortype_description_or_name()

std::string WM_operatortype_description_or_name ( bContext * C,
wmOperatorType * ot,
PointerRNA * properties )

Use when we want a label, preferring the description.

Definition at line 601 of file wm_operator_type.cc.

References ot, WM_operatortype_description(), and WM_operatortype_name().

Referenced by ui_tooltip_data_from_gizmo().

◆ WM_operatortype_find()

wmOperatorType * WM_operatortype_find ( const char * idname,
bool quiet )

Definition at line 68 of file wm_operator_type.cc.

References CLOG_INFO, get_operators_map(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default_as(), OP_MAX_TYPENAME, ot, WM_LOG_OPERATORS, and WM_operator_bl_idname().

Referenced by add_driver_button_menu_exec(), bone_mouse_select_menu(), blender::ed::geometry::catalog_assets_draw(), blender::ed::object::catalog_assets_draw(), blender::ed::geometry::catalog_assets_draw_unassigned(), blender::ed::object::collection_exporter_add_exec(), blender::ed::object::collection_exporter_export(), blender::ed::object::collection_exporter_menu_draw(), constraint_reorder(), blender::ed::asset::shelf::create_activate_operator_params(), doc_view_manual_ui_context_exec(), drop_import_file_poll_file_handlers(), drop_import_file_tooltip(), file_browse_invoke(), file_directory_enter_handle(), file_draw_invalid_asset_library_hint(), file_external_operation_exec(), file_handler_import_operator_create_ptr(), file_os_operations_menu_draw(), 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(), blender::ed::outliner::id_remap_fn(), image_file_browse_invoke(), is_brush_related_tool(), keymap_handler_log_kmi_op_str(), blender::ed::outliner::lib_reload_fn(), blender::ed::outliner::lib_relocate_fn(), blender::ed::space_node::link_drag_search_exec_fn(), menu_item_enum_opname_menu_active(), blender::ed::object::mode_compat_set(), blender::ed::object::mode_set_ex(), modifier_reorder(), blender::ed::space_node::node_add_group_asset_invoke(), blender::nodes::node_composite_file_output_cc::node_composit_buts_file_output_ex(), object_mouse_select_menu(), ot_lookup_from_py_string(), blender::ed::outliner::outliner_item_drag_drop_invoke(), blender::ed::outliner::outliner_lib_relocate_invoke_do(), blender::ed::outliner::outliner_operator_menu(), panel_activate_state(), preferences_extension_url_drop_invoke(), pyop_as_string(), pyop_call(), pyop_poll(), PYOP_wrap_macro_define(), screen_user_menu_draw(), shaderfx_reorder(), blender::ed::transform::special_aftertrans_update__node(), template_operator_property_buts_draw_single(), toolsystem_ref_set_by_brush_type(), 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_handle_menu_letter_press_search(), UI_list_custom_activate_operator_set(), UI_list_custom_drag_operator_set(), ui_popup_context_menu_for_button(), uiDefButO(), uiDefIconButO(), uiDefIconTextButO(), uiItemBooleanO(), uiItemEnumO(), uiItemEnumO_string(), uiItemEnumO_value(), uiItemFloatO(), uiItemFullO(), uiItemIntO(), uiItemMenuEnumFullO(), uiItemsFullEnumO(), uiItemStringO(), uiTemplateCollectionExporters(), uiTemplateEditModeSelection(), blender::ed::object::unassigned_assets_draw(), unpack_menu(), view3d_interactive_add_modal(), view3d_navigate_modal_fn(), view3d_panel_vgroup(), weight_sample_group_invoke(), WIDGETGROUP_light_target_setup(), WIDGETGROUP_navigate_setup(), WIDGETGROUP_navigate_setup(), WIDGETGROUP_ruler_setup(), WIDGETGROUP_xform_cage_setup(), WIDGETGROUP_xform_shear_setup(), wm_drop_import_file_exec(), wm_drop_import_file_invoke(), WM_dropbox_add(), wm_dropbox_item_update_ot(), 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_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_operator_ui_poll(), 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().

◆ wm_operatortype_free()

void wm_operatortype_free ( )

Definition at line 205 of file wm_operator_type.cc.

References get_operators_map(), operatortype_ghash_free_cb(), and ot.

Referenced by WM_exit_ex().

◆ wm_operatortype_free_macro()

static void wm_operatortype_free_macro ( wmOperatorType * ot)
static

◆ WM_operatortype_idname_visit_for_search()

◆ WM_operatortype_last_properties_clear_all()

void WM_operatortype_last_properties_clear_all ( )

◆ WM_operatortype_macro_define()

◆ WM_operatortype_map()

const wmOperatorTypeMap & WM_operatortype_map ( )

◆ WM_operatortype_name()

◆ WM_operatortype_props_advanced_begin()

void WM_operatortype_props_advanced_begin ( wmOperatorType * ot)

◆ WM_operatortype_props_advanced_end()

void WM_operatortype_props_advanced_end ( 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.

Note
This is called for all operators during registration (see wm_operatortype_append__end). So it does not need to be explicitly called in operator-type definition.

Definition at line 222 of file wm_operator_type.cc.

References 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().

◆ WM_operatortype_remove()

bool WM_operatortype_remove ( const char * idname)

Definition at line 174 of file wm_operator_type.cc.

References ot, WM_operatortype_find(), and WM_operatortype_remove_ptr().

◆ WM_operatortype_remove_ptr()

Variable Documentation

◆ ot_prop_basic_count

int ot_prop_basic_count = -1
static

Counter for operator-properties that should not be tagged with OP_PROP_TAG_ADVANCED.

Definition at line 66 of file wm_operator_type.cc.

Referenced by wm_operatortype_append__begin(), WM_operatortype_props_advanced_begin(), and WM_operatortype_props_advanced_end().