2024-07-08 22:05:15 +02:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* *
|
|
|
|
* Gem-graph client *
|
|
|
|
* *
|
2024-07-22 15:42:24 +02:00
|
|
|
* Finite State Machine (fsm) header *
|
2024-07-08 22:05:15 +02:00
|
|
|
* *
|
|
|
|
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
|
|
|
* Copyright © 2021 Adrien Bourmault <neox@a-lec.org> *
|
|
|
|
* Copyright © 2021 Jean Sirmai <jean@a-lec.org> *
|
|
|
|
* *
|
|
|
|
* This file is part of Gem-graph. *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU Affero General Public License *
|
|
|
|
* as published by the Free Software Foundation, *
|
|
|
|
* either version 3 of the License, *
|
|
|
|
* or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; *
|
|
|
|
* without even the implied warranty of MERCHANTABILITY *
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
|
|
* See the GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
2024-07-18 23:51:04 +02:00
|
|
|
#pragma once
|
2024-07-25 05:55:15 +02:00
|
|
|
#include <stdbool.h>
|
2024-08-19 22:53:47 +02:00
|
|
|
#include <stddef.h>
|
2024-08-20 09:32:20 +02:00
|
|
|
#include <gtk-4.0/gtk/gtk.h> // << ? TODO > Check
|
2024-07-08 22:05:15 +02:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* S T A T E M A C H I N E */
|
|
|
|
/******************************************************************************/
|
2024-07-22 18:02:14 +02:00
|
|
|
// called by widgets through signal functions
|
2024-07-08 22:05:15 +02:00
|
|
|
|
2024-08-04 12:21:24 +02:00
|
|
|
enum fsm_choice_EXEC_EDIT { EXEC, EDIT }; // xor
|
|
|
|
enum fsm_choice_STATE_RULES_DATA { SYNTH, STATE, RULES, DATA }; // xor
|
|
|
|
enum fsm_choice_STORE_RESTORE_RESET { STORE, RESTORE, RESET }; // xor
|
2024-07-08 22:05:15 +02:00
|
|
|
|
2024-07-24 23:07:14 +02:00
|
|
|
|
2024-07-29 15:15:08 +02:00
|
|
|
#define n_rules 128 // arbitrary
|
2024-07-29 05:46:10 +02:00
|
|
|
#define n_objects 32 // arbitrary too,
|
|
|
|
#define n_situations 128 // and so on...
|
2024-07-24 23:07:14 +02:00
|
|
|
|
2024-08-19 22:53:47 +02:00
|
|
|
bool fsm_init ();
|
2024-07-24 23:07:14 +02:00
|
|
|
|
2024-08-19 22:53:47 +02:00
|
|
|
void fsm_measures_list_init ();
|
|
|
|
void fsm_results_list_init ();
|
|
|
|
void prefer_displayable_list_init ();
|
|
|
|
// TODO Eh oui ! Il y a des préférences qui sont des états de la fsm... How to ?
|
2024-07-24 23:07:14 +02:00
|
|
|
|
2024-07-21 12:33:29 +02:00
|
|
|
int fsm_get_exec_edit ();
|
|
|
|
int fsm_get_state_rules_data ();
|
2024-07-24 18:22:59 +02:00
|
|
|
int fsm_get_store_restore_reset ();
|
2024-07-19 00:17:19 +02:00
|
|
|
|
2024-07-21 12:33:29 +02:00
|
|
|
void fsm_set_exec_edit (int value);
|
|
|
|
void fsm_set_state_rules_data (int value);
|
2024-07-24 14:14:05 +02:00
|
|
|
void fsm_set_store_restore_reset (int target, int value);
|
2024-07-20 19:04:08 +02:00
|
|
|
|
2024-07-27 12:34:32 +02:00
|
|
|
|
|
|
|
bool fsm_get_preferences_state ();
|
|
|
|
void fsm_set_preferences_state (bool value);
|
2024-07-25 05:55:15 +02:00
|
|
|
|
2024-08-19 16:09:31 +02:00
|
|
|
void *fsm_add_measure (char *measure_name);
|
|
|
|
void *fsm_add_result (char *result_name);
|
2024-08-19 20:00:06 +02:00
|
|
|
|
|
|
|
void fsm_debug (int choice, int value, char *string, int sub_automaton);
|
2024-08-20 09:32:20 +02:00
|
|
|
|
|
|
|
void pref_set_store_restore_reset (int choice, int value);
|
|
|
|
const char *get_button_icon_name (int n);
|
|
|
|
|
|
|
|
void fsm_reset_all_situations_transparencies_at_value (int value); // provisoire...
|
|
|
|
|
|
|
|
void *fsm_add_displayable (char *displayable_name);
|
|
|
|
|
|
|
|
void prefer_init ();
|
|
|
|
|