Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_template_list.cc
| Show First 20 Lines • Show All 1,270 Lines • ▼ Show 20 Lines | uiTemplateList_ex(layout, | ||||
| rows, | rows, | ||||
| maxrows, | maxrows, | ||||
| layout_type, | layout_type, | ||||
| columns, | columns, | ||||
| flags, | flags, | ||||
| nullptr); | nullptr); | ||||
| } | } | ||||
| /** | |||||
| * \return: A RNA pointer for the operator properties. | |||||
| */ | |||||
| PointerRNA *UI_list_custom_activate_operator_set(uiList *ui_list, | PointerRNA *UI_list_custom_activate_operator_set(uiList *ui_list, | ||||
| const char *opname, | const char *opname, | ||||
| bool create_properties) | bool create_properties) | ||||
| { | { | ||||
| uiListDyn *dyn_data = ui_list->dyn_data; | uiListDyn *dyn_data = ui_list->dyn_data; | ||||
| dyn_data->custom_activate_optype = WM_operatortype_find(opname, false); | dyn_data->custom_activate_optype = WM_operatortype_find(opname, false); | ||||
| if (!dyn_data->custom_activate_optype) { | if (!dyn_data->custom_activate_optype) { | ||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| if (create_properties) { | if (create_properties) { | ||||
| PointerRNA *opptr = dyn_data->custom_activate_opptr; | PointerRNA *opptr = dyn_data->custom_activate_opptr; | ||||
| WM_operator_properties_alloc( | WM_operator_properties_alloc( | ||||
| &dyn_data->custom_activate_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname); | &dyn_data->custom_activate_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname); | ||||
| } | } | ||||
| return dyn_data->custom_activate_opptr; | return dyn_data->custom_activate_opptr; | ||||
| } | } | ||||
| /** | |||||
| * \return: A RNA pointer for the operator properties. | |||||
| */ | |||||
| PointerRNA *UI_list_custom_drag_operator_set(uiList *ui_list, | PointerRNA *UI_list_custom_drag_operator_set(uiList *ui_list, | ||||
| const char *opname, | const char *opname, | ||||
| bool create_properties) | bool create_properties) | ||||
| { | { | ||||
| uiListDyn *dyn_data = ui_list->dyn_data; | uiListDyn *dyn_data = ui_list->dyn_data; | ||||
| dyn_data->custom_drag_optype = WM_operatortype_find(opname, false); | dyn_data->custom_drag_optype = WM_operatortype_find(opname, false); | ||||
| if (!dyn_data->custom_drag_optype) { | if (!dyn_data->custom_drag_optype) { | ||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| if (create_properties) { | if (create_properties) { | ||||
| PointerRNA *opptr = dyn_data->custom_drag_opptr; | PointerRNA *opptr = dyn_data->custom_drag_opptr; | ||||
| WM_operator_properties_alloc( | WM_operator_properties_alloc( | ||||
| &dyn_data->custom_drag_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname); | &dyn_data->custom_drag_opptr, opptr ? (IDProperty **)&opptr->data : nullptr, opname); | ||||
| } | } | ||||
| return dyn_data->custom_drag_opptr; | return dyn_data->custom_drag_opptr; | ||||
| } | } | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name List-types Registration | /** \name List-types Registration | ||||
| * \{ */ | * \{ */ | ||||
| void ED_uilisttypes_ui(void) | void ED_uilisttypes_ui() | ||||
| { | { | ||||
| WM_uilisttype_add(UI_UL_asset_view()); | WM_uilisttype_add(UI_UL_asset_view()); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||