Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_edit.c
| Context not available. | |||||
| #include "outliner_intern.h" | #include "outliner_intern.h" | ||||
| /* ************************************************************** */ | /* ************************************************************** */ | ||||
| /* Unused Utilities */ | /* Utilities */ | ||||
| /* ************************************************************** */ | |||||
| // XXX: where to place these? | // XXX: where to place these? | ||||
| /* This is not used anywhere at the moment */ | |||||
| #if 0 | |||||
| /* return 1 when levels were opened */ | /* return 1 when levels were opened */ | ||||
| static int outliner_open_back(SpaceOops *soops, TreeElement *te) | static int outliner_open_back(SpaceOops *soops, TreeElement *te) | ||||
Severin: SpaceOopos *soops is unused and can be deleted | |||||
| { | { | ||||
| Context not available. | |||||
| return retval; | return retval; | ||||
| } | } | ||||
| static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) | |||||
SeverinAuthorUnsubmitted Not Done Inline ActionsBetter have this called outliner_set_coordinates_element_recursive so you can easily see that this is a recursive function. Severin: Better have this called outliner_set_coordinates_element_recursive so you can easily see that… | |||||
| { | |||||
| TreeStoreElem *tselem = TREESTORE(te); | |||||
| /* store coord and continue, we need coordinates for elements outside view too */ | |||||
| te->xs = (float)startx; | |||||
| te->ys = (float)(*starty); | |||||
| *starty -= UI_UNIT_Y; | |||||
| if (TSELEM_OPEN(tselem, soops)) { | |||||
| TreeElement *ten; | |||||
| for (ten = te->subtree.first; ten; ten = ten->next) { | |||||
| outliner_set_coordinates_element(soops, ten, startx + UI_UNIT_X, starty); | |||||
| } | |||||
| } | |||||
SeverinAuthorUnsubmitted Not Done Inline ActionsUnnecessary blank line Severin: Unnecessary blank line | |||||
| } | |||||
| /* to retrieve coordinates with redrawing the entire tree */ | |||||
| static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) | |||||
| { | |||||
| TreeElement *te; | |||||
| int starty = (int)(ar->v2d.tot.ymax) - UI_UNIT_Y; | |||||
| int startx = 0; | |||||
| for (te = soops->tree.first; te; te = te->next) { | |||||
| outliner_set_coordinates_element(soops, te, startx, &starty); | |||||
SeverinAuthorUnsubmitted Not Done Inline ActionsWould prefer to just use 0 instead of startx. Severin: Would prefer to just use 0 instead of startx. | |||||
| } | |||||
| } | |||||
SeverinAuthorUnsubmitted Not Done Inline ActionsSame here, unnecessary blank line Severin: Same here, unnecessary blank line | |||||
| /* This is not used anywhere at the moment */ | |||||
| #if 0 | |||||
| static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found) | static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found) | ||||
| { | { | ||||
| TreeElement *te; | TreeElement *te; | ||||
| Context not available. | |||||
| te = outliner_find_id(so, &so->tree, (ID *)OBACT); | te = outliner_find_id(so, &so->tree, (ID *)OBACT); | ||||
| if (te) { | if (te) { | ||||
| /* open up tree to active object */ | |||||
| if (outliner_open_back(so, te)) | |||||
| outliner_set_coordinates(ar, so); | |||||
| /* make te->ys center of view */ | /* make te->ys center of view */ | ||||
| ytop = te->ys + BLI_rcti_size_y(&v2d->mask) / 2; | ytop = te->ys + BLI_rcti_size_y(&v2d->mask) / 2; | ||||
| if (ytop > 0) ytop = 0; | if (ytop > 0) ytop = 0; | ||||
| Context not available. | |||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Show Active"; | ot->name = "Show Active"; | ||||
| ot->idname = "OUTLINER_OT_show_active"; | ot->idname = "OUTLINER_OT_show_active"; | ||||
| ot->description = "Adjust the view so that the active Object is shown centered"; | ot->description = "Open up the tree and adjust the view so that the active Object is shown centered"; | ||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->exec = outliner_show_active_exec; | ot->exec = outliner_show_active_exec; | ||||
| Context not available. | |||||
| #if 0 | #if 0 | ||||
| /* recursive helper for function below */ | |||||
| static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) | |||||
| { | |||||
| TreeStoreElem *tselem = TREESTORE(te); | |||||
| /* store coord and continue, we need coordinates for elements outside view too */ | |||||
| te->xs = (float)startx; | |||||
| te->ys = (float)(*starty); | |||||
| *starty -= UI_UNIT_Y; | |||||
| if (TSELEM_OPEN(tselem, soops)) { | |||||
| TreeElement *ten; | |||||
| for (ten = te->subtree.first; ten; ten = ten->next) { | |||||
| outliner_set_coordinates_element(soops, ten, startx + UI_UNIT_X, starty); | |||||
| } | |||||
| } | |||||
| } | |||||
| /* to retrieve coordinates with redrawing the entire tree */ | |||||
| static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) | |||||
| { | |||||
| TreeElement *te; | |||||
| int starty = (int)(ar->v2d.tot.ymax) - UI_UNIT_Y; | |||||
| int startx = 0; | |||||
| for (te = soops->tree.first; te; te = te->next) { | |||||
| outliner_set_coordinates_element(soops, te, startx, &starty); | |||||
| } | |||||
| } | |||||
| /* find next element that has this name */ | /* find next element that has this name */ | ||||
| static TreeElement *outliner_find_name(SpaceOops *soops, ListBase *lb, char *name, int flags, | static TreeElement *outliner_find_name(SpaceOops *soops, ListBase *lb, char *name, int flags, | ||||
| TreeElement *prev, int *prevFound) | TreeElement *prev, int *prevFound) | ||||
| Context not available. | |||||
SpaceOopos *soops is unused and can be deleted