Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_ops.c
| Show First 20 Lines • Show All 2,731 Lines • ▼ Show 20 Lines | static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| ScrEdge *actedge; | ScrEdge *actedge; | ||||
| const int winsize_x = WM_window_pixels_x(win); | const int winsize_x = WM_window_pixels_x(win); | ||||
| const int winsize_y = WM_window_pixels_y(win); | const int winsize_y = WM_window_pixels_y(win); | ||||
| actedge = screen_find_active_scredge(sc, winsize_x, winsize_y, event->x, event->y); | actedge = screen_find_active_scredge(sc, winsize_x, winsize_y, event->x, event->y); | ||||
| if (actedge == NULL) return OPERATOR_CANCELLED; | if (actedge == NULL) return OPERATOR_CANCELLED; | ||||
| pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); | pup = UI_popup_menu_begin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| WM_operator_properties_create(&ptr1, "SCREEN_OT_area_join"); | WM_operator_properties_create(&ptr1, "SCREEN_OT_area_join"); | ||||
| /* mouse cursor on edge, '4' can fail on wide edges... */ | /* mouse cursor on edge, '4' can fail on wide edges... */ | ||||
| RNA_int_set(&ptr1, "min_x", event->x + 4); | RNA_int_set(&ptr1, "min_x", event->x + 4); | ||||
| RNA_int_set(&ptr1, "min_y", event->y + 4); | RNA_int_set(&ptr1, "min_y", event->y + 4); | ||||
| RNA_int_set(&ptr1, "max_x", event->x - 4); | RNA_int_set(&ptr1, "max_x", event->x - 4); | ||||
| RNA_int_set(&ptr1, "max_y", event->y - 4); | RNA_int_set(&ptr1, "max_y", event->y - 4); | ||||
| WM_operator_properties_create(&ptr2, "SCREEN_OT_area_split"); | WM_operator_properties_create(&ptr2, "SCREEN_OT_area_split"); | ||||
| /* store initial mouse cursor position */ | /* store initial mouse cursor position */ | ||||
| RNA_int_set(&ptr2, "mouse_x", event->x); | RNA_int_set(&ptr2, "mouse_x", event->x); | ||||
| RNA_int_set(&ptr2, "mouse_y", event->y); | RNA_int_set(&ptr2, "mouse_y", event->y); | ||||
| uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, ptr2.data, WM_OP_INVOKE_DEFAULT, 0); | uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, ptr2.data, WM_OP_INVOKE_DEFAULT, 0); | ||||
| uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, ptr1.data, WM_OP_INVOKE_DEFAULT, 0); | uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, ptr1.data, WM_OP_INVOKE_DEFAULT, 0); | ||||
| uiPupMenuEnd(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"; | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| int items, i; | int items, i; | ||||
| items = BLI_countlist(&wm->operators); | items = BLI_countlist(&wm->operators); | ||||
| if (items == 0) | if (items == 0) | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); | pup = UI_popup_menu_begin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| for (i = items - 1, lastop = wm->operators.last; lastop; lastop = lastop->prev, i--) | for (i = items - 1, lastop = wm->operators.last; lastop; lastop = lastop->prev, i--) | ||||
| if (WM_operator_repeat_check(C, lastop)) | if (WM_operator_repeat_check(C, lastop)) | ||||
| uiItemIntO(layout, RNA_struct_ui_name(lastop->type->srna), ICON_NONE, op->type->idname, "index", i); | uiItemIntO(layout, RNA_struct_ui_name(lastop->type->srna), ICON_NONE, op->type->idname, "index", i); | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static int repeat_history_exec(bContext *C, wmOperator *op) | static int repeat_history_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| ▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UNUSED(arg)) | ||||
| } | } | ||||
| } | } | ||||
| static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) | static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| pup = uiPupMenuBegin(C, IFACE_("Header"), ICON_NONE); | pup = UI_popup_menu_begin(C, IFACE_("Header"), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| ED_screens_header_tools_menu_create(C, layout, NULL); | ED_screens_header_tools_menu_create(C, layout, NULL); | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static void SCREEN_OT_header_toolbox(wmOperatorType *ot) | static void SCREEN_OT_header_toolbox(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Header Toolbox"; | ot->name = "Header Toolbox"; | ||||
| ▲ Show 20 Lines • Show All 1,020 Lines • Show Last 20 Lines | |||||