WIP: renaming (UPPER CASE > lower case) functions names
This commit is contained in:
parent
27a3f54851
commit
1becb489de
|
@ -40,13 +40,13 @@
|
|||
enum choice_EXEC_EDIT { EXEC, EDIT }; // xor
|
||||
enum choice_STATE_RULES_DATA { STATE, RULES, DATA }; // xor
|
||||
|
||||
int fsm_get_EXEC_EDIT ();
|
||||
int fsm_get_STATE_RULES_DATA ();
|
||||
int fsm_get_exec_edit ();
|
||||
int fsm_get_state_rules_data ();
|
||||
int fsm_get_OBJECTS_box_RESET_VALUE ();
|
||||
int fsm_get_SITUATIONS_box_RESET_VALUE ();
|
||||
|
||||
void fsm_set_EXEC_EDIT (int value);
|
||||
void fsm_set_STATE_RULES_DATA (int value);
|
||||
void fsm_set_exec_edit (int value);
|
||||
void fsm_set_state_rules_data (int value);
|
||||
|
||||
void fsm_reset_all_objects_transparencies_at_value (int value);
|
||||
void fsm_reset_all_situations_transparencies_at_value (int value);
|
||||
|
|
|
@ -31,12 +31,12 @@
|
|||
#pragma once
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
// void on_auto_notification (const char *message);
|
||||
|
||||
// on_windows_activation (app) is in 'init.c' (not 'signal.c') for simplicity
|
||||
void on_windows_activation (GtkApplication *app, gpointer user_data);
|
||||
// all other callbacks are in 'signal.c'
|
||||
|
||||
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_exec_edit (GtkWidget *btt_XOR_EXEC_EDIT, gpointer user_data);
|
||||
void on_toggle_state_rules_data (GtkWidget *btt, gpointer user_data);
|
||||
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data);
|
||||
|
||||
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data);
|
||||
|
@ -75,6 +75,8 @@ void on_clicked_HOME (GtkWidget *btt_reset, gpointer data);
|
|||
void on_clicked_search (GtkWidget *btt_menu, gpointer list_box);
|
||||
void on_clicked_menu_experiment (GtkWidget *btt_menu, gpointer list_box);
|
||||
|
||||
// void on_auto_notification (const char *message);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -40,15 +40,13 @@
|
|||
|
||||
void widget_create_windows (GtkApplication *app);
|
||||
|
||||
void widget_topbar_design_main_window (GtkWindow *main_window);
|
||||
void widget_topbar_design_dialog_window (GtkWindow *main_window,
|
||||
GtkWindow *dialog_window);
|
||||
void widget_topbar_design_text_window (GtkWindow *main_window,
|
||||
GtkWindow *text_window);
|
||||
void widget_design_main_window (GtkWindow *main_window);
|
||||
void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window);
|
||||
void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window);
|
||||
|
||||
void *widget_topbar_get_main_window();
|
||||
void *widget_topbar_get_dialog_window();
|
||||
void *widget_topbar_get_text_window();
|
||||
void *widget_get_main_window();
|
||||
void *widget_get_dialog_window();
|
||||
void *widget_get_text_window();
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -49,7 +49,7 @@ static int choice_SITUATIONS_box_RESET_VALUE = 0;
|
|||
|
||||
static void debug_printing (int value, int sub_automaton);
|
||||
|
||||
void fsm_set_EXEC_EDIT (int value)
|
||||
void fsm_set_exec_edit (int value)
|
||||
{
|
||||
if (choice_EXEC_EDIT != value) {
|
||||
debug_printing (value, 0); // EXEC_EDIT is sub_automaton 0
|
||||
|
@ -57,7 +57,7 @@ void fsm_set_EXEC_EDIT (int value)
|
|||
}
|
||||
}
|
||||
|
||||
void fsm_set_STATE_RULES_DATA (int value)
|
||||
void fsm_set_state_rules_data (int value)
|
||||
{
|
||||
if (choice_STATE_RULES_DATA != value) {
|
||||
debug_printing (value, 1); // STATE_RULES_DATA is sub_automaton 1
|
||||
|
@ -95,8 +95,8 @@ void fsm_set_SITUATIONS_box_RESET_VALUE (int value)
|
|||
}
|
||||
}
|
||||
|
||||
int fsm_get_EXEC_EDIT () {return choice_EXEC_EDIT;}
|
||||
int fsm_get_STATE_RULES_DATA () {return choice_STATE_RULES_DATA;}
|
||||
int fsm_get_exec_edit () {return choice_EXEC_EDIT;}
|
||||
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_SITUATIONS_box_RESET_VALUE () {return choice_SITUATIONS_box_RESET_VALUE;}
|
||||
|
||||
|
|
38
src/signal.c
38
src/signal.c
|
@ -227,37 +227,37 @@ void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL,
|
|||
/* S T A T E W I D G E T */
|
||||
/******************************************************************************/
|
||||
|
||||
static void switch_STATE_RULES_DATA()
|
||||
static void switch_state_rules_data()
|
||||
{
|
||||
switch (fsm_get_STATE_RULES_DATA()) {
|
||||
switch (fsm_get_state_rules_data()) {
|
||||
|
||||
case (STATE) :
|
||||
gtk_window_set_child (GTK_WINDOW (widget_topbar_get_main_window ()),
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_rec_state_page()));
|
||||
break;
|
||||
|
||||
case (RULES) :
|
||||
gtk_window_set_child (GTK_WINDOW (widget_topbar_get_main_window ()),
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_rec_rules_page()));
|
||||
break;
|
||||
|
||||
case (DATA) :
|
||||
gtk_window_set_child (GTK_WINDOW (widget_topbar_get_main_window ()),
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_rec_stock_page()));
|
||||
break;
|
||||
|
||||
default :
|
||||
printf("default in callback.on_toggle_STATE_RULES_DATA()\n");
|
||||
printf("default in callback.on_toggle_state_rule_data()\n");
|
||||
}
|
||||
}
|
||||
|
||||
void on_toggle_EXEC_EDIT (GtkWidget *toggled_button, gpointer user_data)
|
||||
void on_toggle_exec_edit (GtkWidget *toggled_button, gpointer user_data)
|
||||
{
|
||||
if (fsm_get_EXEC_EDIT ()) {
|
||||
if (fsm_get_exec_edit ()) {
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button),
|
||||
"power-profile-balanced-rtl-symbolic");
|
||||
fsm_set_EXEC_EDIT (EXEC);
|
||||
fsm_set_exec_edit (EXEC);
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -265,34 +265,34 @@ void on_toggle_EXEC_EDIT (GtkWidget *toggled_button, gpointer user_data)
|
|||
"text-editor-symbolic");
|
||||
|
||||
// https://docs.gtk.org/gtk4/class.Window.html TODO 2024-06-30
|
||||
// gtk_window_present (GTK_WINDOW (widget_topbar_get_dialog_window())); // works once only !
|
||||
// gtk_window_present (GTK_WINDOW (widget_get_dialog_window())); // works once only !
|
||||
|
||||
fsm_set_EXEC_EDIT (EDIT);
|
||||
fsm_set_exec_edit (EDIT);
|
||||
}
|
||||
|
||||
switch_STATE_RULES_DATA();
|
||||
switch_state_rules_data();
|
||||
}
|
||||
|
||||
void on_toggle_STATE_RULES_DATA (GtkWidget *toggled_button, gpointer user_data)
|
||||
void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data)
|
||||
{
|
||||
const char *toggled_button_name
|
||||
= gtk_check_button_get_label (GTK_CHECK_BUTTON (toggled_button));
|
||||
int is_active = gtk_check_button_get_active (GTK_CHECK_BUTTON (toggled_button));
|
||||
|
||||
if (! strcmp (toggled_button_name, "state")) {
|
||||
fsm_set_STATE_RULES_DATA (STATE);
|
||||
fsm_set_state_rules_data (STATE);
|
||||
}
|
||||
|
||||
if (! strcmp (toggled_button_name, "rules")) {
|
||||
fsm_set_STATE_RULES_DATA (RULES);
|
||||
fsm_set_state_rules_data (RULES);
|
||||
}
|
||||
|
||||
if (! strcmp (toggled_button_name, "data analysis")) {
|
||||
fsm_set_STATE_RULES_DATA (DATA);
|
||||
fsm_set_state_rules_data (DATA);
|
||||
}
|
||||
|
||||
if (is_active) {
|
||||
switch_STATE_RULES_DATA();
|
||||
switch_state_rules_data();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,14 +316,14 @@ void on_SITUATIONS_box_DO_RESET (GtkWidget *btt_reset, GtkScrollbar *reset_scrol
|
|||
|
||||
void on_clicked_search (GtkWidget *btt_menu, gpointer list_box) {
|
||||
// next line presents the text_window and works only once.\nIt should present a menu.\n"); // TODO
|
||||
gtk_window_present (GTK_WINDOW (widget_topbar_get_text_window()));
|
||||
gtk_window_present (GTK_WINDOW (widget_get_text_window()));
|
||||
}
|
||||
|
||||
void on_clicked_HOME (GtkWidget *btt_reset, gpointer data)
|
||||
{
|
||||
printf ("callback.on_clicked_HOME() button presents the dialog_window\
|
||||
( :- ) but it works only once.\n"); // TODO
|
||||
gtk_window_present (GTK_WINDOW (widget_topbar_get_dialog_window()));
|
||||
gtk_window_present (GTK_WINDOW (widget_get_dialog_window()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
|
||||
static GtkWindow *main_window, *dialog_window, *text_window;
|
||||
|
||||
void *widget_topbar_get_main_window() { return main_window; }
|
||||
void *widget_topbar_get_dialog_window() { return dialog_window; }
|
||||
void *widget_topbar_get_text_window() { return text_window; }
|
||||
void *widget_get_main_window() { return main_window; }
|
||||
void *widget_get_dialog_window() { return dialog_window; }
|
||||
void *widget_get_text_window() { return text_window; }
|
||||
|
||||
void on_windows_activation (GtkApplication *app)
|
||||
{
|
||||
|
@ -51,8 +51,8 @@ void on_windows_activation (GtkApplication *app)
|
|||
dialog_window = GTK_WINDOW (gtk_application_window_new (app));
|
||||
text_window = GTK_WINDOW (gtk_application_window_new (app));
|
||||
|
||||
widget_topbar_design_main_window (main_window);
|
||||
widget_topbar_design_dialog_window (main_window, dialog_window);
|
||||
widget_topbar_design_text_window (main_window, text_window);
|
||||
widget_design_main_window (main_window);
|
||||
widget_design_dialog_window (main_window, dialog_window);
|
||||
widget_design_text_window (main_window, text_window);
|
||||
}
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ GtkWidget *widget_rec_state_page()
|
|||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (page_box, GTK_WIDGET (rec_SPACE_VIEW_box()));
|
||||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
if (fsm_get_EXEC_EDIT ()) gtk_box_append (page_box, GTK_WIDGET (rec_SPACE_EDIT_CONTROL_box()));
|
||||
if (fsm_get_exec_edit ()) gtk_box_append (page_box, GTK_WIDGET (rec_SPACE_EDIT_CONTROL_box()));
|
||||
else gtk_box_append (page_box, GTK_WIDGET (rec_SEQUENCE_CONTROL_box()));
|
||||
return GTK_WIDGET (page_box);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ static GtkButton *btt_STATE, *btt_RULES, *btt_DATA;
|
|||
/* T E X T W I N D O W */
|
||||
/******************************************************************************/
|
||||
|
||||
void widget_topbar_design_text_window (GtkWindow *main_window, GtkWindow *text_window)
|
||||
void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window)
|
||||
{
|
||||
char *title = " Learn more about Gem Graph. ";
|
||||
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
|
@ -66,7 +66,7 @@ void widget_topbar_design_text_window (GtkWindow *main_window, GtkWindow *text_w
|
|||
/* D I A L O G W I N D O W */
|
||||
/******************************************************************************/
|
||||
|
||||
void widget_topbar_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window)
|
||||
void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window)
|
||||
{
|
||||
char *title = " Save the current model before modifying it? ";
|
||||
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
|
@ -111,12 +111,12 @@ static void window_header_bar_left (GtkWidget *header_bar);
|
|||
static void window_header_bar_right (GtkWidget *header_bar);
|
||||
|
||||
|
||||
void widget_topbar_design_main_window (GtkWindow *main_window)
|
||||
void widget_design_main_window (GtkWindow *main_window)
|
||||
{
|
||||
GtkWidget *header_bar = window_header_bar (main_window);
|
||||
window_header_bar_left (header_bar);
|
||||
window_header_bar_right (header_bar);
|
||||
// next line <=> calls.on_toggle_STATE_RULES_DATA (btt_STATE)
|
||||
// next line <=> calls.on_toggle_state_rule_data (btt_STATE)
|
||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (btt_STATE), TRUE);
|
||||
gtk_window_present (GTK_WINDOW (main_window));
|
||||
}
|
||||
|
@ -144,23 +144,23 @@ static void window_header_bar_left (GtkWidget *header_bar)
|
|||
GtkButton *btt_XOR_EXEC_EDIT = GTK_BUTTON (gtk_toggle_button_new ());
|
||||
gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "system-run-symbolic");
|
||||
gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "power-profile-balanced-rtl-symbolic");
|
||||
g_signal_connect (btt_XOR_EXEC_EDIT, "clicked", G_CALLBACK (on_toggle_EXEC_EDIT), no_local_data);
|
||||
g_signal_connect (btt_XOR_EXEC_EDIT, "clicked", G_CALLBACK (on_toggle_exec_edit), no_local_data);
|
||||
|
||||
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | "));
|
||||
|
||||
GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ());
|
||||
GtkCheckButton *group_state_rule_data = GTK_CHECK_BUTTON (gtk_check_button_new ());
|
||||
|
||||
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);
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_STATE), group_STATE_RULES_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);
|
||||
|
||||
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);
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_RULES), group_STATE_RULES_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);
|
||||
|
||||
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);
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_DATA), group_STATE_RULES_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_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));
|
||||
|
|
Loading…
Reference in New Issue