Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_ops.c
| Show All 31 Lines | |||||
| UI_popup_menu_end(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static void SCREEN_OT_area_options(wmOperatorType *ot) | static void SCREEN_OT_area_options(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Area Options"; | ot->name = "Area Options"; | ||||
brecht: Make it `static bool`. | |||||
| ot->description = "Operations for splitting and merging"; | ot->description = "Operations for splitting and merging"; | ||||
| ot->idname = "SCREEN_OT_area_options"; | ot->idname = "SCREEN_OT_area_options"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = screen_area_options_invoke; | ot->invoke = screen_area_options_invoke; | ||||
| ot->poll = ED_operator_screen_mainwinactive; | ot->poll = ED_operator_screen_mainwinactive; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Repeat Last Operator | /** \name Repeat Last Operator | ||||
| * \{ */ | * \{ */ | ||||
| static bool repeat_history_poll(bContext *C) | |||||
| { | |||||
| if (!ED_operator_screenactive(C)) { | |||||
| return false; | |||||
| } | |||||
| wmWindowManager *wm = CTX_wm_manager(C); | |||||
| return !BLI_listbase_is_empty(&wm->operators); | |||||
| } | |||||
Not Done Inline ActionsMake it static bool. brecht: Make it `static bool`. | |||||
| static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) | static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmOperator *lastop = wm->operators.last; | wmOperator *lastop = wm->operators.last; | ||||
| /* Seek last registered operator */ | /* Seek last registered operator */ | ||||
| while (lastop) { | while (lastop) { | ||||
| if (lastop->type->flag & OPTYPE_REGISTER) { | if (lastop->type->flag & OPTYPE_REGISTER) { | ||||
| Show All 17 Lines | |||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Repeat Last"; | ot->name = "Repeat Last"; | ||||
| ot->description = "Repeat last action"; | ot->description = "Repeat last action"; | ||||
| ot->idname = "SCREEN_OT_repeat_last"; | ot->idname = "SCREEN_OT_repeat_last"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = repeat_last_exec; | ot->exec = repeat_last_exec; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = repeat_history_poll; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
Not Done Inline ActionsMake it static bool. brecht: Make it `static bool`. | |||||
| /** \name Repeat History Operator | /** \name Repeat History Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmOperator *lastop; | wmOperator *lastop; | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Repeat History"; | ot->name = "Repeat History"; | ||||
| ot->description = "Display menu for previous actions performed"; | ot->description = "Display menu for previous actions performed"; | ||||
| ot->idname = "SCREEN_OT_repeat_history"; | ot->idname = "SCREEN_OT_repeat_history"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = repeat_history_invoke; | ot->invoke = repeat_history_invoke; | ||||
| ot->exec = repeat_history_exec; | ot->exec = repeat_history_exec; | ||||
| ot->poll = repeat_history_poll; | |||||
| ot->poll = ED_operator_screenactive; | |||||
| RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, 1000); | RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, 1000); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Redo Operator | /** \name Redo Operator | ||||
| Show All 14 Lines | |||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Redo Last"; | ot->name = "Redo Last"; | ||||
| ot->description = "Display parameters for last action performed"; | ot->description = "Display parameters for last action performed"; | ||||
| ot->idname = "SCREEN_OT_redo_last"; | ot->idname = "SCREEN_OT_redo_last"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = redo_last_invoke; | ot->invoke = redo_last_invoke; | ||||
| ot->poll = repeat_history_poll; | |||||
| ot->poll = ED_operator_screenactive; | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Region Quad-View Operator | /** \name Region Quad-View Operator | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
Make it static bool.