From 5c6e3337801b493926210e96237be2b495fc5d1b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Nov 2014 21:20:40 +0100 Subject: UI Refactor T41640 Make the UI API more consistent and reduce confusion with some naming. mainly: - API function calls - enum values some internal static functions have been left for now --- source/blender/editors/space_nla/nla_buttons.c | 14 +++++++------- source/blender/editors/space_nla/nla_draw.c | 12 ++++++------ source/blender/editors/space_nla/nla_edit.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'source/blender/editors/space_nla') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 1090106d79f..89cfd389a9d 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -254,7 +254,7 @@ static void nla_panel_animdata(const bContext *C, Panel *pa) /* adt = adt_ptr.data; */ block = uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); /* AnimData Source Properties ----------------------------------- */ @@ -309,7 +309,7 @@ static void nla_panel_track(const bContext *C, Panel *pa) return; block = uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); /* Info - Active NLA-Context:Track ---------------------- */ row = uiLayoutRow(layout, true); @@ -329,7 +329,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa) return; block = uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); /* Strip Properties ------------------------------------- */ /* strip type */ @@ -394,7 +394,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) return; block = uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); /* Strip Properties ------------------------------------- */ /* action pointer */ @@ -434,7 +434,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) return; block = uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); col = uiLayoutColumn(layout, true); uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE); @@ -468,7 +468,7 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) strip = strip_ptr.data; block = uiLayoutGetBlock(pa->layout); - uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + UI_block_func_handle_set(block, do_nla_region_buttons, NULL); /* 'add modifier' button at top of panel */ { @@ -477,7 +477,7 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) - uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, + uiDefButO(block, UI_BTYPE_BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, TIP_("Adds a new F-Modifier for the active NLA Strip")); /* copy/paste (as sub-row)*/ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index ac8dca6e83a..4cae820de89 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -341,9 +341,9 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri if (nonSolo == 0) { /* strip is in normal track */ glColor3fv(color); - uiSetRoundBox(UI_CNR_ALL); /* all corners rounded */ + UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ - uiDrawBoxShade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); + UI_draw_roundbox_shade_x(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); } else { /* strip is in disabled track - make less visible */ @@ -379,7 +379,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri setlinestyle(4); /* draw outline */ - uiDrawBoxShade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); + UI_draw_roundbox_shade_x(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQF(strip->repeat, 1.0f) == 0) { @@ -670,7 +670,7 @@ void draw_nla_channel_list(bContext *C, bAnimContext *ac, ARegion *ar) } } { /* second pass: UI widgets */ - uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); + uiBlock *block = UI_block_begin(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y = (float)(-NLACHANNEL_HEIGHT(snla)); @@ -697,8 +697,8 @@ void draw_nla_channel_list(bContext *C, bAnimContext *ac, ARegion *ar) channel_index++; } - uiEndBlock(C, block); - uiDrawBlock(C, block); + UI_block_end(C, block); + UI_block_draw(C, block); glDisable(GL_BLEND); } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index fe0431b9618..1085bcfc20b 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -2174,8 +2174,8 @@ static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const w uiLayout *layout; int i; - pup = uiPupMenuBegin(C, IFACE_("Add F-Modifier"), ICON_NONE); - layout = uiPupMenuLayout(pup); + pup = UI_popup_menu_begin(C, IFACE_("Add F-Modifier"), ICON_NONE); + layout = UI_popup_menu_layout(pup); /* start from 1 to skip the 'Invalid' modifier type */ for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { @@ -2192,7 +2192,7 @@ static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const w } uiItemS(layout); - uiPupMenuEnd(C, pup); + UI_popup_menu_end(C, pup); return OPERATOR_INTERFACE; } -- cgit v1.2.3