summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-12-12 13:55:25 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-12-12 13:55:25 +0000
commit79b87832a4c4b85402a4293a548eb26c3a8ecae2 (patch)
tree0647c029918086a6a21d4da431f3da63f7e1be83
parenta7240fd6a94fe5cb98cfbf53d6caf15b12628cc1 (diff)
downloadnetsurf-79b87832a4c4b85402a4293a548eb26c3a8ecae2.tar.gz
netsurf-79b87832a4c4b85402a4293a548eb26c3a8ecae2.tar.bz2
Rename tree_draw_node_expansion() to tree_draw_node_expansion_toggle(). Pedantic wrap/indentation changes in tree_draw_node.
svn path=/trunk/netsurf/; revision=11035
-rw-r--r--desktop/tree.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/desktop/tree.c b/desktop/tree.c
index b8f50287c..329fe2aba 100644
--- a/desktop/tree.c
+++ b/desktop/tree.c
@@ -1467,8 +1467,8 @@ struct node *tree_node_get_next(struct node *node)
* \param tree_x X coordinate of the tree
* \param tree_y Y coordinate of the tree
*/
-static void tree_draw_node_expansion(struct tree *tree, struct node *node,
- int tree_x, int tree_y)
+static void tree_draw_node_expansion_toggle(struct tree *tree,
+ struct node *node, int tree_x, int tree_y)
{
int x, y;
@@ -1531,7 +1531,7 @@ static void tree_draw_node_element(struct tree *tree,
CONTENT_STATUS_DONE)) {
content_redraw(icon , x, y + 2,
TREE_ICON_SIZE, TREE_ICON_SIZE,
- x, y, x + TREE_ICON_SIZE,
+ x, y + 2, x + TREE_ICON_SIZE,
y + 2 + TREE_ICON_SIZE, 1, 0);
}
@@ -1610,22 +1610,23 @@ static void tree_draw_node(struct tree *tree, struct node *node,
y_max = clip_y + clip_height;
if ((node->parent->next != NULL) &&
- (node->parent->next->box.y < clip_y))
+ (node->parent->next->box.y < clip_y))
return;
for (; node != NULL; node = node->next) {
- if (node->box.y > y_max) return;
+ if (node->box.y > y_max)
+ return;
if ((node->next != NULL) &&
- (!(tree->flags & TREE_NO_FURNITURE))) {
+ (!(tree->flags & TREE_NO_FURNITURE))) {
x0 = x1 = tree_x + node->box.x - (NODE_INSTEP / 2);
y0 = tree_y + node->box.y + (TREE_LINE_HEIGHT / 2);
y1 = y0 + node->next->box.y - node->box.y;
plot.line(x0, y0, x1, y1, plot_style_stroke_darkwbasec);
}
if ((node->box.x < x_max) && (node->box.y < y_max) &&
- (node->box.x + node->box.width
- + NODE_INSTEP >= clip_x) &&
- (node->box.y + node->box.height >= clip_y)) {
+ (node->box.x + node->box.width + NODE_INSTEP >=
+ clip_x) &&
+ (node->box.y + node->box.height >= clip_y)) {
if (!(tree->flags & TREE_NO_FURNITURE)) {
if ((node->expanded) && (node->child != NULL)) {
x0 = x1 = tree_x + node->box.x +
@@ -1639,39 +1640,42 @@ static void tree_draw_node(struct tree *tree, struct node *node,
}
parent = node->parent;
if ((parent != NULL) &&
- (parent != tree->root) &&
- (parent->child == node)) {
+ (parent != tree->root) &&
+ (parent->child == node)) {
x0 = x1 = tree_x + parent->box.x +
- (NODE_INSTEP / 2);
+ (NODE_INSTEP / 2);
y0 = tree_y + parent->data.box.y +
- parent->data.box.height;
+ parent->data.box.height;
y1 = y0 + (TREE_LINE_HEIGHT / 2);
plot.line(x0, y0, x1, y1,
- plot_style_stroke_darkwbasec);
+ plot_style_stroke_darkwbasec);
}
x0 = tree_x + node->box.x - (NODE_INSTEP / 2);
x1 = x0 + (NODE_INSTEP / 2) - 2;
y0 = y1 = tree_y + node->data.box.y +
- node->data.box.height -
- (TREE_LINE_HEIGHT / 2);
+ node->data.box.height -
+ (TREE_LINE_HEIGHT / 2);
plot.line(x0, y0, x1, y1,
- plot_style_stroke_darkwbasec);
- tree_draw_node_expansion(tree, node,
- tree_x, tree_y);
+ plot_style_stroke_darkwbasec);
+ tree_draw_node_expansion_toggle(tree, node,
+ tree_x, tree_y);
}
- if (node->expanded)
+ if (node->expanded) {
for (element = &node->data; element != NULL;
- element = element->next)
+ element = element->next) {
tree_draw_node_element(tree, element,
- tree_x, tree_y);
- else
+ tree_x, tree_y);
+ }
+ } else {
tree_draw_node_element(tree, &node->data,
- tree_x, tree_y);
+ tree_x, tree_y);
+ }
}
- if ((node->child != NULL) && (node->expanded))
+ if ((node->child != NULL) && (node->expanded)) {
tree_draw_node(tree, node->child, tree_x, tree_y,
- clip_x, clip_y,
- clip_width, clip_height);
+ clip_x, clip_y,
+ clip_width, clip_height);
+ }
}
}