diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-08 19:43:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-08 19:43:59 +0400 |
commit | facc97637108efbde58e4da10d333a5bddd5a7c5 (patch) | |
tree | eaccecd2812966a28251d8648fa66b433f79348e /source/blender/editors/screen/screen_context.c | |
parent | f9d07ff3ee312a9ea7d93ef53bfebe327fa058ee (diff) |
style cleanup: screen
Diffstat (limited to 'source/blender/editors/screen/screen_context.c')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 6c5991422e5..ccc54a554e6 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -72,19 +72,19 @@ const char *screen_context_dir[] = { int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result) { - bScreen *sc= CTX_wm_screen(C); - Scene *scene= sc->scene; + bScreen *sc = CTX_wm_screen(C); + Scene *scene = sc->scene; Base *base; unsigned int lay = scene->lay; -#if 0 /* Using the context breaks adding objects in the UI. Need to find out why - campbell */ - Object *obact= CTX_data_active_object(C); - Object *obedit= CTX_data_edit_object(C); - base= CTX_data_active_base(C); +#if 0 /* Using the context breaks adding objects in the UI. Need to find out why - campbell */ + Object *obact = CTX_data_active_object(C); + Object *obedit = CTX_data_edit_object(C); + base = CTX_data_active_base(C); #else - Object *obedit= scene->obedit; - Object *obact= OBACT; - base= BASACT; + Object *obedit = scene->obedit; + Object *obact = OBACT; + base = BASACT; #endif if (CTX_data_dir(member)) { @@ -96,9 +96,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "visible_objects") || CTX_data_equals(member, "visible_bases")) { - int visible_objects= CTX_data_equals(member, "visible_objects"); + int visible_objects = CTX_data_equals(member, "visible_objects"); - for (base=scene->base.first; base; base=base->next) { + for (base = scene->base.first; base; base = base->next) { if (((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) && (base->lay & scene->lay)) { if (visible_objects) CTX_data_id_list_add(result, &base->object->id); @@ -110,11 +110,11 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "selectable_objects") || CTX_data_equals(member, "selectable_bases")) { - int selectable_objects= CTX_data_equals(member, "selectable_objects"); + int selectable_objects = CTX_data_equals(member, "selectable_objects"); - for (base=scene->base.first; base; base=base->next) { + for (base = scene->base.first; base; base = base->next) { if (base->lay & lay) { - if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0 && (base->object->restrictflag & OB_RESTRICT_SELECT)==0) { + if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0 && (base->object->restrictflag & OB_RESTRICT_SELECT) == 0) { if (selectable_objects) CTX_data_id_list_add(result, &base->object->id); else @@ -126,9 +126,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) { - int selected_objects= CTX_data_equals(member, "selected_objects"); + int selected_objects = CTX_data_equals(member, "selected_objects"); - for (base=scene->base.first; base; base=base->next) { + for (base = scene->base.first; base; base = base->next) { if ((base->flag & SELECT) && (base->lay & scene->lay)) { if (selected_objects) CTX_data_id_list_add(result, &base->object->id); @@ -140,12 +140,12 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "selected_editable_objects") || CTX_data_equals(member, "selected_editable_bases")) { - int selected_editable_objects= CTX_data_equals(member, "selected_editable_objects"); + int selected_editable_objects = CTX_data_equals(member, "selected_editable_objects"); - for (base=scene->base.first; base; base=base->next) { + for (base = scene->base.first; base; base = base->next) { if ((base->flag & SELECT) && (base->lay & scene->lay)) { - if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) { - if (0==BKE_object_is_libdata(base->object)) { + if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) { + if (0 == BKE_object_is_libdata(base->object)) { if (selected_editable_objects) CTX_data_id_list_add(result, &base->object->id); else @@ -158,13 +158,13 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) { - bArmature *arm= (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL; - EditBone *ebone, *flipbone=NULL; - int editable_bones= CTX_data_equals(member, "editable_bones"); + bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL; + EditBone *ebone, *flipbone = NULL; + int editable_bones = CTX_data_equals(member, "editable_bones"); if (arm && arm->edbo) { /* Attention: X-Axis Mirroring is also handled here... */ - for (ebone= arm->edbo->first; ebone; ebone= ebone->next) { + for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* first and foremost, bone must be visible and selected */ if (EBONE_VISIBLE(arm, ebone)) { /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled @@ -190,7 +190,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult /* only include bones if visible */ CTX_data_list_add(result, &arm->id, &RNA_EditBone, ebone); - if ((flipbone) && EBONE_VISIBLE(arm, flipbone)==0) + if ((flipbone) && EBONE_VISIBLE(arm, flipbone) == 0) CTX_data_list_add(result, &arm->id, &RNA_EditBone, flipbone); } } @@ -200,13 +200,13 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "selected_bones") || CTX_data_equals(member, "selected_editable_bones")) { - bArmature *arm= (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL; - EditBone *ebone, *flipbone=NULL; - int selected_editable_bones= CTX_data_equals(member, "selected_editable_bones"); + bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL; + EditBone *ebone, *flipbone = NULL; + int selected_editable_bones = CTX_data_equals(member, "selected_editable_bones"); if (arm && arm->edbo) { /* Attention: X-Axis Mirroring is also handled here... */ - for (ebone= arm->edbo->first; ebone; ebone= ebone->next) { + for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* first and foremost, bone must be visible and selected */ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_SELECTED)) { /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled @@ -242,12 +242,12 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "visible_pose_bones")) { - Object *obpose= BKE_object_pose_armature_get(obact); - bArmature *arm= (obpose) ? obpose->data : NULL; + Object *obpose = BKE_object_pose_armature_get(obact); + bArmature *arm = (obpose) ? obpose->data : NULL; bPoseChannel *pchan; if (obpose && obpose->pose && arm) { - for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) { + for (pchan = obpose->pose->chanbase.first; pchan; pchan = pchan->next) { /* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */ if (PBONE_VISIBLE(arm, pchan->bone)) { CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan); @@ -258,12 +258,12 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "selected_pose_bones")) { - Object *obpose= BKE_object_pose_armature_get(obact); - bArmature *arm= (obpose) ? obpose->data : NULL; + Object *obpose = BKE_object_pose_armature_get(obact); + bArmature *arm = (obpose) ? obpose->data : NULL; bPoseChannel *pchan; if (obpose && obpose->pose && arm) { - for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) { + for (pchan = obpose->pose->chanbase.first; pchan; pchan = pchan->next) { /* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */ if (PBONE_VISIBLE(arm, pchan->bone)) { if (pchan->bone->flag & BONE_SELECTED) @@ -276,7 +276,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "active_bone")) { if (obact && obact->type == OB_ARMATURE) { - bArmature *arm= obact->data; + bArmature *arm = obact->data; if (arm->edbo) { if (arm->act_edbone) { CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone); @@ -293,9 +293,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "active_pose_bone")) { bPoseChannel *pchan; - Object *obpose= BKE_object_pose_armature_get(obact); + Object *obpose = BKE_object_pose_armature_get(obact); - pchan= BKE_pose_channel_active(obpose); + pchan = BKE_pose_channel_active(obpose); if (pchan) { CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan); return 1; @@ -357,10 +357,10 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } else if (CTX_data_equals(member, "sequences")) { - Editing *ed= seq_give_editing(scene, FALSE); + Editing *ed = seq_give_editing(scene, FALSE); if (ed) { Sequence *seq; - for (seq= ed->seqbasep->first; seq; seq= seq->next) { + for (seq = ed->seqbasep->first; seq; seq = seq->next) { CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); } CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); @@ -368,10 +368,10 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "selected_sequences")) { - Editing *ed= seq_give_editing(scene, FALSE); + Editing *ed = seq_give_editing(scene, FALSE); if (ed) { Sequence *seq; - for (seq= ed->seqbasep->first; seq; seq= seq->next) { + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT) { CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); } @@ -381,10 +381,10 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "selected_editable_sequences")) { - Editing *ed= seq_give_editing(scene, FALSE); + Editing *ed = seq_give_editing(scene, FALSE); if (ed) { Sequence *seq; - for (seq= ed->seqbasep->first; seq; seq= seq->next) { + for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) { CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); } @@ -394,19 +394,19 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "active_operator")) { - wmOperator *op= NULL; + wmOperator *op = NULL; - SpaceFile *sfile= CTX_wm_space_file(C); + SpaceFile *sfile = CTX_wm_space_file(C); if (sfile) { - op= sfile->op; + op = sfile->op; } - else if ((op= uiContextActiveOperator(C))) { + else if ((op = uiContextActiveOperator(C))) { /* do nothign */ } else { /* note, this checks poll, could be a problem, but this also * happens for the toolbar */ - op= WM_operator_last_redo(C); + op = WM_operator_last_redo(C); } /* TODO, get the operator from popup's */ |