diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 74 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_toolbar.c | 82 |
3 files changed, 1 insertions, 156 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e8de9b80fb3..b4d6d554e4f 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -114,26 +114,14 @@ ARegion *view3d_has_buttons_region(ScrArea *sa) ARegion *view3d_has_tools_region(ScrArea *sa) { ARegion *ar, *artool = NULL, *arhead; -#ifndef WITH_REDO_REGION_REMOVAL - ARegion *arprops = NULL; -#endif for (ar = sa->regionbase.first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_TOOLS) artool = ar; -#ifndef WITH_REDO_REGION_REMOVAL - if (ar->regiontype == RGN_TYPE_TOOL_PROPS) - arprops = ar; -#endif } /* tool region hide/unhide also hides props */ - if (artool -#ifndef WITH_REDO_REGION_REMOVAL - && arprops -#endif - ) - { + if (artool) { return artool; } @@ -154,17 +142,6 @@ ARegion *view3d_has_tools_region(ScrArea *sa) artool->flag = RGN_FLAG_HIDDEN; } -#ifndef WITH_REDO_REGION_REMOVAL - if (arprops == NULL) { - /* add extra subdivided region for tool properties */ - arprops = MEM_callocN(sizeof(ARegion), "tool props for view3d"); - - BLI_insertlinkafter(&sa->regionbase, artool, arprops); - arprops->regiontype = RGN_TYPE_TOOL_PROPS; - arprops->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; - } -#endif - return artool; } @@ -382,16 +359,6 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) ar->alignment = RGN_ALIGN_LEFT; ar->flag = RGN_FLAG_HIDDEN; -#ifndef WITH_REDO_REGION_REMOVAL - /* tool properties */ - ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d"); - - BLI_addtail(&v3d->regionbase, ar); - ar->regiontype = RGN_TYPE_TOOL_PROPS; - ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; - ar->flag = RGN_FLAG_HIDDEN; -#endif - /* buttons/list view */ ar = MEM_callocN(sizeof(ARegion), "buttons for view3d"); @@ -1326,29 +1293,6 @@ static void view3d_tools_region_draw(const bContext *C, ARegion *ar) ED_region_panels(C, ar, CTX_data_mode_string(C), -1, true); } -#ifndef WITH_REDO_REGION_REMOVAL -static void view3d_props_region_listener( - bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, - wmNotifier *wmn, const Scene *UNUSED(scene)) -{ - /* context changes */ - switch (wmn->category) { - case NC_WM: - if (wmn->data == ND_HISTORY) - ED_region_tag_redraw(ar); - break; - case NC_SCENE: - if (wmn->data == ND_MODE) - ED_region_tag_redraw(ar); - break; - case NC_SPACE: - if (wmn->data == ND_SPACE_VIEW3D) - ED_region_tag_redraw(ar); - break; - } -} -#endif - /* area (not region) level listener */ static void space_view3d_listener( bScreen *UNUSED(sc), ScrArea *sa, struct wmNotifier *wmn, Scene *UNUSED(scene), @@ -1539,21 +1483,6 @@ void ED_spacetype_view3d(void) view3d_toolshelf_register(art); #endif -#ifndef WITH_REDO_REGION_REMOVAL - /* regions: tool properties */ - art = MEM_callocN(sizeof(ARegionType), "spacetype view3d tool properties region"); - art->regionid = RGN_TYPE_TOOL_PROPS; - art->prefsizex = 0; - art->prefsizey = 120; - art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; - art->listener = view3d_props_region_listener; - art->init = view3d_tools_region_init; - art->draw = view3d_tools_region_draw; - BLI_addhead(&st->regiontypes, art); - - view3d_tool_props_register(art); -#endif - /* regions: header */ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d header region"); art->regionid = RGN_TYPE_HEADER; @@ -1566,4 +1495,3 @@ void ED_spacetype_view3d(void) BKE_spacetype_register(st); } - diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 7e0dc20203d..006b0117b99 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -230,7 +230,6 @@ struct Object *ED_view3d_cameracontrol_object_get( /* view3d_toolbar.c */ void VIEW3D_OT_toolshelf(struct wmOperatorType *ot); void view3d_toolshelf_register(struct ARegionType *art); -void view3d_tool_props_register(struct ARegionType *art); /* view3d_snap.c */ bool ED_view3d_minmax_verts(struct Object *obedit, float min[3], float max[3]); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 8c77cf36c91..26dca5bf252 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -62,73 +62,6 @@ #include "view3d_intern.h" /* own include */ - -#ifndef WITH_REDO_REGION_REMOVAL -/* ******************* view3d space & buttons ************** */ - -static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOperator *op) -{ - uiTemplateOperatorPropertyButs(C, pa->layout, op, NULL, UI_BUT_LABEL_ALIGN_COLUMN, 0); -} - -static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) -{ - wmOperator *op = WM_operator_last_redo(C); - - if (op) - BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname)); - else - BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname)); -} - -static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op) -{ - if (op->type->flag & OPTYPE_MACRO) { - for (op = op->macro.first; op; op = op->next) { - uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE); - view3d_panel_operator_redo_operator(C, pa, op); - } - } - else { - view3d_panel_operator_redo_buts(C, pa, op); - } -} - -/* TODO de-duplicate redo panel functions - campbell */ -static void view3d_panel_operator_redo(const bContext *C, Panel *pa) -{ - wmOperator *op = WM_operator_last_redo(C); - ARegion *ar; - ARegion *ar1; - - if (op == NULL) { - return; - } - - /* keep in sync with logic in ED_undo_operator_repeat() */ - ar = CTX_wm_region(C); - ar1 = BKE_area_find_region_active_win(CTX_wm_area(C)); - if (ar1) - CTX_wm_region_set((bContext *)C, ar1); - - if (WM_operator_poll((bContext *)C, op->type)) { - uiBlock *block = uiLayoutGetBlock(pa->layout); - - if (!WM_operator_check_ui_enabled(C, op->type->name)) - uiLayoutSetEnabled(pa->layout, false); - - /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */ - UI_block_func_handle_set(block, ED_undo_operator_repeat_cb_evt, op); - - view3d_panel_operator_redo_operator(C, pa, op); - } - - /* set region back */ - CTX_wm_region_set((bContext *)C, ar); -} - -#endif - /* ******************* */ typedef struct CustomTool { @@ -242,21 +175,6 @@ void view3d_toolshelf_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } -#ifndef WITH_REDO_REGION_REMOVAL -void view3d_tool_props_register(ARegionType *art) -{ - PanelType *pt; - - pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator"); - strcpy(pt->idname, "VIEW3D_PT_last_operator"); - strcpy(pt->label, N_("Operator")); - strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); - pt->draw_header = view3d_panel_operator_redo_header; - pt->draw = view3d_panel_operator_redo; - BLI_addtail(&art->paneltypes, pt); -} -#endif - /* ********** operator to open/close toolshelf region */ static int view3d_toolshelf_toggle_exec(bContext *C, wmOperator *UNUSED(op)) |