C L E A N (functions names in fsm, widget, signal)

This commit is contained in:
Jean Sirmai 2024-07-21 13:01:30 +02:00
parent 1becb489de
commit b63ab7d93b
Signed by: jean
GPG Key ID: FB3115C340E057E3
6 changed files with 36 additions and 36 deletions

View File

@ -42,8 +42,8 @@ enum choice_STATE_RULES_DATA { STATE, RULES, DATA }; // xor
int fsm_get_exec_edit (); int fsm_get_exec_edit ();
int fsm_get_state_rules_data (); int fsm_get_state_rules_data ();
int fsm_get_OBJECTS_box_RESET_VALUE (); int fsm_get_objects_box_reset_value ();
int fsm_get_SITUATIONS_box_RESET_VALUE (); int fsm_get_situations_box_reset_value ();
void fsm_set_exec_edit (int value); void fsm_set_exec_edit (int value);
void fsm_set_state_rules_data (int value); void fsm_set_state_rules_data (int value);

View File

@ -36,16 +36,16 @@ void on_windows_activation (GtkApplication *app, gpointer user_data);
// all other callbacks are in 'signal.c' // all other callbacks are in 'signal.c'
void on_toggle_exec_edit (GtkWidget *btt_XOR_EXEC_EDIT, gpointer user_data); void on_toggle_exec_edit (GtkWidget *btt_XOR_EXEC_EDIT, gpointer user_data);
void on_toggle_state_rules_data (GtkWidget *btt, gpointer user_data); void on_toggle_state_rules_data (GtkWidget *btt_STATE_RULES_DATA, gpointer user_data);
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data); //void on_toggle_model_run_stop (GtkWidget *btt_MODEL_RUN_STOP, gpointer data);
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data); //void on_open_state (GtkWidget *btt_open_STATE, gpointer data);
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data); //void on_open_rules (GtkWidget *btt_open_RULES, gpointer data);
void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data); //void on_open_data (GtkWidget *btt_open_DATA, gpointer data);
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data); void on_save_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data);
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data); void on_discard_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data);
void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data); void on_write_current_model (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data);
void on_setup_user_menu_factory (GtkSignalListItemFactory *factory, void on_setup_user_menu_factory (GtkSignalListItemFactory *factory,
@ -66,10 +66,10 @@ void on_glarea_unrealize (GtkWidget *widget);
void on_axis_value_change (GtkAdjustment *adjustment, gpointer data); void on_axis_value_change (GtkAdjustment *adjustment, gpointer data);
void on_OBJECTS_box_DO_RESET (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar); void on_objects_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar);
void on_SITUATIONS_box_DO_RESET (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar); void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar);
void on_clicked_HOME (GtkWidget *btt_reset, gpointer data); void on_clicked_home (GtkWidget *btt_reset, gpointer data);
//void on_clicked_MENU_list_box (GtkWidget *btt_reset, gpointer data); //void on_clicked_MENU_list_box (GtkWidget *btt_reset, gpointer data);
//void on_clicked_MENU_pop (GtkWidget *btt_reset, gpointer data); //void on_clicked_MENU_pop (GtkWidget *btt_reset, gpointer data);
void on_clicked_search (GtkWidget *btt_menu, gpointer list_box); void on_clicked_search (GtkWidget *btt_menu, gpointer list_box);

View File

@ -87,7 +87,7 @@ void fsm_reset_all_situations_transparencies_at_value (int value)
reset_all_situations_transparencies_to_value (value); reset_all_situations_transparencies_to_value (value);
} }
void fsm_set_SITUATIONS_box_RESET_VALUE (int value) void fsm_set_situations_box_reset_value (int value)
{ {
if (choice_SITUATIONS_box_RESET_VALUE != value) { if (choice_SITUATIONS_box_RESET_VALUE != value) {
debug_printing (value, 3); // SITUATIONS_box_RESET_VALUE is sub_automaton 3 debug_printing (value, 3); // SITUATIONS_box_RESET_VALUE is sub_automaton 3
@ -97,8 +97,8 @@ void fsm_set_SITUATIONS_box_RESET_VALUE (int value)
int fsm_get_exec_edit () {return choice_EXEC_EDIT;} int fsm_get_exec_edit () {return choice_EXEC_EDIT;}
int fsm_get_state_rules_data () {return choice_STATE_RULES_DATA;} int fsm_get_state_rules_data () {return choice_STATE_RULES_DATA;}
int fsm_get_OBJECTS_box_RESET_VALUE () {return choice_OBJECTS_box_RESET_VALUE;} int fsm_get_objects_box_reset_value () {return choice_OBJECTS_box_RESET_VALUE;}
int fsm_get_SITUATIONS_box_RESET_VALUE () {return choice_SITUATIONS_box_RESET_VALUE;} int fsm_get_situations_box_reset_value () {return choice_SITUATIONS_box_RESET_VALUE;}
/******************************************************************************/ /******************************************************************************/
@ -124,11 +124,11 @@ static void debug_printing (int value, int sub_automaton)
tab_0 [choice_EXEC_EDIT], tab_0 [choice_EXEC_EDIT],
tab_1 [value]); tab_1 [value]);
break; break;
case (2) : printf("fsm_set_OBJECTS_box_RESET_VALUE : %3d > %3d\n", case (2) : printf("fsm_set_objects_box_reset_value : %3d > %3d\n",
fsm_get_OBJECTS_box_RESET_VALUE(), value); fsm_get_objects_box_reset_value(), value);
break; break;
case (3) : printf("fsm_set_SITUATIONS_box_RESET_VALUE : %3d > %3d\n", case (3) : printf("fsm_set_situations_box_reset_value : %3d > %3d\n",
fsm_get_SITUATIONS_box_RESET_VALUE(), value); fsm_get_situations_box_reset_value(), value);
break; break;
default : printf("default in automaton.debug_printing()\n"); default : printf("default in automaton.debug_printing()\n");
} }

View File

@ -199,7 +199,7 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
/* D I A L O G W I D G E T S */ /* D I A L O G W I D G E T S */
/******************************************************************************/ /******************************************************************************/
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, void on_save_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL,
gpointer data) gpointer data)
{ {
gtk_widget_set_sensitive (GTK_WIDGET (data), gtk_widget_set_sensitive (GTK_WIDGET (data),
@ -207,14 +207,14 @@ void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL,
printf ("callback.c - SAVE_CURRENT_MODEL_BEFORE_EDITING\n"); printf ("callback.c - SAVE_CURRENT_MODEL_BEFORE_EDITING\n");
} }
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, void on_discard_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL,
gpointer data) gpointer data)
{ {
gtk_window_close (GTK_WINDOW (data)); gtk_window_close (GTK_WINDOW (data));
printf ("callback.c - DISCARD_CURRENT_MODEL_AND_START_EDITING\n"); printf ("callback.c - DISCARD_CURRENT_MODEL_AND_START_EDITING\n");
} }
void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, void on_write_current_model (GtkWidget *btt_WRITE_CURRENT_MODEL,
gpointer data) gpointer data)
{ {
gtk_window_close (GTK_WINDOW (data)); gtk_window_close (GTK_WINDOW (data));
@ -296,13 +296,13 @@ void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data)
} }
} }
void on_OBJECTS_box_DO_RESET (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar) void on_objects_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar)
{ {
GtkAdjustment *adj_obj = gtk_scrollbar_get_adjustment (reset_scrollbar); GtkAdjustment *adj_obj = gtk_scrollbar_get_adjustment (reset_scrollbar);
fsm_reset_all_objects_transparencies_at_value (gtk_adjustment_get_value (adj_obj)); fsm_reset_all_objects_transparencies_at_value (gtk_adjustment_get_value (adj_obj));
} }
void on_SITUATIONS_box_DO_RESET (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar) void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar)
{ {
GtkAdjustment *adj_situ = gtk_scrollbar_get_adjustment (reset_scrollbar); GtkAdjustment *adj_situ = gtk_scrollbar_get_adjustment (reset_scrollbar);
fsm_reset_all_situations_transparencies_at_value (gtk_adjustment_get_value (adj_situ)); fsm_reset_all_situations_transparencies_at_value (gtk_adjustment_get_value (adj_situ));
@ -319,7 +319,7 @@ void on_clicked_search (GtkWidget *btt_menu, gpointer list_box) {
gtk_window_present (GTK_WINDOW (widget_get_text_window())); gtk_window_present (GTK_WINDOW (widget_get_text_window()));
} }
void on_clicked_HOME (GtkWidget *btt_reset, gpointer data) void on_clicked_home (GtkWidget *btt_reset, gpointer data)
{ {
printf ("callback.on_clicked_HOME() button presents the dialog_window\ printf ("callback.on_clicked_HOME() button presents the dialog_window\
( :- ) but it works only once.\n"); // TODO ( :- ) but it works only once.\n"); // TODO

View File

@ -108,7 +108,7 @@ static GtkBox *rec_OBJECTS_box()
gtk_box_append (objects_box, GTK_WIDGET (reset_scrollbar)); gtk_box_append (objects_box, GTK_WIDGET (reset_scrollbar));
GtkWidget *btt_reset = gtk_toggle_button_new (); GtkWidget *btt_reset = gtk_toggle_button_new ();
gtk_button_set_icon_name (GTK_BUTTON (btt_reset), "view-refresh-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (btt_reset), "view-refresh-symbolic");
g_signal_connect (btt_reset, "toggled", G_CALLBACK (on_OBJECTS_box_DO_RESET), reset_scrollbar); g_signal_connect (btt_reset, "toggled", G_CALLBACK (on_objects_box_do_reset), reset_scrollbar);
gtk_box_append (objects_box, btt_reset); gtk_box_append (objects_box, btt_reset);
// GtkAdjustment *object_adjust [n_objects]; // (value, lower, upper, step_increment, page_increment, page_size) // GtkAdjustment *object_adjust [n_objects]; // (value, lower, upper, step_increment, page_increment, page_size)
@ -152,7 +152,7 @@ static GtkBox *rec_SITUATIONS_box()
gtk_box_append (situations_box, GTK_WIDGET (reset_scrollbar)); gtk_box_append (situations_box, GTK_WIDGET (reset_scrollbar));
GtkWidget *btt_reset = gtk_toggle_button_new (); GtkWidget *btt_reset = gtk_toggle_button_new ();
gtk_button_set_icon_name (GTK_BUTTON (btt_reset), "view-refresh-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (btt_reset), "view-refresh-symbolic");
g_signal_connect (btt_reset, "toggled", G_CALLBACK (on_SITUATIONS_box_DO_RESET), reset_scrollbar); g_signal_connect (btt_reset, "toggled", G_CALLBACK (on_situations_box_do_reset), reset_scrollbar);
gtk_box_append (situations_box, btt_reset); gtk_box_append (situations_box, btt_reset);
for (int i = 0; i < n_situations; i++) for (int i = 0; i < n_situations; i++)

View File

@ -79,15 +79,15 @@ void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_wind
GtkButton *action_save_current_model = GTK_BUTTON (gtk_button_new_with_label (txt)); GtkButton *action_save_current_model = GTK_BUTTON (gtk_button_new_with_label (txt));
gtk_widget_set_sensitive (GTK_WIDGET (action_save_current_model), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (action_save_current_model), FALSE);
g_signal_connect (action_save_current_model, "clicked", g_signal_connect (action_save_current_model, "clicked",
G_CALLBACK (on_WRITE_CURRENT_MODEL), dialog_window); G_CALLBACK (on_write_current_model), dialog_window);
GtkButton *click_yes = GTK_BUTTON (gtk_button_new_with_label ("YES")); GtkButton *click_yes = GTK_BUTTON (gtk_button_new_with_label ("YES"));
g_signal_connect (click_yes, "clicked", g_signal_connect (click_yes, "clicked",
G_CALLBACK (on_SAVE_CURRENT_MODEL_BEFORE_EDITING), action_save_current_model); G_CALLBACK (on_save_current_model_before_editing), action_save_current_model);
GtkButton *click_no = GTK_BUTTON (gtk_button_new_with_label ("NO")); GtkButton *click_no = GTK_BUTTON (gtk_button_new_with_label ("NO"));
g_signal_connect (click_no, "clicked", g_signal_connect (click_no, "clicked",
G_CALLBACK (on_DISCARD_CURRENT_MODEL_AND_START_EDITING), dialog_window); G_CALLBACK (on_discard_current_model_before_editing), dialog_window);
gtk_grid_attach (GTK_GRID (dialog_window_grid), GTK_WIDGET (click_yes), 0, 0, 1, 1) ; gtk_grid_attach (GTK_GRID (dialog_window_grid), GTK_WIDGET (click_yes), 0, 0, 1, 1) ;
gtk_grid_attach (GTK_GRID (dialog_window_grid), GTK_WIDGET (click_no), 1, 0, 1, 1) ; gtk_grid_attach (GTK_GRID (dialog_window_grid), GTK_WIDGET (click_no), 1, 0, 1, 1) ;
@ -148,19 +148,19 @@ static void window_header_bar_left (GtkWidget *header_bar)
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | ")); GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | "));
GtkCheckButton *group_state_rule_data = GTK_CHECK_BUTTON (gtk_check_button_new ()); GtkCheckButton *group_state_rules_data = GTK_CHECK_BUTTON (gtk_check_button_new ());
btt_STATE = GTK_BUTTON (gtk_check_button_new_with_label ("state")); btt_STATE = GTK_BUTTON (gtk_check_button_new_with_label ("state"));
g_signal_connect (btt_STATE, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data); g_signal_connect (btt_STATE, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data);
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_STATE), group_state_rule_data); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_STATE), group_state_rules_data);
btt_RULES = GTK_BUTTON (gtk_check_button_new_with_label ("rules")); btt_RULES = GTK_BUTTON (gtk_check_button_new_with_label ("rules"));
g_signal_connect (btt_RULES, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data); g_signal_connect (btt_RULES, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data);
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_RULES), group_state_rule_data); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_RULES), group_state_rules_data);
btt_DATA = GTK_BUTTON (gtk_check_button_new_with_label ("data analysis")); btt_DATA = GTK_BUTTON (gtk_check_button_new_with_label ("data analysis"));
g_signal_connect (btt_DATA, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data); g_signal_connect (btt_DATA, "toggled", G_CALLBACK (on_toggle_state_rules_data), no_local_data);
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_DATA), group_state_rule_data); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_DATA), group_state_rules_data);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label));
@ -184,7 +184,7 @@ static void window_header_bar_right (GtkWidget *header_bar)
GtkButton *btt_go_home = GTK_BUTTON (gtk_button_new ()); GtkButton *btt_go_home = GTK_BUTTON (gtk_button_new ());
gtk_button_set_icon_name (btt_go_home, "go-home-symbolic"); gtk_button_set_icon_name (btt_go_home, "go-home-symbolic");
g_signal_connect (btt_go_home, "clicked", G_CALLBACK (on_clicked_HOME), no_local_data); g_signal_connect (btt_go_home, "clicked", G_CALLBACK (on_clicked_home), no_local_data);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_go_home)); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_go_home));
GtkButton *search = GTK_BUTTON (gtk_button_new ()); GtkButton *search = GTK_BUTTON (gtk_button_new ());