Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editfont.c
| Show First 20 Lines • Show All 1,738 Lines • ▼ Show 20 Lines | |||||
| /* **************** Open Font ************** */ | /* **************** Open Font ************** */ | ||||
| static void font_ui_template_init(bContext *C, wmOperator *op) | static void font_ui_template_init(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| PropertyPointerRNA *pprop; | PropertyPointerRNA *pprop; | ||||
| op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA"); | op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA"); | ||||
| uiIDContextProperty(C, &pprop->ptr, &pprop->prop); | UI_context_active_but_prop_get_templateID(C, &pprop->ptr, &pprop->prop); | ||||
| } | } | ||||
| static void font_open_cancel(bContext *UNUSED(C), wmOperator *op) | static void font_open_cancel(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| MEM_freeN(op->customdata); | MEM_freeN(op->customdata); | ||||
| op->customdata = NULL; | op->customdata = NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
| static int font_unlink_exec(bContext *C, wmOperator *op) | static int font_unlink_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| VFont *builtin_font; | VFont *builtin_font; | ||||
| PointerRNA idptr; | PointerRNA idptr; | ||||
| PropertyPointerRNA pprop; | PropertyPointerRNA pprop; | ||||
| uiIDContextProperty(C, &pprop.ptr, &pprop.prop); | UI_context_active_but_prop_get_templateID(C, &pprop.ptr, &pprop.prop); | ||||
| if (pprop.prop == NULL) { | if (pprop.prop == NULL) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Incorrect context for running font unlink"); | BKE_report(op->reports, RPT_ERROR, "Incorrect context for running font unlink"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| builtin_font = BKE_vfont_builtin_get(); | builtin_font = BKE_vfont_builtin_get(); | ||||
| ▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines | |||||