[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46390] trunk/blender/source/blender/ editors/space_outliner: style cleanup: outliner
Campbell Barton
ideasman42 at gmail.com
Mon May 7 19:56:30 CEST 2012
Revision: 46390
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46390
Author: campbellbarton
Date: 2012-05-07 17:56:30 +0000 (Mon, 07 May 2012)
Log Message:
-----------
style cleanup: outliner
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
trunk/blender/source/blender/editors/space_outliner/outliner_edit.c
trunk/blender/source/blender/editors/space_outliner/outliner_intern.h
trunk/blender/source/blender/editors/space_outliner/outliner_select.c
trunk/blender/source/blender/editors/space_outliner/outliner_tools.c
trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
trunk/blender/source/blender/editors/space_outliner/space_outliner.c
Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 2012-05-07 17:22:13 UTC (rev 46389)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 2012-05-07 17:56:30 UTC (rev 46390)
@@ -74,20 +74,20 @@
static void outliner_height(SpaceOops *soops, ListBase *lb, int *h)
{
- TreeElement *te= lb->first;
+ TreeElement *te = lb->first;
while (te) {
- TreeStoreElem *tselem= TREESTORE(te);
+ TreeStoreElem *tselem = TREESTORE(te);
if (TSELEM_OPEN(tselem, soops))
outliner_height(soops, &te->subtree, h);
(*h) += UI_UNIT_Y;
- te= te->next;
+ te = te->next;
}
}
#if 0 // XXX this is currently disabled until te->xend is set correctly
static void outliner_width(SpaceOops *soops, ListBase *lb, int *w)
{
- TreeElement *te= lb->first;
+ TreeElement *te = lb->first;
while (te) {
// TreeStoreElem *tselem= TREESTORE(te);
@@ -97,16 +97,16 @@
*w = te->xend;
}
outliner_width(soops, &te->subtree, w);
- te= te->next;
+ te = te->next;
}
}
#endif
static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int startx)
{
- TreeElement *te= lb->first;
+ TreeElement *te = lb->first;
while (te) {
- TreeStoreElem *tselem= TREESTORE(te);
+ TreeStoreElem *tselem = TREESTORE(te);
// XXX fixme... (currently, we're using a fixed length of 100)!
#if 0
if (te->xend) {
@@ -114,12 +114,12 @@
*w = te->xend;
}
#endif
- if (startx+100 > *w)
- *w = startx+100;
+ if (startx + 100 > *w)
+ *w = startx + 100;
if (TSELEM_OPEN(tselem, soops))
- outliner_rna_width(soops, &te->subtree, w, startx+UI_UNIT_X);
- te= te->next;
+ outliner_rna_width(soops, &te->subtree, w, startx + UI_UNIT_X);
+ te = te->next;
}
}
@@ -138,7 +138,7 @@
* so have to do loop to find it. */
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
}
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -155,18 +155,18 @@
* so have to do loop to find it. */
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
}
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
static void restrictbutton_rend_cb(bContext *C, void *poin, void *UNUSED(poin2))
{
- WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, poin);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_RENDER, poin);
}
static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *UNUSED(poin2))
{
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, poin);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, poin);
}
static void restrictbutton_modifier_cb(bContext *C, void *UNUSED(poin), void *poin2)
@@ -175,31 +175,31 @@
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
}
static void restrictbutton_bone_cb(bContext *C, void *UNUSED(poin), void *poin2)
{
- Bone *bone= (Bone *)poin2;
+ Bone *bone = (Bone *)poin2;
if (bone && (bone->flag & BONE_HIDDEN_P))
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
}
static void restrictbutton_ebone_cb(bContext *C, void *UNUSED(poin), void *poin2)
{
- EditBone *ebone= (EditBone *)poin2;
+ EditBone *ebone = (EditBone *)poin2;
if (ebone && (ebone->flag & BONE_HIDDEN_A))
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
}
static int group_restrict_flag(Group *gr, int flag)
{
GroupObject *gob;
- for (gob= gr->gobject.first; gob; gob= gob->next) {
+ for (gob = gr->gobject.first; gob; gob = gob->next) {
if ((gob->ob->restrictflag & flag) == 0)
return 0;
}
@@ -211,7 +211,7 @@
{
GroupObject *gob;
- for (gob= gr->gobject.first; gob; gob= gob->next)
+ for (gob = gr->gobject.first; gob; gob = gob->next)
if ((gob->ob->flag & SELECT))
return 1;
@@ -225,21 +225,21 @@
Group *gr = (Group *)poin2;
if (group_restrict_flag(gr, flag)) {
- for (gob= gr->gobject.first; gob; gob= gob->next) {
+ for (gob = gr->gobject.first; gob; gob = gob->next) {
gob->ob->restrictflag &= ~flag;
- if (flag==OB_RESTRICT_VIEW)
+ if (flag == OB_RESTRICT_VIEW)
if (gob->ob->flag & SELECT)
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_DESELECT);
}
}
else {
- for (gob= gr->gobject.first; gob; gob= gob->next) {
+ for (gob = gr->gobject.first; gob; gob = gob->next) {
/* not in editmode */
- if (scene->obedit!=gob->ob) {
+ if (scene->obedit != gob->ob) {
gob->ob->restrictflag |= flag;
- if (flag==OB_RESTRICT_VIEW)
+ if (flag == OB_RESTRICT_VIEW)
if ((gob->ob->flag & SELECT) == 0)
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_SELECT);
}
@@ -266,17 +266,17 @@
static void namebutton_cb(bContext *C, void *tsep, char *oldname)
{
- SpaceOops *soops= CTX_wm_space_outliner(C);
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- TreeStore *ts= soops->treestore;
- TreeStoreElem *tselem= tsep;
+ SpaceOops *soops = CTX_wm_space_outliner(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ TreeStore *ts = soops->treestore;
+ TreeStoreElem *tselem = tsep;
if (ts && tselem) {
- TreeElement *te= outliner_find_tse(soops, tselem);
+ TreeElement *te = outliner_find_tse(soops, tselem);
- if (tselem->type==0) {
- test_idbutton(tselem->id->name+2); // library.c, unique name and alpha sort
+ if (tselem->type == 0) {
+ test_idbutton(tselem->id->name + 2); // library.c, unique name and alpha sort
switch (GS(tselem->id->name)) {
case ID_MA:
@@ -288,11 +288,11 @@
case ID_SCE:
WM_event_add_notifier(C, NC_SCENE, NULL); break;
default:
- WM_event_add_notifier(C, NC_ID|NA_RENAME, NULL); break;
+ WM_event_add_notifier(C, NC_ID | NA_RENAME, NULL); break;
}
/* Check the library target exists */
if (te->idcode == ID_LI) {
- Library *lib= (Library *)tselem->id;
+ Library *lib = (Library *)tselem->id;
char expanded[FILE_MAX];
BKE_library_filepath_set(lib, lib->name);
@@ -306,73 +306,73 @@
}
else {
switch (tselem->type) {
- case TSE_DEFGROUP:
- defgroup_unique_name(te->directdata, (Object *)tselem->id); // id = object
- break;
- case TSE_NLA_ACTION:
- test_idbutton(tselem->id->name+2);
- break;
- case TSE_EBONE:
- {
- bArmature *arm= (bArmature *)tselem->id;
- if (arm->edbo) {
- EditBone *ebone= te->directdata;
- char newname[sizeof(ebone->name)];
-
- /* restore bone name */
- BLI_strncpy(newname, ebone->name, sizeof(ebone->name));
- BLI_strncpy(ebone->name, oldname, sizeof(ebone->name));
- ED_armature_bone_rename(obedit->data, oldname, newname);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, OBACT);
+ case TSE_DEFGROUP:
+ defgroup_unique_name(te->directdata, (Object *)tselem->id); // id = object
+ break;
+ case TSE_NLA_ACTION:
+ test_idbutton(tselem->id->name + 2);
+ break;
+ case TSE_EBONE:
+ {
+ bArmature *arm = (bArmature *)tselem->id;
+ if (arm->edbo) {
+ EditBone *ebone = te->directdata;
+ char newname[sizeof(ebone->name)];
+
+ /* restore bone name */
+ BLI_strncpy(newname, ebone->name, sizeof(ebone->name));
+ BLI_strncpy(ebone->name, oldname, sizeof(ebone->name));
+ ED_armature_bone_rename(obedit->data, oldname, newname);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, OBACT);
+ }
}
- }
break;
- case TSE_BONE:
+ case TSE_BONE:
{
- Bone *bone= te->directdata;
+ Bone *bone = te->directdata;
Object *ob;
char newname[sizeof(bone->name)];
// always make current object active
tree_element_active(C, scene, soops, te, 1); // was set_active_object()
- ob= OBACT;
+ ob = OBACT;
/* restore bone name */
BLI_strncpy(newname, bone->name, sizeof(bone->name));
BLI_strncpy(bone->name, oldname, sizeof(bone->name));
ED_armature_bone_rename(ob->data, oldname, newname);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
}
break;
- case TSE_POSE_CHANNEL:
+ case TSE_POSE_CHANNEL:
{
- bPoseChannel *pchan= te->directdata;
+ bPoseChannel *pchan = te->directdata;
Object *ob;
char newname[sizeof(pchan->name)];
// always make current object active
tree_element_active(C, scene, soops, te, 1); // was set_active_object()
- ob= OBACT;
+ ob = OBACT;
/* restore bone name */
BLI_strncpy(newname, pchan->name, sizeof(pchan->name));
BLI_strncpy(pchan->name, oldname, sizeof(pchan->name));
ED_armature_bone_rename(ob->data, oldname, newname);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
}
break;
- case TSE_POSEGRP:
+ case TSE_POSEGRP:
{
- Object *ob= (Object *)tselem->id; // id = object
- bActionGroup *grp= te->directdata;
+ Object *ob = (Object *)tselem->id; // id = object
+ bActionGroup *grp = te->directdata;
BLI_uniquename(&ob->pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), sizeof(grp->name));
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
}
break;
- case TSE_R_LAYER:
- break;
+ case TSE_R_LAYER:
+ break;
}
}
tselem->flag &= ~TSE_TEXTBUT;
@@ -387,120 +387,120 @@
Object *ob = NULL;
Group *gr = NULL;
- for (te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if (te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
+ for (te = lb->first; te; te = te->next) {
+ tselem = TREESTORE(te);
+ if (te->ys + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
/* objects have toggle-able restriction flags */
- if (tselem->type==0 && te->idcode==ID_OB) {
+ if (tselem->type == 0 && te->idcode == ID_OB) {
PointerRNA ptr;
ob = (Object *)tselem->id;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list