journal fsm_journal_event (char *message, int severity, int source, const char *value)
This commit is contained in:
parent
167ee1254e
commit
10e6d95f53
|
@ -64,7 +64,7 @@ typedef struct disp_list {int value; struct disp_list *suiv;} disp_list ;
|
|||
enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
|
||||
|
||||
enum source {
|
||||
SOURCE, TARGET, VALUE, JOURNAL, FSM,
|
||||
SOURCE, TARGET, JOURNAL, FSM, PREFER,
|
||||
MAIN, APP, WIDGETS,
|
||||
MAIN_WINDOW, DIALOG_WINDOW, MODAL_WINDOW, TEXT_WINDOW, AUTO_NOTIFICATION,
|
||||
TOPBAR, TOPBAR_LEFT, TOPBAR_RIGHT, TOPBAR_CENTER,
|
||||
|
@ -74,9 +74,15 @@ enum source {
|
|||
RULE_GLAREA, RULE_CAMERA, RULES_TREE, RULES_COMPARE, RULES_USE,
|
||||
MEASURES_TOOLS, MEASURES__ACTIVITY, MEASURES__DISPLAY,
|
||||
TIME_DEP_RESULTS, TIME_INDEP_RESULTS,
|
||||
WIDGET, BUTTON, SCROLL, GLAREA, TEXT, LABEL, TREE, EXPANDER
|
||||
WIDGET, BUTTON, SCROLL, GLAREA, TEXT, LABEL, TREE, SLIDER, EXPANDER, ENTRY,
|
||||
SWITCH_STATE_RULES_DATA,
|
||||
SLIDER_X, SLIDER_Y, SLIDER_Z,
|
||||
SLIDER_A, SLIDER_B, SLIDER_C,
|
||||
};
|
||||
|
||||
enum value {
|
||||
VALUE
|
||||
};
|
||||
|
||||
#define JOURNAL_DATE_MAX_LENGTH 255
|
||||
|
||||
|
@ -105,7 +111,7 @@ void fsm_journal_test (char *message);
|
|||
// ref: sudo cat /var/log/messages
|
||||
// journal fsm_get_journal(); // def: fsm/dispatch call: fsm/prefer/fsm_store_restore_reset()
|
||||
void fsm_journal_publication_request (); // def: fsm/dispatch call: main;
|
||||
void fsm_journal_event (char *message, int priority, int widget, int action);
|
||||
void fsm_journal_event (char *message, int severity, int source, const char *value);
|
||||
// def: fsm/dispatch call: widget/dispatch;
|
||||
// --------------------------------------------------------------- WIP ------
|
||||
|
||||
|
|
|
@ -63,15 +63,15 @@ void fsm_journal_push (char *message) {fsm_journal_push_front (&gg_logs, message
|
|||
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW 😄️
|
||||
// 0 1 2 3 4 5 6
|
||||
#define CRITICAL___ERROR____WARNING___INFO____MESSAGE___DEBUG ___SPEW____😄️ 0
|
||||
void fsm_journal_event (char *message, int severity, int source, int target)
|
||||
void fsm_journal_event (char *message, int severity, int source, const char *value)
|
||||
{
|
||||
if (severity < SPEW
|
||||
&& source == MAIN
|
||||
// || source == FSM
|
||||
// && target == APP
|
||||
if
|
||||
(
|
||||
severity <= SPEW
|
||||
&& source == MAIN
|
||||
)
|
||||
|
||||
fsm_journal_push (message);
|
||||
fsm_journal_push (message); // TODO push (message + value)
|
||||
}
|
||||
#define MAIN___DIALOG___MODAL___TOPBAR___SYNTH___RULES___MEASURES___RESULTS___😄️ 0
|
||||
|
||||
|
@ -82,23 +82,23 @@ void fsm_journal_event (char *message, int severity, int source, int target)
|
|||
void fsm_init (char *initial_message_from_main)
|
||||
{
|
||||
fsm_journal_init (&gg_logs);
|
||||
fsm_journal_event (initial_message_from_main, MESSAGE, MAIN, TARGET);
|
||||
fsm_journal_event (initial_message_from_main, MESSAGE, MAIN, "");
|
||||
|
||||
fsm_journal_event ("fsm/dispatch fsm initialisation has began", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch fsm initialisation has began", MESSAGE, FSM, "");
|
||||
|
||||
fsm_journal_event ("fsm/dispatch measures list init()", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch measures list init()", MESSAGE, FSM, "");
|
||||
fsm_measures_list_init();
|
||||
|
||||
fsm_journal_event ("fsm/dispatch results list init()", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch results list init()", MESSAGE, FSM, "");
|
||||
fsm_results_list_init();
|
||||
|
||||
fsm_journal_event ("fsm/dispatch displayable list init()", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch displayable list init()", MESSAGE, FSM, "");
|
||||
fsm_displayable_list_init();
|
||||
|
||||
fsm_journal_event ("fsm/dispatch preferences list init()", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch preferences list init()", MESSAGE, FSM, "");
|
||||
fsm_preferences_list_init();
|
||||
|
||||
fsm_journal_event ("fsm/dispatch fsm initialisation has ended", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch fsm initialisation has ended", MESSAGE, FSM, "");
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,10 +113,10 @@ void fsm_set_preferences_modified (bool value)
|
|||
{
|
||||
char str1[140] = "fsm/dispatch preferences modified value = ";
|
||||
char str2[20]; sprintf(str2, " (%d)\n", value); strcat(str1, str2);
|
||||
fsm_journal_event (str1, INFO, SOURCE, TARGET);
|
||||
fsm_journal_event (str1, INFO, FSM, "");
|
||||
|
||||
fsm_journal_event ("fsm/dispatch preferences modified value = ?",
|
||||
INFO, SOURCE, TARGET);
|
||||
INFO, FSM, "");
|
||||
preferences_have_been_modified = value;
|
||||
/*
|
||||
if (value) fsm_journal_event (
|
||||
|
@ -147,7 +147,7 @@ int fsm_get_state_rules_data() {return choice_STATE_RULES_DATA;}
|
|||
void fsm_set_exec_edit (int choice)
|
||||
{
|
||||
if (choice_EXEC_EDIT != choice) {
|
||||
fsm_journal_event ("fsm/dispatch set_exec_edit()", INFO, SOURCE, TARGET); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch set_exec_edit()", INFO, FSM, ""); // TODO print choice
|
||||
choice_EXEC_EDIT = choice;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ void fsm_set_exec_edit (int choice)
|
|||
void fsm_set_state_rules_data (int choice)
|
||||
{
|
||||
if (choice_STATE_RULES_DATA != choice) {
|
||||
fsm_journal_event ("fsm/dispatch set_state_rules_data()", INFO, SOURCE, TARGET); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch set_state_rules_data()", INFO, FSM, ""); // TODO print choice
|
||||
choice_STATE_RULES_DATA = choice;
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
// sub_automaton 1 is STATE_RULES_DATA
|
||||
// sub_automaton 2 is MEASURE
|
||||
case (0) :
|
||||
fsm_journal_event ("fsm/dispatch switch EXEC_EDIT (TODO)", INFO, SOURCE, TARGET); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch switch EXEC_EDIT (TODO)", INFO, FSM, ""); // TODO print choice
|
||||
printf ("fsm/dispatch (message) |\
|
||||
switch %5s x %5s > %5s x %5s\n",
|
||||
tab_0 [choice_EXEC_EDIT], tab_1 [choice_STATE_RULES_DATA],
|
||||
|
@ -182,7 +182,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
break;
|
||||
|
||||
case (1) :
|
||||
fsm_journal_event ("fsm/dispatch switch STATE_RULES_DATA (TODO)", INFO, SOURCE, TARGET); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch switch STATE_RULES_DATA (TODO)", INFO, FSM, ""); // TODO print choice
|
||||
printf ("fsm/dispatch (message) |\
|
||||
switch %5s x %5s > %5s x %5s\n",
|
||||
tab_0 [choice_EXEC_EDIT], tab_1 [choice_STATE_RULES_DATA],
|
||||
|
@ -197,7 +197,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
|
||||
|
||||
default : printf ("default in fsm/dispatch.fsm_msg()\n");
|
||||
fsm_journal_event ("fsm/dispatch fsm_msg () default in switch (sub_automaton)", INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/dispatch fsm_msg () default in switch (sub_automaton)", INFO, FSM, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ void fsm_store_restore_reset (int choice, int value)
|
|||
switch (choice) {
|
||||
case (STORE) :
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (STORE)", MESSAGE, SOURCE, TARGET);
|
||||
"fsm/prefer store restore reset(): switch (STORE)", MESSAGE, PREFER, "");
|
||||
for (int i = 0; i < n_objects; i++) {
|
||||
p [i] = widget_get_object_transparency (i);
|
||||
widget_set_object_transparency_to_value (i, p [i]);
|
||||
|
@ -82,19 +82,19 @@ void fsm_store_restore_reset (int choice, int value)
|
|||
break;
|
||||
case (RESTORE) :
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (RESTORE)", MESSAGE, SOURCE, TARGET);
|
||||
"fsm/prefer store restore reset(): switch (RESTORE)", MESSAGE, PREFER, "");
|
||||
for (int i = 0; i < n_objects; i++)
|
||||
widget_set_object_transparency_to_value (i, p [i]);
|
||||
break;
|
||||
case (RESET) :
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (RESET)", MESSAGE, SOURCE, TARGET);
|
||||
"fsm/prefer store restore reset(): switch (RESET)", MESSAGE, PREFER, "");
|
||||
for (int i = 0; i < n_objects; i++)
|
||||
widget_set_object_transparency_to_value (i, value); // i * 4 // rand() % 127
|
||||
break;
|
||||
default :
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (default)", MESSAGE, SOURCE, TARGET);
|
||||
"fsm/prefer store restore reset(): switch (default)", MESSAGE, PREFER, "");
|
||||
}
|
||||
|
||||
fsm_set_preferences_modified (TRUE);
|
||||
|
@ -110,8 +110,8 @@ static int reset_situations_to_value = -1;
|
|||
void fsm_reset_all_situations_transparencies_at_value (int value)
|
||||
{
|
||||
char str1[140] = "fsm/prefer reset all situations transparencies at value";
|
||||
char str2[10]; sprintf(str2, " (%d)", value); strcat(str1, str2);
|
||||
fsm_journal_event (str1, INFO, SOURCE, TARGET); // TODO
|
||||
char string_value [12]; sprintf(string_value, " (%d)", value); strcat(str1, string_value);
|
||||
fsm_journal_event (str1, INFO, PREFER, string_value); // TODO
|
||||
reset_situations_to_value = value;
|
||||
widget_reset_all_situations_transparencies_to_value (value);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void fsm_reset_all_situations_transparencies_at_value (int value)
|
|||
void fsm_add_displayable (char *displayable_name)
|
||||
{
|
||||
fsm_journal_event (
|
||||
strcat("fsm/prefer add displayable() ", displayable_name), MESSAGE, SOURCE, TARGET); // TODO
|
||||
strcat("fsm/prefer add displayable() ", displayable_name), MESSAGE, PREFER, ""); // TODO
|
||||
}
|
||||
|
||||
|
||||
|
@ -136,11 +136,11 @@ void fsm_add_displayable (char *displayable_name)
|
|||
/******************************************************************************/
|
||||
void fsm_preferences_list_init ()
|
||||
{
|
||||
fsm_journal_event ("fsm/prefer setting up preferences list", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/prefer setting up preferences list", MESSAGE, PREFER, "");
|
||||
}
|
||||
|
||||
void fsm_displayable_list_init ()
|
||||
{
|
||||
fsm_journal_event ("fsm/prefer setting up displayable list", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("fsm/prefer setting up displayable list", MESSAGE, PREFER, "");
|
||||
}
|
||||
|
||||
|
|
|
@ -136,12 +136,12 @@ int main (int argc, char **argv)
|
|||
fsm_init ("main first instruction in main() & first log");
|
||||
|
||||
fsm_journal_event (
|
||||
"main *app = gtk_application_new ()", INFO, MAIN, APP);
|
||||
"main *app = gtk_application_new ()", INFO, MAIN, "");
|
||||
GtkApplication *app = gtk_application_new ("org.gem-graph",
|
||||
G_APPLICATION_DEFAULT_FLAGS);
|
||||
|
||||
fsm_journal_event ("main \
|
||||
g signal connect (app <--> on_windows_startup)", INFO, MAIN, WIDGETS);
|
||||
g signal connect (app <--> on_windows_startup)", INFO, MAIN, "");
|
||||
// ! WARNING ! 'on_windows_activation()'
|
||||
// and 'on_windows_startup()' are in: src/widget/dispatch.c
|
||||
// NOT in: src/signal.c
|
||||
|
@ -149,10 +149,10 @@ int main (int argc, char **argv)
|
|||
g_signal_connect (app, "activate", G_CALLBACK (on_windows_activation), NULL);
|
||||
|
||||
int status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
fsm_journal_event ("main g_object unref (app)", INFO, MAIN, APP);
|
||||
fsm_journal_event ("main g_object unref (app)", INFO, MAIN, "");
|
||||
g_object_unref (app);
|
||||
|
||||
fsm_journal_event ("main That'all folks ! 👋️😄️",INFO, MAIN, APP);
|
||||
fsm_journal_event ("main That'all folks ! 👋️😄️",INFO, MAIN, "");
|
||||
fsm_journal_publication_request();
|
||||
|
||||
return status;
|
||||
|
|
127
src/signal.c
127
src/signal.c
|
@ -37,7 +37,7 @@
|
|||
static void on_auto_notification (const char *message)
|
||||
{
|
||||
fsm_journal_event ("signal auto notification()",
|
||||
DEBUG, SOURCE, AUTO_NOTIFICATION);
|
||||
DEBUG, AUTO_NOTIFICATION, message);
|
||||
/* Ignored (2024-06-06) because I don't know how to get "main_window" easily
|
||||
|
||||
if (window->toast_revealer == NULL) {
|
||||
|
@ -65,19 +65,25 @@ static void on_user_tree_expander_toggled (GtkExpander *expander,
|
|||
gpointer user_data)
|
||||
{
|
||||
fsm_journal_event ("signal user tree expander toggled()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
SPEW, EXPANDER, "");
|
||||
GtkTreeListRow *row = GTK_TREE_LIST_ROW (user_data);
|
||||
gboolean is_expanded = gtk_tree_list_row_get_expanded (row);
|
||||
gtk_tree_list_row_set_expanded (row, ! is_expanded);
|
||||
}
|
||||
|
||||
void on_setup_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object, gpointer user_data){
|
||||
fsm_journal_event ("signal setup user tree factory()",
|
||||
SPEW, EXPANDER, "");
|
||||
GtkWidget* expander = gtk_expander_new (NULL);
|
||||
gtk_list_item_set_child (GTK_LIST_ITEM (object), expander);
|
||||
}
|
||||
|
||||
|
||||
void on_bind_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object,
|
||||
gpointer user_data)
|
||||
{
|
||||
fsm_journal_event ("signal bind user tree factory()",
|
||||
SPEW, SOURCE, TARGET);
|
||||
GtkListItem *list_item = GTK_LIST_ITEM (object);
|
||||
assert (list_item);
|
||||
|
||||
|
@ -97,14 +103,8 @@ void on_bind_user_tree_factory (GtkSignalListItemFactory *factory,
|
|||
row);
|
||||
gtk_widget_set_margin_start (expander,
|
||||
gtk_tree_list_row_get_depth(row) * 20);
|
||||
}
|
||||
|
||||
void on_setup_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object, gpointer user_data){
|
||||
fsm_journal_event ("signal setup user tree factory()",
|
||||
SPEW, SOURCE, TARGET);
|
||||
GtkWidget* expander = gtk_expander_new (NULL);
|
||||
gtk_list_item_set_child (GTK_LIST_ITEM (object), expander);
|
||||
fsm_journal_event ("signal bind user tree factory()",
|
||||
DEBUG, TREE, text);
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,7 +115,7 @@ void on_setup_user_tree_factory (GtkSignalListItemFactory *factory,
|
|||
gboolean on_glarea_render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
fsm_journal_event ("signal glarea render()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal glarea render()", DEBUG, GLAREA, "");
|
||||
// Check if the widget is a glarea
|
||||
if(gtk_gl_area_get_error(area) != NULL) {
|
||||
on_auto_notification("An OpenGL error occured !");
|
||||
|
@ -134,7 +134,7 @@ gboolean on_glarea_render (GtkGLArea *area,
|
|||
/* We need to set up our state when we realize the GtkGLArea widget */
|
||||
void on_glarea_realize (GtkWidget *widget)
|
||||
{
|
||||
fsm_journal_event ("signal glarea realize()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal glarea realize()", DEBUG, GLAREA, "");
|
||||
GError *internal_error = NULL;
|
||||
|
||||
// Make the GL context current to be able to call the GL API
|
||||
|
@ -160,7 +160,7 @@ void on_glarea_realize (GtkWidget *widget)
|
|||
/* We should tear down the state when unrealizing */
|
||||
void on_glarea_unrealize (GtkWidget *widget)
|
||||
{
|
||||
fsm_journal_event ("signal glarea unrealize()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal glarea unrealize()", DEBUG, GLAREA, "");
|
||||
GError *internal_error = NULL;
|
||||
|
||||
// Make the GL context current to be able to call the GL API
|
||||
|
@ -183,8 +183,6 @@ void on_glarea_unrealize (GtkWidget *widget)
|
|||
|
||||
void on_axis_value_change (GtkAdjustment *adjustment, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal axis value change() has began", SPEW, SOURCE, TARGET);
|
||||
|
||||
GtkWidget *slider = gtk_widget_get_parent(GTK_WIDGET(data));
|
||||
GtkWidget *container_widget = gtk_widget_get_parent(GTK_WIDGET(slider));
|
||||
|
||||
|
@ -196,11 +194,22 @@ void on_axis_value_change (GtkAdjustment *adjustment, gpointer data)
|
|||
g_assert(axis >= 0 && axis < N_AXIS);
|
||||
|
||||
/* Update the rotation angle */
|
||||
int axis_value = gtk_adjustment_get_value(adjustment);
|
||||
util_gl_update_axis(container_widget,
|
||||
axis,
|
||||
gtk_adjustment_get_value(adjustment));
|
||||
axis_value);
|
||||
|
||||
/* Update the contents of the GL drawing area */
|
||||
|
||||
char string_value [10]; sprintf(string_value, " (%d)", axis_value);
|
||||
switch (axis) {
|
||||
case 0 : fsm_journal_event ("signal axis value changed()",
|
||||
SPEW, SLIDER_X, string_value); break;
|
||||
case 1 : fsm_journal_event ("signal axis value changed()",
|
||||
SPEW, SLIDER_Y, string_value); break;
|
||||
case 2 : fsm_journal_event ("signal axis value changed()",
|
||||
SPEW, SLIDER_Z, string_value); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -208,27 +217,24 @@ void on_axis_value_change (GtkAdjustment *adjustment, gpointer data)
|
|||
/* 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)
|
||||
{
|
||||
fsm_journal_event ("signal save current model before editing()",
|
||||
INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal save current model()", INFO, BUTTON, "");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
|
||||
}
|
||||
|
||||
void on_discard_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL,
|
||||
void on_discard_current_model_before_editing (GtkWidget *btt_discard_current_model,
|
||||
gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal discard current model before editing()",
|
||||
INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal discard current model()", INFO, BUTTON, "");
|
||||
gtk_window_close (GTK_WINDOW (data));
|
||||
}
|
||||
|
||||
void on_write_current_model (GtkWidget *btt_WRITE_CURRENT_MODEL,
|
||||
void on_write_current_model (GtkWidget *btt_write_current_model,
|
||||
gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal write current model()",
|
||||
INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal write current model()", INFO, BUTTON, "");
|
||||
gtk_window_close (GTK_WINDOW (data));
|
||||
}
|
||||
|
||||
|
@ -244,7 +250,7 @@ static void switch_state_rules_data();
|
|||
|
||||
void on_toggle_exec_edit (GtkWidget *toggled_button, gpointer user_data)
|
||||
{
|
||||
fsm_journal_event ("signal toggle exec edit()", INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal toggle exec edit()", INFO, BUTTON, "");
|
||||
if (fsm_get_exec_edit ()) { // TODO (or NOT ?) et si je ne suis pas sur la page SYNTH
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button),
|
||||
|
@ -274,9 +280,11 @@ void on_toggle_exec_edit (GtkWidget *toggled_button, gpointer user_data)
|
|||
|
||||
static void switch_state_rules_data()
|
||||
{
|
||||
int value = fsm_get_state_rules_data();
|
||||
char string_value [12]; sprintf(string_value, " (%d)", value);
|
||||
fsm_journal_event ("signal switch state rules data()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
switch (fsm_get_state_rules_data()) {
|
||||
DEBUG, SWITCH_STATE_RULES_DATA, string_value);
|
||||
switch (value) {
|
||||
|
||||
case (SYNTH) :
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
|
@ -320,7 +328,7 @@ static void switch_state_rules_data()
|
|||
default :
|
||||
printf("default in signal.on_toggle_state_rule_data()\n");
|
||||
fsm_journal_event ("signal default in : switch state rules data()",
|
||||
INFO, SOURCE, TARGET);
|
||||
INFO, SWITCH_STATE_RULES_DATA, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -329,8 +337,8 @@ static void switch_state_rules_data()
|
|||
// Les noms d'icônes sont utilisés pour deux fonctions distinctes...
|
||||
void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data)
|
||||
{
|
||||
fsm_journal_event ("signal toggle state rules data() has began",
|
||||
INFO, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal toggle state rules data()",
|
||||
INFO, BUTTON, "state_rules_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));
|
||||
|
@ -340,9 +348,6 @@ void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data)
|
|||
if ( ! strcmp (toggled_button_name, "rules")) fsm_set_state_rules_data (RULES);
|
||||
if ( ! strcmp (toggled_button_name, "results")) fsm_set_state_rules_data (DATA);
|
||||
|
||||
fsm_journal_event ("signal toggle state rules data() has ended",
|
||||
INFO, SOURCE, TARGET);
|
||||
|
||||
if (is_active) switch_state_rules_data();
|
||||
}
|
||||
|
||||
|
@ -353,7 +358,7 @@ void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data)
|
|||
void on_clicked_topbar_right_search (GtkWidget *btt_menu, gpointer list_box)
|
||||
{
|
||||
fsm_journal_event ("signal clicked topbar right search()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
DEBUG, BUTTON, "");
|
||||
// next line presents the text_window and works only once.\n
|
||||
// It should present a menu.\n"); // TODO
|
||||
gtk_window_present (GTK_WINDOW (widget_get_text_window()));
|
||||
|
@ -363,7 +368,7 @@ void on_clicked_topbar_right_search (GtkWidget *btt_menu, gpointer list_box)
|
|||
void on_clicked_topbar_right_home (GtkWidget *btt_reset, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal clicked topbar right home()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
DEBUG, BUTTON, "");
|
||||
// gtk_window_present (GTK_WINDOW (widget_get_dialog_window()));
|
||||
// NB works only once. < TODO
|
||||
}
|
||||
|
@ -380,7 +385,7 @@ void on_clicked_topbar_right_home (GtkWidget *btt_reset, gpointer data)
|
|||
void on_updating_objects_transparencies (GtkWidget *btt_source, GtkScrollbar *scrollbar)
|
||||
{
|
||||
fsm_journal_event ("signal updating objects transparencies()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
DEBUG, BUTTON, "");
|
||||
const char *btt_name = gtk_button_get_icon_name (GTK_BUTTON (btt_source));
|
||||
int value = gtk_adjustment_get_value (gtk_scrollbar_get_adjustment (scrollbar));
|
||||
|
||||
|
@ -394,7 +399,7 @@ void on_updating_objects_transparencies (GtkWidget *btt_source, GtkScrollbar *sc
|
|||
void on_resetting_XYZ_in_state_page ()
|
||||
{
|
||||
fsm_journal_event ("signal resetting XYZ in state page()",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
DEBUG, BUTTON, "");
|
||||
widget_state_XYZ_reset_all();
|
||||
}
|
||||
|
||||
|
@ -402,8 +407,8 @@ void on_resetting_XYZ_in_state_page ()
|
|||
|
||||
void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar)
|
||||
{
|
||||
fsm_journal_event ("signal on_situations_box_do_reset() has began",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal on_situations_box_do_reset()",
|
||||
DEBUG, BUTTON, "");
|
||||
GtkAdjustment *adj_situ = gtk_scrollbar_get_adjustment (reset_scrollbar);
|
||||
fsm_reset_all_situations_transparencies_at_value (gtk_adjustment_get_value (adj_situ));
|
||||
}
|
||||
|
@ -416,7 +421,7 @@ void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrol
|
|||
|
||||
void on_clicked_topbar_right_measure (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal clicked topbar right measure()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal clicked topbar right measure()", DEBUG, BUTTON, "");
|
||||
// fsm_measures_sorted_list_do something ();
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_get_measure_page()));
|
||||
|
@ -424,98 +429,98 @@ void on_clicked_topbar_right_measure (GtkWidget *btt, gpointer data)
|
|||
|
||||
void on_start_new_measure (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal start new measure()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal start new measure()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_select_rules_first()));
|
||||
}
|
||||
|
||||
void on_select_rules_first (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal select rules first()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal select rules first()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_depends_on_one_or_two_events()));
|
||||
}
|
||||
|
||||
void on_measure_depends_on_a_single_event (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure depends on a single event()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure depends on a single event()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_depends_on_a_single_event()));
|
||||
}
|
||||
|
||||
void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure depends on two events()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure depends on two events()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_select_a_second_rules_set()));
|
||||
}
|
||||
|
||||
void on_select_a_second_rules_set (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal select a second rules set()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal select a second rules set()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_choose_an_event_type()));
|
||||
}
|
||||
|
||||
void on_select_a_second_measurement (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal select a second measurement()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal select a second measurement()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_correlate()));
|
||||
}
|
||||
|
||||
void on_skip_this_step (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal skip this step()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal skip this step()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_insert_in_measurements_list ()));
|
||||
}
|
||||
|
||||
void on_something_else (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal something else()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal something else()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_do_end_creation_of_measurement_process()));
|
||||
}
|
||||
|
||||
void on_closing_page (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal closing page()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal closing page()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_get_synth_page()));
|
||||
}
|
||||
|
||||
void on_measure_single_event_occurences_nb (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure single event occurences nb()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure single event occurences nb()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_event_occurences_nb()));
|
||||
}
|
||||
|
||||
void on_measure_single_event_occurences_dates (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure single event occurences dates()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure single event occurences dates()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_event_occurences_dates()));
|
||||
}
|
||||
|
||||
void on_measure_single_event_occurences_situations (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure single event occurences situations()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure single event occurences situations()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_event_occurences_situations()));
|
||||
}
|
||||
|
||||
void on_measure_time_elapsed_between_two_events (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure time elapsed between two events()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure time elapsed between two events()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_time_elapsed_between_two_events()));
|
||||
}
|
||||
|
||||
void on_measure_third_event_occurences_in_between (GtkWidget *btt, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal measure third event occurences in between()", DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal measure third event occurences in between()", DEBUG, BUTTON, "");
|
||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||
GTK_WIDGET (widget_measure_third_event_occurences_in_between()));
|
||||
}
|
||||
|
@ -527,13 +532,13 @@ void on_measure_third_event_occurences_in_between (GtkWidget *btt, gpointer data
|
|||
|
||||
void on_entry_name_insert_after (GtkWidget *entry, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal entry name insert after() has began",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal entry name insert after()",
|
||||
DEBUG, ENTRY, "");
|
||||
}
|
||||
|
||||
void on_entry_name_delete_after (GtkWidget *entry, gpointer data)
|
||||
{
|
||||
fsm_journal_event ("signal entry name delete after() has began",
|
||||
DEBUG, SOURCE, TARGET);
|
||||
fsm_journal_event ("signal entry name delete after()",
|
||||
DEBUG, ENTRY, "");
|
||||
}
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@ void *widget_get_text_window() { return text_window; }
|
|||
void on_windows_startup (GtkApplication *app) // WIP 2024-09
|
||||
{
|
||||
// NB on_windows_startup() is in: widget/dispatch NOT in: src/signal
|
||||
fsm_journal_event ("widget/dispatch windows startup()", MESSAGE, SOURCE, TARGET);
|
||||
fsm_journal_event ("widget/dispatch windows startup()", MESSAGE, WIDGETS, "");
|
||||
}
|
||||
|
||||
void on_windows_activation (GtkApplication *app)
|
||||
{
|
||||
fsm_journal_event ("widget/dispatch windows activation() has began",
|
||||
INFO, WIDGETS, WIDGETS);
|
||||
INFO, WIDGETS, "");
|
||||
|
||||
// on_windows_activation() is in: widget/dispatch NOT in: src/signal
|
||||
// g_application_activate (G_APPLICATION (app)); < how ? > in main is
|
||||
|
@ -104,7 +104,7 @@ void on_windows_activation (GtkApplication *app)
|
|||
g_signal_connect (act_b, "activate", G_CALLBACK (action_b), app2);*/
|
||||
|
||||
fsm_journal_event ("widget/dispatch windows activation() has ended",
|
||||
INFO, WIDGETS, WIDGETS);
|
||||
INFO, WIDGETS, "");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window)
|
||||
{
|
||||
fsm_journal_event ("modal window design", INFO, WIDGETS, MODAL_WINDOW);
|
||||
fsm_journal_event ("modal window design", INFO,MODAL_WINDOW, "");
|
||||
char *title = " Save the current model before modifying it? ";
|
||||
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title));
|
||||
|
|
|
@ -40,7 +40,7 @@ static GtkWidget *window_topbar (GtkWindow *window);
|
|||
void widget_design_main_window (GtkWindow *main_window, GtkApplication *app)
|
||||
{
|
||||
fsm_journal_event ("main_window *topbar = window_topbar (main_window)",
|
||||
INFO, WIDGETS, TOPBAR);
|
||||
INFO, TOPBAR, "");
|
||||
GtkWidget *topbar = window_topbar (main_window);
|
||||
window_design_topbar_left (topbar);
|
||||
window_design_topbar_right (topbar, app);
|
||||
|
@ -52,7 +52,7 @@ void widget_design_main_window (GtkWindow *main_window, GtkApplication *app)
|
|||
static GtkWidget *window_topbar (GtkWindow *window)
|
||||
{
|
||||
fsm_journal_event ("topbar *topbar = gtk_header_bar_new ()",
|
||||
INFO, TOPBAR, TOPBAR_CENTER);
|
||||
INFO, TOPBAR_CENTER, "");
|
||||
char *title = "E coli (with permission from David S. Goodsell, 2009)";
|
||||
GtkWidget *topbar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (topbar), gtk_label_new (title));
|
||||
|
|
|
@ -44,7 +44,7 @@ void *widget_get_btt_data () {return btt_DATA;}
|
|||
void window_design_topbar_left (GtkWidget *header_bar)
|
||||
{
|
||||
fsm_journal_event ("topbar left g_signal_connect (EXEC / EDIT) + select a page",
|
||||
INFO, TOPBAR, TOPBAR_LEFT);
|
||||
INFO, TOPBAR_LEFT, "");
|
||||
gpointer no_local_data = NULL;
|
||||
|
||||
GtkButton *btt_XOR_EXEC_EDIT = GTK_BUTTON (gtk_toggle_button_new ());
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window)
|
||||
{
|
||||
fsm_journal_event ("text window design", INFO, WIDGETS, TEXT_WINDOW);
|
||||
fsm_journal_event ("text window design", INFO, TEXT_WINDOW, "");
|
||||
char *title = " Learn more about Gem Graph. ";
|
||||
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title));
|
||||
|
|
|
@ -94,7 +94,7 @@ static void connect(GApplication *app, gpointer *data) { puts("Connect menu item
|
|||
void window_design_topbar_right (GtkWidget *header_bar, GtkApplication *app)
|
||||
{
|
||||
fsm_journal_event ("topbar right display_widgets (buttons, menus)",
|
||||
INFO, TOPBAR, TOPBAR_RIGHT);
|
||||
INFO, TOPBAR_RIGHT, "");
|
||||
display_widgets_at_the_right_side (header_bar);
|
||||
|
||||
GSimpleActionGroup *ga = g_simple_action_group_new ();
|
||||
|
|
Loading…
Reference in New Issue