Blender  V2.93
interface_ops.c File Reference
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_text_types.h"
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
#include "BLF_api.h"
#include "BLT_lang.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_override.h"
#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "BKE_text.h"
#include "IMB_colormanagement.h"
#include "DEG_depsgraph.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
#include "UI_interface.h"
#include "interface_intern.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_paint.h"
#include "ED_keyframing.h"
#include "BKE_main.h"
#include "BLI_ghash.h"
#include "ED_screen.h"
#include "ED_text.h"

Go to the source code of this file.

Functions

Copy Data Path Operator
static bool copy_data_path_button_poll (bContext *C)
 
static int copy_data_path_button_exec (bContext *C, wmOperator *op)
 
static void UI_OT_copy_data_path_button (wmOperatorType *ot)
 
Copy As Driver Operator
static bool copy_as_driver_button_poll (bContext *C)
 
static int copy_as_driver_button_exec (bContext *C, wmOperator *op)
 
static void UI_OT_copy_as_driver_button (wmOperatorType *ot)
 
Copy Python Command Operator
static bool copy_python_command_button_poll (bContext *C)
 
static int copy_python_command_button_exec (bContext *C, wmOperator *UNUSED(op))
 
static void UI_OT_copy_python_command_button (wmOperatorType *ot)
 
Reset to Default Values Button Operator
static int operator_button_property_finish (bContext *C, PointerRNA *ptr, PropertyRNA *prop)
 
static bool reset_default_button_poll (bContext *C)
 
static int reset_default_button_exec (bContext *C, wmOperator *op)
 
static void UI_OT_reset_default_button (wmOperatorType *ot)
 
Assign Value as Default Button Operator
static bool assign_default_button_poll (bContext *C)
 
static int assign_default_button_exec (bContext *C, wmOperator *UNUSED(op))
 
static void UI_OT_assign_default_button (wmOperatorType *ot)
 
Unset Property Button Operator
static int unset_property_button_exec (bContext *C, wmOperator *UNUSED(op))
 
static void UI_OT_unset_property_button (wmOperatorType *ot)
 
Jump to Target Operator
static bool jump_to_target_ptr (bContext *C, PointerRNA ptr, const bool poll)
 
static bool jump_to_target_button (bContext *C, bool poll)
 
bool ui_jump_to_target_button_poll (bContext *C)
 
static int jump_to_target_button_exec (bContext *C, wmOperator *UNUSED(op))
 
static void UI_OT_jump_to_target_button (wmOperatorType *ot)
 
Reload Translation Operator
static int reloadtranslation_exec (bContext *UNUSED(C), wmOperator *UNUSED(op))
 
static void UI_OT_reloadtranslation (wmOperatorType *ot)
 
Press Button Operator
static int ui_button_press_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void UI_OT_button_execute (wmOperatorType *ot)
 
Text Button Clear Operator
static int button_string_clear_exec (bContext *C, wmOperator *UNUSED(op))
 
static void UI_OT_button_string_clear (wmOperatorType *ot)
 
Drop Color Operator
bool UI_drop_color_poll (struct bContext *C, wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
void UI_drop_color_copy (wmDrag *drag, wmDropBox *drop)
 
static int drop_color_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void UI_OT_drop_color (wmOperatorType *ot)
 
Operator & Keymap Registration
void ED_operatortypes_ui (void)
 
void ED_keymap_ui (wmKeyConfig *keyconf)
 User Interface Keymap. More...
 

Copy To Selected Operator

#define NOT_NULL(assignment)   ((assignment) != NULL)
 
#define NOT_RNA_NULL(assignment)   ((assignment).data != NULL)
 
static void ui_context_selected_bones_via_pose (bContext *C, ListBase *r_lb)
 
bool UI_context_copy_to_selected_list (bContext *C, PointerRNA *ptr, PropertyRNA *prop, ListBase *r_lb, bool *r_use_path_from_id, char **r_path)
 
static bool copy_to_selected_button (bContext *C, bool all, bool poll)
 
static bool copy_to_selected_button_poll (bContext *C)
 
static int copy_to_selected_button_exec (bContext *C, wmOperator *op)
 
static void UI_OT_copy_to_selected_button (wmOperatorType *ot)
 

Define Override Type Operator

enum  { UIOverride_Type_NOOP = 0 , UIOverride_Type_Replace = 1 , UIOverride_Type_Difference = 2 , UIOverride_Type_Factor = 3 }
 
static EnumPropertyItem override_type_items []
 
static bool override_type_set_button_poll (bContext *C)
 
static int override_type_set_button_exec (bContext *C, wmOperator *op)
 
static int override_type_set_button_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static void UI_OT_override_type_set_button (wmOperatorType *ot)
 
static bool override_remove_button_poll (bContext *C)
 
static int override_remove_button_exec (bContext *C, wmOperator *op)
 
static void UI_OT_override_remove_button (wmOperatorType *ot)
 

Macro Definition Documentation

◆ NOT_NULL

#define NOT_NULL (   assignment)    ((assignment) != NULL)

Definition at line 717 of file interface_ops.c.

◆ NOT_RNA_NULL

#define NOT_RNA_NULL (   assignment)    ((assignment).data != NULL)

Definition at line 718 of file interface_ops.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UIOverride_Type_NOOP 
UIOverride_Type_Replace 
UIOverride_Type_Difference 
UIOverride_Type_Factor 

Definition at line 474 of file interface_ops.c.

Function Documentation

◆ assign_default_button_exec()

static int assign_default_button_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ assign_default_button_poll()

static bool assign_default_button_poll ( bContext C)
static

◆ button_string_clear_exec()

static int button_string_clear_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ copy_as_driver_button_exec()

static int copy_as_driver_button_exec ( bContext C,
wmOperator op 
)
static

◆ copy_as_driver_button_poll()

static bool copy_as_driver_button_poll ( bContext C)
static

◆ copy_data_path_button_exec()

static int copy_data_path_button_exec ( bContext C,
wmOperator op 
)
static

◆ copy_data_path_button_poll()

static bool copy_data_path_button_poll ( bContext C)
static

◆ copy_python_command_button_exec()

static int copy_python_command_button_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ copy_python_command_button_poll()

static bool copy_python_command_button_poll ( bContext C)
static

Definition at line 245 of file interface_ops.c.

References C, NULL, uiBut::optype, and UI_context_active_but_get().

Referenced by UI_OT_copy_python_command_button().

◆ copy_to_selected_button()

static bool copy_to_selected_button ( bContext C,
bool  all,
bool  poll 
)
static

Called from both exec & poll.

Note
Normally we wouldn't call a loop from within a poll function, however this is a special case, and for regular poll calls, getting the context from the button will fail early.

Definition at line 963 of file interface_ops.c.

References all(), BLI_freelistN(), BLI_listbase_is_empty(), C, CTX_data_main(), PointerRNA::data, LISTBASE_FOREACH, MEM_SAFE_FREE, NULL, ptr, RNA_id_pointer_create(), RNA_path_resolve_property(), RNA_property_copy(), RNA_property_editable(), RNA_property_update(), UI_context_active_but_prop_get(), and UI_context_copy_to_selected_list().

Referenced by copy_to_selected_button_exec(), and copy_to_selected_button_poll().

◆ copy_to_selected_button_exec()

static int copy_to_selected_button_exec ( bContext C,
wmOperator op 
)
static

◆ copy_to_selected_button_poll()

static bool copy_to_selected_button_poll ( bContext C)
static

Definition at line 1027 of file interface_ops.c.

References C, and copy_to_selected_button().

Referenced by UI_OT_copy_to_selected_button().

◆ drop_color_invoke()

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

◆ ED_keymap_ui()

void ED_keymap_ui ( wmKeyConfig keyconf)

User Interface Keymap.

Definition at line 1878 of file interface_ops.c.

References eyedropper_colorband_modal_keymap(), eyedropper_modal_keymap(), and WM_keymap_ensure().

Referenced by ED_spacetypes_keymap().

◆ ED_operatortypes_ui()

void ED_operatortypes_ui ( void  )

◆ jump_to_target_button()

static bool jump_to_target_button ( bContext C,
bool  poll 
)
static

Jump to the object or bone referred to by the current UI field value.

Note
quite heavy for a poll callback, but the operator is only used as a right click menu item for certain UI field types, and this will fail quickly if the context is completely unsuitable.

Definition at line 1134 of file interface_ops.c.

References uiButSearch::arg, C, PointerRNA::data, uiButSearch::items_update_fn, jump_to_target_ptr(), MAXBONENAME, MEM_freeN, NULL, PROP_POINTER, PROP_STRING, ptr, RNA_property_collection_lookup_string(), RNA_property_pointer_get(), RNA_property_string_get_alloc(), RNA_property_type(), uiRNACollectionSearch::search_prop, uiRNACollectionSearch::search_ptr, uiBut::type, type, UI_BTYPE_SEARCH_MENU, UI_context_active_but_get(), UI_context_active_but_prop_get(), and ui_rna_collection_search_update_fn().

Referenced by jump_to_target_button_exec(), and ui_jump_to_target_button_poll().

◆ jump_to_target_button_exec()

static int jump_to_target_button_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ jump_to_target_ptr()

static bool jump_to_target_ptr ( bContext C,
PointerRNA  ptr,
const bool  poll 
)
static

◆ operator_button_property_finish()

static int operator_button_property_finish ( bContext C,
PointerRNA ptr,
PropertyRNA prop 
)
static

◆ override_remove_button_exec()

static int override_remove_button_exec ( bContext C,
wmOperator op 
)
static

◆ override_remove_button_poll()

static bool override_remove_button_poll ( bContext C)
static

◆ override_type_set_button_exec()

static int override_type_set_button_exec ( bContext C,
wmOperator op 
)
static

◆ override_type_set_button_invoke()

static int override_type_set_button_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ override_type_set_button_poll()

static bool override_type_set_button_poll ( bContext C)
static

◆ reloadtranslation_exec()

static int reloadtranslation_exec ( bContext UNUSEDC,
wmOperator UNUSEDop 
)
static

◆ reset_default_button_exec()

static int reset_default_button_exec ( bContext C,
wmOperator op 
)
static

◆ reset_default_button_poll()

static bool reset_default_button_poll ( bContext C)
static

◆ ui_button_press_invoke()

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

◆ UI_context_copy_to_selected_list()

bool UI_context_copy_to_selected_list ( bContext C,
PointerRNA ptr,
PropertyRNA prop,
ListBase r_lb,
bool *  r_use_path_from_id,
char **  r_path 
)

◆ ui_context_selected_bones_via_pose()

static void ui_context_selected_bones_via_pose ( bContext C,
ListBase r_lb 
)
static

◆ UI_drop_color_copy()

void UI_drop_color_copy ( wmDrag drag,
wmDropBox drop 
)

◆ UI_drop_color_poll()

bool UI_drop_color_poll ( struct bContext C,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)

◆ ui_jump_to_target_button_poll()

bool ui_jump_to_target_button_poll ( bContext C)

Definition at line 1181 of file interface_ops.c.

References C, and jump_to_target_button().

Referenced by UI_OT_jump_to_target_button(), and ui_popup_context_menu_for_button().

◆ UI_OT_assign_default_button()

static void UI_OT_assign_default_button ( wmOperatorType ot)
static

◆ UI_OT_button_execute()

static void UI_OT_button_execute ( wmOperatorType ot)
static

◆ UI_OT_button_string_clear()

static void UI_OT_button_string_clear ( wmOperatorType ot)
static

◆ UI_OT_copy_as_driver_button()

static void UI_OT_copy_as_driver_button ( wmOperatorType ot)
static

◆ UI_OT_copy_data_path_button()

static void UI_OT_copy_data_path_button ( wmOperatorType ot)
static

◆ UI_OT_copy_python_command_button()

static void UI_OT_copy_python_command_button ( wmOperatorType ot)
static

◆ UI_OT_copy_to_selected_button()

static void UI_OT_copy_to_selected_button ( wmOperatorType ot)
static

◆ UI_OT_drop_color()

static void UI_OT_drop_color ( wmOperatorType ot)
static

◆ UI_OT_jump_to_target_button()

static void UI_OT_jump_to_target_button ( wmOperatorType ot)
static

◆ UI_OT_override_remove_button()

static void UI_OT_override_remove_button ( wmOperatorType ot)
static

◆ UI_OT_override_type_set_button()

static void UI_OT_override_type_set_button ( wmOperatorType ot)
static

◆ UI_OT_reloadtranslation()

static void UI_OT_reloadtranslation ( wmOperatorType ot)
static

◆ UI_OT_reset_default_button()

static void UI_OT_reset_default_button ( wmOperatorType ot)
static

◆ UI_OT_unset_property_button()

static void UI_OT_unset_property_button ( wmOperatorType ot)
static

◆ unset_property_button_exec()

static int unset_property_button_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Variable Documentation

◆ override_type_items

EnumPropertyItem override_type_items[]
static
Initial value:
= {
"NOOP",
0,
"NoOp",
"'No-Operation', place holder preventing automatic override to ever affect the property"},
"REPLACE",
0,
"Replace",
"Completely replace value from linked data by local one"},
"DIFFERENCE",
0,
"Difference",
"Store difference to linked data value"},
"FACTOR",
0,
"Factor",
"Store factor to linked data value (useful e.g. for scale)"},
{0, NULL, 0, NULL, NULL},
}
@ UIOverride_Type_Replace
@ UIOverride_Type_Difference
@ UIOverride_Type_NOOP
@ UIOverride_Type_Factor

Definition at line 482 of file interface_ops.c.

Referenced by UI_OT_override_type_set_button().