Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Context not available. | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_constraint_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| Context not available. | |||||
| but->imb_scale = scale; | but->imb_scale = scale; | ||||
| } | } | ||||
| void UI_but_drag_set_constraint(uiBut *but, PointerRNA *ptr) | |||||
sergey: Would suggest something like
void UI_but_drag_set_rna_type(uiBut *but, int type, PointerRNA… | |||||
Not Done Inline ActionsWM_DRAG_*** isn't private, so would prefer just to have UI_but_drag_set(uiBut *but, PointerRNA *ptr, int dragtype) which takes the WM_DRAG_*** argument too. Then it can be used anywhere. campbellbarton: `WM_DRAG_***` isn't private, so would prefer just to have `UI_but_drag_set(uiBut *but… | |||||
| { | |||||
| but->dragtype = WM_DRAG_CONSTRAINT; | |||||
| but->dragpoin = (void *)ptr; | |||||
| } | |||||
| void UI_but_drag_set_defgroup(uiBut *but, PointerRNA *ptr) | |||||
| { | |||||
| but->dragtype = WM_DRAG_DEFGROUP; | |||||
| but->dragpoin = (void *)ptr; | |||||
| } | |||||
| void UI_but_drag_set_modifier(uiBut *but, PointerRNA *ptr) | |||||
| { | |||||
| but->dragtype = WM_DRAG_MODIFIER; | |||||
| but->dragpoin = (void *)ptr; | |||||
| } | |||||
| PointerRNA *UI_but_operator_ptr_get(uiBut *but) | PointerRNA *UI_but_operator_ptr_get(uiBut *but) | ||||
| { | { | ||||
| if (but->optype && !but->opptr) { | if (but->optype && !but->opptr) { | ||||
| Context not available. | |||||
Would suggest something like
void UI_but_drag_set_rna_type(uiBut *but, int type, PointerRNA *ptr) { but->dragtype = type; but->dragpoin = (void *)ptr; }