From 21e840ef214dd7f876a2c95011d0ed71e832f181 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 3 Jul 2024 15:39:45 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20cleaning=20=20>=20attention:=20=C2=AB?= =?UTF-8?q?=C2=A0graph=5Fstack=C2=A0=C2=BB=20est=20utilis=C3=A9=20sans=20a?= =?UTF-8?q?voir=20=C3=A9t=C3=A9=20initialis=C3=A9=20 graph.c/area.c} | 4 +- src/{graph => graph.c}/draw.c | 0 src/{graph => graph.c}/grid.c | 0 src/{graph => graph.c}/init.c | 0 src/{graph => graph.c}/shader.frag | 0 src/{graph => graph.c}/shader.vert | 0 src/{graph/graph_stack.c => graph.c/stack.c} | 13 +++++- src/{widget => widget.c}/dialog.c | 0 src/{widget => widget.c}/tree_lab.c | 0 src/{widget => widget.c}/wdgt_lab_I | 0 src/{widget => widget.c}/wdgt_lab_II.c | 0 src/{widget => widget.c}/widgets.c | 46 ++++++++++---------- 12 files changed, 36 insertions(+), 27 deletions(-) rename src/{graph/graph_area.c => graph.c/area.c} (98%) rename src/{graph => graph.c}/draw.c (100%) rename src/{graph => graph.c}/grid.c (100%) rename src/{graph => graph.c}/init.c (100%) rename src/{graph => graph.c}/shader.frag (100%) rename src/{graph => graph.c}/shader.vert (100%) rename src/{graph/graph_stack.c => graph.c/stack.c} (94%) rename src/{widget => widget.c}/dialog.c (100%) rename src/{widget => widget.c}/tree_lab.c (100%) rename src/{widget => widget.c}/wdgt_lab_I (100%) rename src/{widget => widget.c}/wdgt_lab_II.c (100%) rename src/{widget => widget.c}/widgets.c (89%) diff --git a/src/graph/graph_area.c b/src/graph.c/area.c similarity index 98% rename from src/graph/graph_area.c rename to src/graph.c/area.c index a41f8f3..f83dc79 100644 --- a/src/graph/graph_area.c +++ b/src/graph.c/area.c @@ -38,7 +38,7 @@ static struct stack_index_t *stack_index = NULL; size_t stack_index_size = 0; -int set_arrow (int stack_id, // 2024-06-27 DEBUG ! +int graph_set_arrow (int stack_id, // 2024-06-27 DEBUG ! int arrows_nb, int space_X, int space_Y, @@ -48,7 +48,7 @@ int set_arrow (int stack_id, // 2024-06-27 DEBUG ! int arrow_x, int arrow_y, int arrow_z) { - printf("graph_area.c > int set_arrow (...) 2024-06-27 DEBUG\n"); + printf("graph_area.c > int graph_set_arrow (...) 2024-06-27 DEBUG\n"); return 0; } // 2024-06-27 DEBUG ! diff --git a/src/graph/draw.c b/src/graph.c/draw.c similarity index 100% rename from src/graph/draw.c rename to src/graph.c/draw.c diff --git a/src/graph/grid.c b/src/graph.c/grid.c similarity index 100% rename from src/graph/grid.c rename to src/graph.c/grid.c diff --git a/src/graph/init.c b/src/graph.c/init.c similarity index 100% rename from src/graph/init.c rename to src/graph.c/init.c diff --git a/src/graph/shader.frag b/src/graph.c/shader.frag similarity index 100% rename from src/graph/shader.frag rename to src/graph.c/shader.frag diff --git a/src/graph/shader.vert b/src/graph.c/shader.vert similarity index 100% rename from src/graph/shader.vert rename to src/graph.c/shader.vert diff --git a/src/graph/graph_stack.c b/src/graph.c/stack.c similarity index 94% rename from src/graph/graph_stack.c rename to src/graph.c/stack.c index 0c21365..c3767cd 100644 --- a/src/graph/graph_stack.c +++ b/src/graph.c/stack.c @@ -219,7 +219,7 @@ bool graph_shutdown(const int id, void *error_buffer) * and allows ulterior creations, suppressions or modifications of the arrows[] array * * draws the space() - * triggers set_arrows() that modifies the list () and draws arrows + * triggers graph_set_arrows() that modifies the list () and draws arrows * * Initialisation du générateur pseudo-aléatoire * Attention, les vertex centraux de chaque unité d'espace (cube) @@ -313,7 +313,16 @@ void graph_model_setup (const int stack_id) while (model_get_next_arrow(&arrow, (char *)&state_id, dimension)) { g_print("[GRAPH DEBUG] cur arrow has x = %d\n", arrow.x); - graph_stack->arrows_nb = set_arrow (stack_id, graph_stack->arrows_nb, space_X, space_Y, space_Z, arrow.load, arrow.site, arrow.x, arrow.y, arrow.z); + graph_stack->arrows_nb = graph_set_arrow (stack_id, + graph_stack->arrows_nb, + space_X, + space_Y, + space_Z, + arrow.load, + arrow.site, + arrow.x, + arrow.y, + arrow.z); } if (graph_stack->arrows_nb != announced_arrows_nb) diff --git a/src/widget/dialog.c b/src/widget.c/dialog.c similarity index 100% rename from src/widget/dialog.c rename to src/widget.c/dialog.c diff --git a/src/widget/tree_lab.c b/src/widget.c/tree_lab.c similarity index 100% rename from src/widget/tree_lab.c rename to src/widget.c/tree_lab.c diff --git a/src/widget/wdgt_lab_I b/src/widget.c/wdgt_lab_I similarity index 100% rename from src/widget/wdgt_lab_I rename to src/widget.c/wdgt_lab_I diff --git a/src/widget/wdgt_lab_II.c b/src/widget.c/wdgt_lab_II.c similarity index 100% rename from src/widget/wdgt_lab_II.c rename to src/widget.c/wdgt_lab_II.c diff --git a/src/widget/widgets.c b/src/widget.c/widgets.c similarity index 89% rename from src/widget/widgets.c rename to src/widget.c/widgets.c index d761325..3949193 100644 --- a/src/widget/widgets.c +++ b/src/widget.c/widgets.c @@ -193,7 +193,7 @@ static GtkWidget *get_TIME_EXEC_CONTROLS_box() { gtk_paned_set_start_child (EXEC_CONTROLS_pane, GTK_WIDGET (get_DO_UNDO_REDO_box())); gtk_paned_set_end_child (EXEC_CONTROLS_pane, GTK_WIDGET (get_RUN_STOP_box())); gtk_paned_set_position (EXEC_CONTROLS_pane, LOWER_COMPARTMENT_PARTITION); - gtk_widget_set_size_request (EXEC_CONTROLS_pane, 00, 200); + gtk_widget_set_size_request (GTK_WIDGET (EXEC_CONTROLS_pane), 00, 200); return GTK_WIDGET (EXEC_CONTROLS_pane); } @@ -213,7 +213,7 @@ GtkWidget *get_SPACE_VIEW_box() { gtk_box_append (central_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (central_box, GTK_WIDGET (right_box)); - gtk_widget_set_size_request (central_box, W - 00, 00); + gtk_widget_set_size_request (GTK_WIDGET (central_box), W - 00, 00); return GTK_WIDGET (central_box); } @@ -260,7 +260,7 @@ static void window_header_bar (GtkWindow *window, char *title){ GtkButton *go_home = GTK_BUTTON (gtk_button_new ()); gtk_button_set_icon_name (go_home, "go-home-symbolic"); - gtk_header_bar_pack_end (header_bar, GTK_WIDGET (go_home)); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (go_home)); GtkButton *search = GTK_BUTTON (gtk_button_new ()); gtk_button_set_icon_name (search, "user-trash-symbolic"); @@ -268,11 +268,11 @@ static void window_header_bar (GtkWindow *window, char *title){ gtk_button_set_icon_name (search, "preferences-desktop-appearance-symbolic"); gtk_button_set_icon_name (search, "applications-utilities-symbolic"); gtk_button_set_icon_name (search, "folder-saved-search-symbolic"); - gtk_header_bar_pack_end (header_bar, GTK_WIDGET (search)); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (search)); GtkButton *open_menu = GTK_BUTTON (gtk_button_new ()); gtk_button_set_icon_name (open_menu, "open-menu-symbolic"); - gtk_header_bar_pack_end (header_bar, GTK_WIDGET (open_menu)); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (open_menu)); } void main_window_design (GtkWindow *main_window){ @@ -297,16 +297,16 @@ static GtkBox *get_objects_box(){ GtkAdjustment *adjust = NULL; for (int i = 0; i < 32; i++) { adjust = gtk_adjustment_new (rand() % 127, 0, 127, 1, 0, 4); - GtkScrollbar *scrollbar_i = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust); + GtkScrollbar *scrollbar_i = GTK_SCROLLBAR (gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust)); char tooltip_text[8]; sprintf(tooltip_text, "\n%d\n", i); - if (0 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " membrane "); - if (1 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " co-enzyme A "); - if (2 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " ATP synthase "); - if (3 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " any object name "); - if (4 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, tooltip_text); + if (0 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " membrane "); + if (1 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " co-enzyme A "); + if (2 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " ATP synthase "); + if (3 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " any object name "); + if (4 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), tooltip_text); gtk_box_append (objects_box, gtk_label_new (" ")); - gtk_box_append (objects_box, scrollbar_i); + gtk_box_append (objects_box, GTK_WIDGET (scrollbar_i)); } return objects_box; } @@ -316,19 +316,19 @@ static GtkBox *get_situations_box(){ GtkAdjustment *adjust = NULL; for (int i = 0; i < 128; i++) { adjust = gtk_adjustment_new (rand() % 127, 0, 127, 1, 0, 4); - GtkScrollbar *scrollbar_i = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust); + GtkScrollbar *scrollbar_i = GTK_SCROLLBAR (gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust)); char tooltip_text[8]; sprintf(tooltip_text, "\n%d\n", i); - if (0 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " transcription "); - if (1 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " transport Na/K "); - if (2 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " ubiquitination "); - if (3 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " glycolyse aérobie "); - if (4 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " cycle de Krebs "); - if (5 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " shunt des pentoses "); - if (6 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " any situation name "); - if (7 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, tooltip_text); + if (0 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " transcription "); + if (1 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " transport Na/K "); + if (2 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " ubiquitination "); + if (3 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " glycolyse aérobie "); + if (4 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " cycle de Krebs "); + if (5 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " shunt des pentoses "); + if (6 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " any situation name "); + if (7 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), tooltip_text); gtk_box_append (situations_box, gtk_label_new (" ")); - gtk_box_append (situations_box, scrollbar_i); + gtk_box_append (situations_box, GTK_WIDGET (scrollbar_i)); } return situations_box; } @@ -349,7 +349,7 @@ static GtkWidget *get_OBJECTS_and_SITUATIONS(){ GtkWidget *objects_and_situations_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_set_start_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (scroll_objects)); gtk_paned_set_end_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (scroll_situations)); - gtk_paned_set_position (objects_and_situations_horizontal_pane, UPPER_COMPARTMENT_PARTITION); + gtk_paned_set_position (GTK_PANED (objects_and_situations_horizontal_pane), UPPER_COMPARTMENT_PARTITION); gtk_widget_set_size_request (objects_and_situations_horizontal_pane, 0, 127); return objects_and_situations_horizontal_pane;