diff --git a/hot.c b/hot.c index c9c6772..371fb7e 100644 --- a/hot.c +++ b/hot.c @@ -14,7 +14,7 @@ static struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;}; - +static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child); static struct TreeNode_t *create_user_tree_node (const gchar* text){ struct TreeNode_t *node = g_malloc0 (sizeof(struct TreeNode_t)); node->text = g_strdup (text); @@ -22,6 +22,37 @@ static struct TreeNode_t *create_user_tree_node (const gchar* text){ return node; } +static void create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root){ +/* struct TreeNode_t *move_random = create_user_tree_node("move random"); add_child_node(tree_root, move_random); + struct TreeNode_t *move_determ = create_user_tree_node("move determ"); add_child_node(tree_root, move_determ); + struct TreeNode_t *transport = create_user_tree_node("transport"); add_child_node(tree_root, transport);*/ + struct TreeNode_t *transform = create_user_tree_node("transform"); add_child_node(tree_root, transform); + struct TreeNode_t *regulate = create_user_tree_node("regulate"); add_child_node(tree_root, regulate); +/* struct TreeNode_t *isole = create_user_tree_node("isolated object"); add_child_node(move_random, isole); + struct TreeNode_t *relie = create_user_tree_node("part of object"); add_child_node(move_random, relie); + struct TreeNode_t *no_payload = create_user_tree_node("free"); add_child_node(transport, no_payload); + struct TreeNode_t *charged = create_user_tree_node("charged"); add_child_node(transport, charged); + struct TreeNode_t *spontaneous = create_user_tree_node("spontaneous"); add_child_node(transform, spontaneous);*/ + struct TreeNode_t *catalysed = create_user_tree_node("catalysed"); add_child_node(transform, catalysed); +/* struct TreeNode_t *isole_1D = create_user_tree_node("isolated object move 1D"); add_child_node(isole, isole_1D); + struct TreeNode_t *isole_2D = create_user_tree_node("isolated object move 2D"); add_child_node(isole, isole_2D); + struct TreeNode_t *isole_3D = create_user_tree_node("isolated object move 3D"); add_child_node(isole, isole_3D); + struct TreeNode_t *translat_2D = create_user_tree_node("translation"); add_child_node(isole_2D, translat_2D); + struct TreeNode_t *rotat_2D = create_user_tree_node("rotation"); add_child_node(isole_2D, rotat_2D); + struct TreeNode_t *rotat_X_2D = create_user_tree_node("rotation axe X"); add_child_node(rotat_2D, rotat_X_2D); + struct TreeNode_t *rotat_Y_2D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_2D, rotat_Y_2D); + struct TreeNode_t *translat_3D = create_user_tree_node("translation"); add_child_node(isole_3D, translat_3D); + struct TreeNode_t *rotat_3D = create_user_tree_node("rotation"); add_child_node(isole_3D, rotat_3D); + struct TreeNode_t *rotat_X_3D = create_user_tree_node("rotation axe X"); add_child_node(rotat_3D, rotat_X_3D); + struct TreeNode_t *rotat_Y_3D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_3D, rotat_Y_3D); + struct TreeNode_t *rotat_Z_3D = create_user_tree_node("rotation axe Z"); add_child_node(rotat_3D, rotat_Z_3D); + struct TreeNode_t *control = create_user_tree_node("negative feedback (control)"); add_child_node(regulate, control); + struct TreeNode_t *enhance = create_user_tree_node("positive feedback (enhance)"); add_child_node(regulate, enhance);*/ + struct TreeNode_t *n_importe = create_user_tree_node("n'importe"); add_child_node(catalysed, n_importe); + struct TreeNode_t *quoi = create_user_tree_node("quoi"); add_child_node(n_importe, quoi); + struct TreeNode_t *ma_qué = create_user_tree_node("ma_qué"); add_child_node(quoi, ma_qué); +} + void on_user_tree_expander_toggled(GtkExpander *expander, gpointer user_data) { // This is a conceptual callback for when an expander is toggled @@ -92,35 +123,7 @@ static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child) GtkScrolledWindow *get_user_rules_tree (){ struct TreeNode_t *tree_root = create_user_tree_node("root"); -/* struct TreeNode_t *move_random = create_user_tree_node("move random"); add_child_node(tree_root, move_random); - struct TreeNode_t *isole = create_user_tree_node("isolated object"); add_child_node(move_random, isole); - struct TreeNode_t *isole_1D = create_user_tree_node("isolated object move 1D"); add_child_node(isole, isole_1D); - struct TreeNode_t *isole_2D = create_user_tree_node("isolated object move 2D"); add_child_node(isole, isole_2D); - struct TreeNode_t *isole_3D = create_user_tree_node("isolated object move 3D"); add_child_node(isole, isole_3D); - struct TreeNode_t *translat_2D = create_user_tree_node("translation"); add_child_node(isole_2D, translat_2D); - struct TreeNode_t *rotat_2D = create_user_tree_node("rotation"); add_child_node(isole_2D, rotat_2D); - struct TreeNode_t *rotat_X_2D = create_user_tree_node("rotation axe X"); add_child_node(rotat_2D, rotat_X_2D); - struct TreeNode_t *rotat_Y_2D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_2D, rotat_Y_2D); - struct TreeNode_t *translat_3D = create_user_tree_node("translation"); add_child_node(isole_3D, translat_3D); - struct TreeNode_t *rotat_3D = create_user_tree_node("rotation"); add_child_node(isole_3D, rotat_3D); - struct TreeNode_t *rotat_X_3D = create_user_tree_node("rotation axe X"); add_child_node(rotat_3D, rotat_X_3D); - struct TreeNode_t *rotat_Y_3D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_3D, rotat_Y_3D); - struct TreeNode_t *rotat_Z_3D = create_user_tree_node("rotation axe Z"); add_child_node(rotat_3D, rotat_Z_3D); - struct TreeNode_t *relie = create_user_tree_node("part of object"); add_child_node(move_random, relie); - struct TreeNode_t *move_determ = create_user_tree_node("move determ"); add_child_node(tree_root, move_determ); - struct TreeNode_t *transport = create_user_tree_node("transport"); add_child_node(tree_root, transport); - struct TreeNode_t *transform = create_user_tree_node("transform"); add_child_node(tree_root, transform); - struct TreeNode_t *regulate = create_user_tree_node("regulate"); add_child_node(tree_root, regulate); - struct TreeNode_t *control = create_user_tree_node("negative feedback (control)"); add_child_node(regulate, control); - struct TreeNode_t *enhance = create_user_tree_node("positive feedback (enhance)"); add_child_node(regulate, enhance); - struct TreeNode_t *no_payload = create_user_tree_node("free"); add_child_node(transport, no_payload); - struct TreeNode_t *charged = create_user_tree_node("charged"); add_child_node(transport, charged); - struct TreeNode_t *spontaneous = create_user_tree_node("spontaneous"); add_child_node(transform, spontaneous);*/ - struct TreeNode_t *transform = create_user_tree_node("transform"); add_child_node(tree_root, transform); - struct TreeNode_t *catalysed = create_user_tree_node("catalysed"); add_child_node(transform, catalysed); - struct TreeNode_t *n_importe = create_user_tree_node("n'importe"); add_child_node(catalysed, n_importe); - struct TreeNode_t *quoi = create_user_tree_node("quoi"); add_child_node(n_importe, quoi); - struct TreeNode_t *ma_qué = create_user_tree_node("ma_qué"); add_child_node(quoi, ma_qué); + create_a_complex_useless_and_expensive_tree (tree_root); GtkStringList *model = gtk_string_list_new(NULL); gtk_string_list_append (model, tree_root->text); @@ -151,3 +154,5 @@ GtkScrolledWindow *get_user_rules_tree (){ gtk_widget_set_visible (GTK_WIDGET (list_view), TRUE); return scrolled_window; } + +