WIP: cleaning > attention: « graph_stack » est utilisé sans avoir été initialisé <

This commit is contained in:
Jean Sirmai 2024-07-03 15:39:45 +02:00
parent 75a3b7d947
commit 21e840ef21
Signed by: jean
GPG Key ID: FB3115C340E057E3
12 changed files with 36 additions and 27 deletions

View File

@ -38,7 +38,7 @@ static struct stack_index_t *stack_index = NULL;
size_t stack_index_size = 0; 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 arrows_nb,
int space_X, int space_X,
int space_Y, int space_Y,
@ -48,7 +48,7 @@ int set_arrow (int stack_id, // 2024-06-27 DEBUG !
int arrow_x, int arrow_x,
int arrow_y, int arrow_y,
int arrow_z) { 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; return 0;
} // 2024-06-27 DEBUG ! } // 2024-06-27 DEBUG !

View File

@ -219,7 +219,7 @@ bool graph_shutdown(const int id, void *error_buffer)
* and allows ulterior creations, suppressions or modifications of the arrows[] array * and allows ulterior creations, suppressions or modifications of the arrows[] array
* *
* draws the space() * 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 * Initialisation du générateur pseudo-aléatoire
* Attention, les vertex centraux de chaque unité d'espace (cube) * 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)) { while (model_get_next_arrow(&arrow, (char *)&state_id, dimension)) {
g_print("[GRAPH DEBUG] cur arrow has x = %d\n", arrow.x); 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) if (graph_stack->arrows_nb != announced_arrows_nb)

View File

@ -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_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_end_child (EXEC_CONTROLS_pane, GTK_WIDGET (get_RUN_STOP_box()));
gtk_paned_set_position (EXEC_CONTROLS_pane, LOWER_COMPARTMENT_PARTITION); 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); 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 (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (central_box, GTK_WIDGET (right_box)); 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); 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 ()); GtkButton *go_home = GTK_BUTTON (gtk_button_new ());
gtk_button_set_icon_name (go_home, "go-home-symbolic"); 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 ()); GtkButton *search = GTK_BUTTON (gtk_button_new ());
gtk_button_set_icon_name (search, "user-trash-symbolic"); 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, "preferences-desktop-appearance-symbolic");
gtk_button_set_icon_name (search, "applications-utilities-symbolic"); gtk_button_set_icon_name (search, "applications-utilities-symbolic");
gtk_button_set_icon_name (search, "folder-saved-search-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 ()); GtkButton *open_menu = GTK_BUTTON (gtk_button_new ());
gtk_button_set_icon_name (open_menu, "open-menu-symbolic"); 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){ void main_window_design (GtkWindow *main_window){
@ -297,16 +297,16 @@ static GtkBox *get_objects_box(){
GtkAdjustment *adjust = NULL; GtkAdjustment *adjust = NULL;
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
adjust = gtk_adjustment_new (rand() % 127, 0, 127, 1, 0, 4); 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]; char tooltip_text[8];
sprintf(tooltip_text, "\n%d\n", i); sprintf(tooltip_text, "\n%d\n", i);
if (0 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " membrane "); if (0 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " membrane ");
if (1 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " co-enzyme A "); 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 (scrollbar_i, " ATP synthase "); if (2 == i % 5) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " ATP synthase ");
if (3 == i % 5) gtk_widget_set_tooltip_text (scrollbar_i, " any object name "); 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 (scrollbar_i, tooltip_text); 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, gtk_label_new (" "));
gtk_box_append (objects_box, scrollbar_i); gtk_box_append (objects_box, GTK_WIDGET (scrollbar_i));
} }
return objects_box; return objects_box;
} }
@ -316,19 +316,19 @@ static GtkBox *get_situations_box(){
GtkAdjustment *adjust = NULL; GtkAdjustment *adjust = NULL;
for (int i = 0; i < 128; i++) { for (int i = 0; i < 128; i++) {
adjust = gtk_adjustment_new (rand() % 127, 0, 127, 1, 0, 4); 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]; char tooltip_text[8];
sprintf(tooltip_text, "\n%d\n", i); sprintf(tooltip_text, "\n%d\n", i);
if (0 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " transcription "); if (0 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " transcription ");
if (1 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " transport Na/K "); 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 (scrollbar_i, " ubiquitination "); if (2 == i % 8) gtk_widget_set_tooltip_text (GTK_WIDGET (scrollbar_i), " ubiquitination ");
if (3 == i % 8) gtk_widget_set_tooltip_text (scrollbar_i, " glycolyse aérobie "); 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 (scrollbar_i, " cycle de Krebs "); 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 (scrollbar_i, " shunt des pentoses "); 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 (scrollbar_i, " any situation name "); 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 (scrollbar_i, tooltip_text); 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, gtk_label_new (" "));
gtk_box_append (situations_box, scrollbar_i); gtk_box_append (situations_box, GTK_WIDGET (scrollbar_i));
} }
return situations_box; 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); 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_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_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); gtk_widget_set_size_request (objects_and_situations_horizontal_pane, 0, 127);
return objects_and_situations_horizontal_pane; return objects_and_situations_horizontal_pane;