[Bf-blender-cvs] [7f82d53] temp-ui-refactor: Initial ui-refactor T41640
Campbell Barton
noreply at git.blender.org
Sun Nov 9 21:19:02 CET 2014
Commit: 7f82d53d8dc6e68628d94916d8dd99ea6798cd21
Author: Campbell Barton
Date: Sun Nov 9 21:20:40 2014 +0100
Branches: temp-ui-refactor
https://developer.blender.org/rB7f82d53d8dc6e68628d94916d8dd99ea6798cd21
Initial ui-refactor T41640
batch search replace:
- API function calls
- enum values
Leaves some manual cleanup to be done.
===================================================================
M source/blender/editors/animation/anim_channels_defines.c
M source/blender/editors/animation/anim_draw.c
M source/blender/editors/animation/anim_filter.c
M source/blender/editors/animation/anim_markers.c
M source/blender/editors/animation/drivers.c
M source/blender/editors/animation/fmodifier_ui.c
M source/blender/editors/animation/keyframing.c
M source/blender/editors/animation/keyingsets.c
M source/blender/editors/armature/armature_relations.c
M source/blender/editors/armature/editarmature_retarget.c
M source/blender/editors/armature/pose_edit.c
M source/blender/editors/armature/pose_group.c
M source/blender/editors/armature/pose_lib.c
M source/blender/editors/curve/editcurve.c
M source/blender/editors/curve/editfont.c
M source/blender/editors/gpencil/gpencil_buttons.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/include/UI_icons.h
M source/blender/editors/include/UI_interface.h
M source/blender/editors/include/UI_resources.h
M source/blender/editors/interface/interface.c
M source/blender/editors/interface/interface_anim.c
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_eyedropper.c
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_intern.h
M source/blender/editors/interface/interface_layout.c
M source/blender/editors/interface/interface_ops.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/interface/interface_regions.c
M source/blender/editors/interface/interface_style.c
M source/blender/editors/interface/interface_templates.c
M source/blender/editors/interface/interface_utils.c
M source/blender/editors/interface/interface_widgets.c
M source/blender/editors/interface/resources.c
M source/blender/editors/interface/view2d.c
M source/blender/editors/interface/view2d_ops.c
M source/blender/editors/object/object_constraint.c
M source/blender/editors/object/object_relations.c
M source/blender/editors/object/object_select.c
M source/blender/editors/render/render_preview.c
M source/blender/editors/render/render_shading.c
M source/blender/editors/screen/area.c
M source/blender/editors/screen/screen_context.c
M source/blender/editors/screen/screen_edit.c
M source/blender/editors/screen/screen_ops.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sound/sound_ops.c
M source/blender/editors/space_action/action_draw.c
M source/blender/editors/space_action/action_edit.c
M source/blender/editors/space_api/spacetypes.c
M source/blender/editors/space_buttons/buttons_context.c
M source/blender/editors/space_buttons/buttons_ops.c
M source/blender/editors/space_buttons/buttons_texture.c
M source/blender/editors/space_clip/clip_buttons.c
M source/blender/editors/space_clip/clip_dopesheet_draw.c
M source/blender/editors/space_clip/clip_ops.c
M source/blender/editors/space_clip/clip_toolbar.c
M source/blender/editors/space_clip/tracking_select.c
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_file/file_panels.c
M source/blender/editors/space_file/filesel.c
M source/blender/editors/space_graph/graph_buttons.c
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_image/image_buttons.c
M source/blender/editors/space_image/image_ops.c
M source/blender/editors/space_info/info_ops.c
M source/blender/editors/space_logic/logic_buttons.c
M source/blender/editors/space_logic/logic_window.c
M source/blender/editors/space_nla/nla_buttons.c
M source/blender/editors/space_nla/nla_draw.c
M source/blender/editors/space_nla/nla_edit.c
M source/blender/editors/space_node/drawnode.c
M source/blender/editors/space_node/node_add.c
M source/blender/editors/space_node/node_draw.c
M source/blender/editors/space_node/node_group.c
M source/blender/editors/space_node/node_select.c
M source/blender/editors/space_node/node_templates.c
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_outliner/outliner_edit.c
M source/blender/editors/space_outliner/outliner_tools.c
M source/blender/editors/space_sequencer/sequencer_add.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_sequencer/sequencer_edit.c
M source/blender/editors/space_text/text_draw.c
M source/blender/editors/space_text/text_header.c
M source/blender/editors/space_text/text_ops.c
M source/blender/editors/space_view3d/drawmesh.c
M source/blender/editors/space_view3d/drawvolume.c
M source/blender/editors/space_view3d/view3d_buttons.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/editors/space_view3d/view3d_header.c
M source/blender/editors/space_view3d/view3d_ruler.c
M source/blender/editors/space_view3d/view3d_select.c
M source/blender/editors/space_view3d/view3d_toolbar.c
M source/blender/editors/transform/transform_generics.c
M source/blender/editors/transform/transform_ops.c
M source/blender/editors/util/ed_util.c
M source/blender/editors/util/numinput.c
M source/blender/editors/util/undo.c
M source/blender/editors/uvedit/uvedit_buttons.c
M source/blender/windowmanager/intern/wm_cursors.c
M source/blender/windowmanager/intern/wm_dragdrop.c
M source/blender/windowmanager/intern/wm_event_system.c
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 7d8e278..4d93a7c 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -120,8 +120,8 @@ static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, floa
glColor3fv(color);
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
- uiSetRoundBox((expanded) ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
- uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
+ UI_draw_roundbox_corner_set((expanded) ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
+ UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
}
@@ -420,8 +420,8 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi
* - top and bottom
* - special hack: make the top a bit higher, since we are first...
*/
- uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
- uiDrawBox(GL_POLYGON, 0, yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
+ UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
+ UI_draw_roundbox_gl_mode(GL_POLYGON, 0, yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
}
/* name for summary entries */
@@ -800,8 +800,8 @@ static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc
glColor3fv(color);
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
- uiSetRoundBox(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
- uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
+ UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
+ UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
}
/* name for group entries */
@@ -2999,7 +2999,7 @@ static void acf_nlaaction_backdrop(bAnimContext *ac, bAnimListElem *ale, float y
nla_action_get_color(adt, (bAction *)ale->data, color);
if (adt && (adt->flag & ADT_NLA_EDIT_ON)) {
- /* Yes, the color vector has 4 components, BUT we only want to be using 3 of them! */
+ /* Yes, the color vector has 4 components, UI_BTYPE_BUT we only want to be using 3 of them! */
glColor3fv(color);
}
else {
@@ -3010,12 +3010,12 @@ static void acf_nlaaction_backdrop(bAnimContext *ac, bAnimListElem *ale, float y
/* only on top left corner, to show that this channel sits on top of the preceding ones
* while still linking into the action line strip to the right
*/
- uiSetRoundBox(UI_CNR_TOP_LEFT);
+ UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT);
/* draw slightly shifted up vertically to look like it has more separation from other channels,
* but we then need to slightly shorten it so that it doesn't look like it overlaps
*/
- uiDrawBox(GL_POLYGON, offset, yminc + NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc + NLACHANNEL_SKIP - 1, 8);
+ UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc + NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc + NLACHANNEL_SKIP - 1, 8);
}
/* name for nla action entries */
@@ -3449,7 +3449,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
acf->name(ale, name);
offset += 3;
- UI_DrawString(offset, ytext, name);
+ UI_draw_string(offset, ytext, name);
/* draw red underline if channel is disabled */
if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) {
@@ -3590,7 +3590,7 @@ static void achannel_nlatrack_solo_widget_cb(bContext *C, void *adt_poin, void *
/* Toggle 'solo' mode. There are several complications here which need explaining:
* - The method call is needed to perform a few additional validation operations
* to ensure that the mode is applied properly
- * - BUT, since the button already toggles the value, we need to un-toggle it
+ * - UI_BTYPE_BUT, since the button already toggles the value, we need to un-toggle it
* before the API call gets to it, otherwise it will end up clearing the result
* again!
*/
@@ -3788,9 +3788,9 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann
/* type of button */
if (negflag)
- butType = ICONTOGN;
+ butType = UI_BTYPE_ICON_TOGGLE_N;
else
- butType = ICONTOG;
+ butType = UI_BTYPE_ICON_TOGGLE;
/* draw button for setting */
if (ptr && flag) {
@@ -3819,18 +3819,18 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann
case ACHANNEL_SETTING_PROTECT: /* General - protection flags */
case ACHANNEL_SETTING_MUTE: /* General - muting flags */
case ACHANNEL_SETTING_PINNED: /* NLA Actions - 'map/nomap' */
- uiButSetNFunc(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), SET_INT_IN_POINTER(setting));
+ UI_but_funcN_set(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), SET_INT_IN_POINTER(setting));
break;
/* settings needing special attention */
case ACHANNEL_SETTING_SOLO: /* NLA Tracks - Solo toggle */
- uiButSetFunc(but, achannel_nlatrack_solo_widget_cb, ale->adt, ale->data);
+ UI_but_func_set(but, achannel_nlatrack_solo_widget_cb, ale->adt, ale->data);
break;
/* no flushing */
case ACHANNEL_SETTING_EXPAND: /* expanding - cannot flush, otherwise all would open/close at once */
default:
- uiButSetFunc(but, achannel_setting_widget_cb, NULL, NULL);
+ UI_but_func_set(but, achannel_setting_widget_cb, NULL, NULL);
break;
}
}
@@ -3861,7 +3861,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
ymid = y - 0.5f * ICON_WIDTH;
/* no button backdrop behind icons */
- uiBlockSetEmboss(block, UI_EMBOSSN);
+ UI_block_emboss_set(block, UI_EMBOSS_NONE);
/* step 1) draw expand widget ....................................... */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
@@ -3908,14 +3908,14 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
if (acf->name_prop(ale, &ptr, &prop)) {
uiBut *but;
- uiBlockSetEmboss(block, UI_EMBOSS);
+ UI_block_emboss_set(block, UI_EMBOSS);
- but = uiDefButR(block, TEX, 1, "", offset + 3, yminc, RENAME_TEXT_WIDTH, channel_height,
+ but = uiDefButR(block, UI_BTYPE_TEXT, 1, "", offset + 3, yminc, RENAME_TEXT_WIDTH, channel_height,
&ptr, RNA_property_identifier(prop), -1, 0, 0, -1, -1, NULL);
- uiButSetFunc(but, achannel_setting_rename_done_cb, ac->ads, NULL);
- uiButActiveOnly(C, ac->ar, block, but);
+ UI_but_func_set(but, achannel_setting_rename_done_cb, ac->ads, NULL);
+ UI_but_active_only(C, ac->ar, block, but);
- uiBlockSetEmboss(block, UI_EMBOSSN);
+ UI_block_emboss_set(block, UI_EMBOSS_NONE);
}
}
}
@@ -3972,16 +3972,16 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
uiBut *but;
PointerRNA *opptr_b;
- uiBlockSetEmboss(block, UI_EMBOSS);
+ UI_block_emboss_set(block, UI_EMBOSS);
offset += UI_UNIT_X;
- but = uiDefIconButO(block, BUT, "NLA_OT_action_pushdown", WM_OP_INVOKE_DEFAULT, ICON_NLA_PUSHDOWN,
+ but = uiDefIconButO(block, UI_BTYPE_BUT, "NLA_OT_action_pushdown", WM_OP_INVOKE_DEFAULT, ICON_NLA_PUSHDOWN,
(int)v2d->cur.xmax - offset, ymid, UI_UNIT_X, UI_UNIT_X, NULL);
- opptr_b = uiButGetOperatorPtrRNA(but);
+ opptr_b = UI_but_operator_ptr_get(but);
RNA_int_set(opptr_b, "channel_index", channel_index);
- uiBlockSetEmboss(block, UI_EMBOSSN);
+ UI_block_emboss_set(block, UI_EMBOSS_NONE);
}
}
@@ -3989,7 +3989,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
* - even if we can draw sliders for this view, we must also check that the channel-type supports them
* (only only F-Curves really can support them for now)
* - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately,
- * wherever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
+ * wherever they occurred. UI_BTYPE_BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
* and wouldn't be able to auto-keyframe...
* - slider should start before the toggles (if they're visible) to keep a clean line down the side
*/
@@ -3999,7 +3999,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
offset += SLIDER_WIDTH;
/* need backdrop behind sliders... */
- uiBlockSetEmboss(block, UI_EMBOSS);
+ UI_block_emboss_set(block, UI_EMBOSS);
if (ale->id) { /* Slider using RNA Access -------------------- */
PointerRNA id_ptr, ptr;
@@ -4037,9 +4037,9 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
/* assign keyframing function according to slider type */
if (ale->type == ANIMTYPE_SHAPEKEY)
- uiButSetFunc(but, achannel_setting_slider_shapekey_cb, ale->id, ale->data);
+ UI_but_func_set(but, achannel_setting_slider_shapekey_cb, ale->id, ale->data);
else
- uiButSetFunc(but, achannel_setting_slider_cb, ale->id, ale->data);
+ UI_but_func_set(but, achannel_setting_slider_cb, ale->id, ale->data);
}
/* free the path if necessary */
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 9c3f310..9cfe307 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -79,7 +79,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const
else {
BLI_timecode_string_from_time_simple(&numstr[4], sizeof(numstr) - 4, 1, cfra);
}
- slen = (short)UI_GetStringWidth(numstr) - 1;
+ slen = (short)UI_fontstyle_string_width(numstr) - 1;
/* get starting coordinates for drawing */
x = cfra * xscale;
@@ -91,7 +91,7 @@ static void draw_cfra_number(Scene *
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list