[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46419] trunk/blender/source/blender: style cleanup: misc editor changes.
Campbell Barton
ideasman42 at gmail.com
Tue May 8 13:48:19 CEST 2012
Revision: 46419
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46419
Author: campbellbarton
Date: 2012-05-08 11:48:19 +0000 (Tue, 08 May 2012)
Log Message:
-----------
style cleanup: misc editor changes.
Modified Paths:
--------------
trunk/blender/source/blender/editors/animation/anim_channels_defines.c
trunk/blender/source/blender/editors/animation/fmodifier_ui.c
trunk/blender/source/blender/editors/animation/keyframing.c
trunk/blender/source/blender/editors/curve/editfont.c
trunk/blender/source/blender/editors/screen/screen_ops.c
trunk/blender/source/blender/editors/space_script/script_edit.c
trunk/blender/source/blender/editors/space_script/script_ops.c
trunk/blender/source/blender/editors/space_script/space_script.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_intern.h
trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c
trunk/blender/source/blender/imbuf/intern/rectop.c
Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c 2012-05-08 11:42:29 UTC (rev 46418)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c 2012-05-08 11:48:19 UTC (rev 46419)
@@ -79,10 +79,10 @@
// XXX constant defines to be moved elsewhere?
/* extra padding for lengths (to go under scrollers) */
-#define EXTRA_SCROLL_PAD 100.0f
+#define EXTRA_SCROLL_PAD 100.0f
/* size of indent steps */
-#define INDENT_STEP_SIZE 7
+#define INDENT_STEP_SIZE 7
#define ANIM_CHAN_NAME_SIZE 256
@@ -107,10 +107,10 @@
/* backdrop for top-level widgets (Scene and Object only) */
static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
- View2D *v2d= &ac->ar->v2d;
- short expanded= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
- short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
+ View2D *v2d = &ac->ar->v2d;
+ short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
+ short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
float color[3];
/* set backdrop drawing color */
@@ -119,7 +119,7 @@
/* 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);
+ uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
}
@@ -133,9 +133,9 @@
/* backdrop for data expanders under top-level Scene/Object */
static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
- View2D *v2d= &ac->ar->v2d;
- short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
+ View2D *v2d = &ac->ar->v2d;
+ short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
float color[3];
/* set backdrop drawing color */
@@ -143,24 +143,24 @@
glColor3fv(color);
/* no rounded corner - just rectangular box */
- glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
+ glRectf(offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
}
/* get backdrop color for generic channels */
static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
SpaceAction *saction = NULL;
bActionGroup *grp = NULL;
- short indent= (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
+ short indent = (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
/* get context info needed... */
if ((ac->sl) && (ac->spacetype == SPACE_ACTION))
- saction= (SpaceAction *)ac->sl;
+ saction = (SpaceAction *)ac->sl;
if (ale->type == ANIMTYPE_FCURVE) {
- FCurve *fcu= (FCurve *)ale->data;
- grp= fcu->grp;
+ FCurve *fcu = (FCurve *)ale->data;
+ grp = fcu->grp;
}
/* set color for normal channels
@@ -168,7 +168,7 @@
* - only use group colors if allowed to, and if actually feasible
*/
if ( (saction && !(saction->flag & SACTION_NODRAWGCOLORS)) &&
- ((grp) && (grp->customCol)) )
+ ((grp) && (grp->customCol)) )
{
unsigned char cp[3];
@@ -187,7 +187,7 @@
}
else {
// FIXME: what happens when the indention is 1 greater than what it should be (due to grouping)?
- int colOfs= 20 - 20*indent;
+ int colOfs = 20 - 20 * indent;
UI_GetThemeColorShade3fv(TH_HEADER, colOfs, r_color);
}
}
@@ -195,9 +195,9 @@
/* backdrop for generic channels */
static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
- View2D *v2d= &ac->ar->v2d;
- short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
+ View2D *v2d = &ac->ar->v2d;
+ short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
float color[3];
/* set backdrop drawing color */
@@ -205,7 +205,7 @@
glColor3fv(color);
/* no rounded corners - just rectangular box */
- glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
+ glRectf(offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
}
/* Indention + Offset ------------------------------------------- */
@@ -229,11 +229,11 @@
/* indention which varies with the grouping status */
static short acf_generic_indention_flexible(bAnimContext *UNUSED(ac), bAnimListElem *ale)
{
- short indent= 0;
+ short indent = 0;
/* grouped F-Curves need extra level of indention */
if (ale->type == ANIMTYPE_FCURVE) {
- FCurve *fcu= (FCurve *)ale->data;
+ FCurve *fcu = (FCurve *)ale->data;
// TODO: we need some way of specifying that the indention color should be one less...
if (fcu->grp)
@@ -247,7 +247,7 @@
/* basic offset for channels derived from indention */
static short acf_generic_basic_offset(bAnimContext *ac, bAnimListElem *ale)
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
if (acf && acf->get_indent_level)
return acf->get_indent_level(ac, ale) * INDENT_STEP_SIZE;
@@ -272,7 +272,7 @@
case NTREE_TEXTURE:
/* 2 additional levels */
- return INDENT_STEP_SIZE*2;
+ return INDENT_STEP_SIZE * 2;
}
}
@@ -283,7 +283,7 @@
/* offset for groups + grouped entities */
static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
{
- short offset= acf_generic_basic_offset(ac, ale);
+ short offset = acf_generic_basic_offset(ac, ale);
if (ale->id) {
/* texture animdata */
@@ -300,7 +300,7 @@
/* nodetree animdata */
if (GS(ale->id->name) == ID_NT) {
- offset += acf_nodetree_rootType_offset((bNodeTree*)ale->id);
+ offset += acf_nodetree_rootType_offset((bNodeTree *)ale->id);
}
}
@@ -313,11 +313,11 @@
/* name for ID block entries */
static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
{
- ID *id= (ID *)ale->data; /* data pointed to should be an ID block */
+ ID *id = (ID *)ale->data; /* data pointed to should be an ID block */
/* just copy the name... */
if (id && name)
- BLI_strncpy(name, id->name+2, ANIM_CHAN_NAME_SIZE);
+ BLI_strncpy(name, id->name + 2, ANIM_CHAN_NAME_SIZE);
}
/* name property for ID block entries */
@@ -377,7 +377,7 @@
static void acf_summary_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float r_color[3])
{
// FIXME: hardcoded color - same as the 'action' line in NLA
- // reddish color
+ // reddish color
r_color[0] = 0.8f;
r_color[1] = 0.2f;
r_color[2] = 0.0f;
@@ -386,8 +386,8 @@
/* backdrop for summary widget */
static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
{
- bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
- View2D *v2d= &ac->ar->v2d;
+ bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
+ View2D *v2d = &ac->ar->v2d;
float color[3];
/* set backdrop drawing color */
@@ -399,7 +399,7 @@
* - 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);
+ uiDrawBox(GL_POLYGON, 0, yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
}
/* name for summary entries */
@@ -427,12 +427,12 @@
{
if (setting == ACHANNEL_SETTING_EXPAND) {
/* expanded */
- *neg= 1;
+ *neg = 1;
return ADS_FLAG_SUMMARY_COLLAPSED;
}
else {
/* unsupported */
- *neg= 0;
+ *neg = 0;
return 0;
}
}
@@ -440,21 +440,21 @@
/* get pointer to the setting */
static void *acf_summary_setting_ptr(bAnimListElem *ale, int setting, short *type)
{
- bAnimContext *ac= (bAnimContext *)ale->data;
+ bAnimContext *ac = (bAnimContext *)ale->data;
/* if data is valid, return pointer to active dopesheet's relevant flag
* - this is restricted to DopeSheet/Action Editor only
*/
if ((ac->sl) && (ac->spacetype == SPACE_ACTION) && (setting == ACHANNEL_SETTING_EXPAND)) {
- SpaceAction *saction= (SpaceAction *)ac->sl;
- bDopeSheet *ads= &saction->ads;
+ SpaceAction *saction = (SpaceAction *)ac->sl;
+ bDopeSheet *ads = &saction->ads;
/* return pointer to DopeSheet's flag */
return GET_ACF_FLAG_PTR(ads->flag, type);
}
else {
/* can't return anything useful - unsupported */
- *type= 0;
+ *type = 0;
return NULL;
}
}
@@ -462,20 +462,20 @@
/* all animation summary (DopeSheet only) type define */
static bAnimChannelType ACF_SUMMARY =
{
- "Summary", /* type name */
+ "Summary", /* type name */
- acf_summary_color, /* backdrop color */
- acf_summary_backdrop, /* backdrop */
- acf_generic_indention_0, /* indent level */
- NULL, /* offset */
-
- acf_summary_name, /* name */
- NULL, /* name prop */
- acf_summary_icon, /* icon */
-
- acf_summary_setting_valid, /* has setting */
- acf_summary_setting_flag, /* flag for setting */
- acf_summary_setting_ptr /* pointer for setting */
+ acf_summary_color, /* backdrop color */
+ acf_summary_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ NULL, /* offset */
+
+ acf_summary_name, /* name */
+ NULL, /* name prop */
+ acf_summary_icon, /* icon */
+
+ acf_summary_setting_valid, /* has setting */
+ acf_summary_setting_flag, /* flag for setting */
+ acf_summary_setting_ptr /* pointer for setting */
};
/* Scene ------------------------------------------- */
@@ -512,21 +512,21 @@
static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
{
/* clear extra return data first */
- *neg= 0;
+ *neg = 0;
switch (setting) {
case ACHANNEL_SETTING_SELECT: /* selected */
return SCE_DS_SELECTED;
case ACHANNEL_SETTING_EXPAND: /* expanded */
- *neg= 1;
+ *neg = 1;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list