Commit Graph

17 Commits

Author SHA1 Message Date
Jean Sirmai cb5e3137da
include/fsm.h, src/fsm/*: reworked memory management of the logging system
This commits reworks the way that memory is allocated for the logging system.

We basically use a double-linked list, with the oldest and the latest elements
stored in a static variable. Most recent log entries are added at the latest
position in this structure.

A new function to clear and free a log unit has been implemented, and can be used
at many points. We take care that each log unit is freed at closing time.

Tested with valgrind:

==6161== LEAK SUMMARY:
==6161==    definitely lost: 5,008 bytes in 54 blocks
==6161==    indirectly lost: 16,119 bytes in 672 blocks

We can consider that as a basis for future work, as these leaks are due to external
causes (e.g. libraries).

Signed-off-by: Jean Sirmai <jean@a-lec.org>
Signed-off-by: Adrien Bourmault <neox@a-lec.org>
2024-11-20 17:12:28 +01:00
Jean Sirmai a0e0ab4baa
docs/rtfm/manual WIP: redaction
a version of the same text with lines length limited to 80 char is available
2024-11-19 22:36:31 +01:00
Jean Sirmai 917886ee6b
WIP: src/fsm/log/oper.c fsm_publish_log() studying memory leaks with Valgrind
definitely lost: 5,008 bytes in 54 blocks
indirectly lost: 16,151 bytes in 673 blocks

When g_message() is removed from oper.c fsm_publish_log()  no leak seems
caused by the gem-graph code.
2024-11-19 22:09:47 +01:00
Jean Sirmai 4df832f342
src/widget/*, src/main.c: catching window::close-request signal, and a few renames
We create a window in the app activation and it needs to be closed properly,
freeing all ressources in the meantime. For now, there is only the picture
(E. coli) to free.

From now on, freeing window ressources will be done in
src/widget/manager.c:on_window_close_request().

Signed-off-by: Jean Sirmai <jean@a-lec.org>
2024-11-18 16:24:36 +01:00
Jean Sirmai bb89a2f03c
src/fsm/log/oper.c fsm_add_log_event() fixing a bug
The bug was caused by pointers to local variables sended to fsm_add_log().
malloc() are now realized in fsm_add_log_event().

+ cleaning (checking that the sentence "This file is part of Gem-graph."
is systematicaly added to legal mentions.)
2024-11-15 19:13:15 +01:00
Jean Sirmai 78ebd86cb5
src/widget/main_window/design First visible window (with memory leaks)
To display this minimal window, three files and two functions must be
added simultaneously:

- include/widget/h
- src/manager.c
- src/main_window/design.c

main() now contains: g_signal_connect (on_windows_activation);
on_windows_activation () is in src/manager.c and calls
widget_main_window () which is in src/main_window/design.c

NB  The iconic image of E coli drawn by David S. Goodsell in 2009
is reproduced here with permission.

One goal of Gem-graph is to animate such static representations
i.e. use the best anatomy to try to achieve good physiology.
2024-11-15 19:13:06 +01:00
Jean Sirmai d82abfb462
docs/rtfm/intro writing + cleaning details in src/ 2024-11-15 19:07:50 +01:00
Jean Sirmai ce7b8a355d
rtfm/intro (writing the manual) + cleaning doc 2024-11-15 19:07:50 +01:00
Jean Sirmai a92dbaf39d
* modifies several names:
* - in fsm_trigger_log_init(), fsm_trigger_log_close() the word **trigger** is
 * replaced by **relay**
 * - fsm_log_struct_unit is replaced by: fsm_log_unit_struct
 *
 * docs/rtfm/intro (previously 'Once upon a time'... 🙃️) is also renamed and
 * extended.
 *
2024-11-15 19:07:49 +01:00
Jean Sirmai 236a54964f
rtfm/intro Manual Introduction - a first version.
The same text is presented in two formats: for an external text editor (.txt)
or with lines limited to 80 characters.

The links are prepared but not functionnal.
2024-11-15 19:07:49 +01:00
Jean Sirmai 27bc2328d5
src/fsm/control.c fsm_init() and fsm_close() can be now triggered from main().
These two functions (defined in control.c) initiate the log and print it just
before the end of the program.
It is now possible to send messages that reports the events occuring during a
session: the creation of the log, then of the application and their closure in
the reverse order.
As previously,there is no g signal connect (activate) and no window is created.
This triggers the same error message in the console.
What is new, in this commit, is that a first log is printed in the console.
2024-11-15 19:07:21 +01:00
Jean Sirmai 4ce6443e39
/src/fsm/log/* adds the three files:
- manager.c,
- oper.c and
- appendix.c

and the functions needed to init, edit and publish the log.

fsm_add_log() is in manager.c  There are the filters.

init(), add(), publish() are in oper.c
                   These are the executive functions.

and functions whose usefulness remains to be demonstrated
are in appendix.

In fsm.h remain the structures (fsm_log_struct, fsm_log_struct_unit)
and the two enums (severity and source)
2024-11-08 19:56:07 +01:00
Jean Sirmai 56b539e9c0
include/fsm.h: prepares the building of a log and create src/readme.doc
This commit is the first in a series that will make the fsm apt to build the
log.

The log (or journal) records events chronologically from the start to the end
of the programme.
Its quantitatively most important part is to report on the execution of the
session.

The log will be created from the fsm (finite state machine) which describes
all the possible states of the Gem-graph client and all the transitions between
them.

The fsm header is introduced in this commit.

It lists the structures, functions and tools that the log will need and details
the presentation of events in the log
[date - rank - source file - source function - value].

The src/readme.docs file provides an initial overview of the missions and their
distribution in the code files.
2024-11-08 12:27:38 +01:00
Jean Sirmai 6ad04de2c6
docs/*: integrate doxygen, create a documentation zone, adds notes
We wanted to have an automated documentation for our project. We choose doxygen
since this is a well-established project, with common standards.

To generate the documentation, simply type `make docs` and open `docs/html/index.html`.

The documentation zone actually contains:
	- archives: several files from past of the projects, historical purpose
	- GTK-docs: ressources on GTK internals and API
	- rtfm: first draft of a user manual
	- showcase: some pictures of the UI example, that were communicated on the Gem-graph discussion room (XMPP)
	- html: doxygen-generated docs
2024-11-01 23:54:43 +01:00
Jean Sirmai a3c71ba65f
scripts/*: add a script that can list every function name 2024-11-01 23:54:39 +01:00
Adrien Bourmault d74e590199
Makefile: fixes and parallel by default
This commit:
- fixes the OpenGL lib configurations (gl->epoxy)
- added an exclusion for bin/ and build/ in .gitignore
- make the Makefile parallel
2024-11-01 23:54:29 +01:00
Jean Sirmai a31005c2f9
src/*, simple Gtk application
This commit initiates the Gem-graph client development with a simple
main function that initializes a Gtk application (no window yet).
2024-11-01 23:53:24 +01:00