Compare commits
5 Commits
3850f371a3
...
19cdc544c6
Author | SHA1 | Date |
---|---|---|
Jean Sirmai | 19cdc544c6 | |
Jean Sirmai | 491e6c8d98 | |
Jean Sirmai | 6209ad9a09 | |
Jean Sirmai | 0487a15b65 | |
Jean Sirmai | 4409ed5cd9 |
30
(notes)
|
@ -1,14 +1,28 @@
|
|||
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ nano ~/.gitconfig
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git commit -as < pour signer
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git config --global alias.commit commit -
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git config --global user.signingKey F37FE3F41D1463D56460400CFB3115C340E057E3
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ echo "b00fb7ba53841e7ff49a07f3f63fa45b2c5674f2b7b442eeafef1fa5e7b406fc" | gpg -a --default-key FB3115C340E057E3 --detach-sig
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ gpg --export --armor F37FE3F41D1463D56460400CFB3115C340E057E3
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ gpg --edit-key jean@a-lec.org
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ gpg --list-key jean@a-lec.org
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git rebase -i HEAD~6
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git rebase -i a6845e9b2a622b5ec75317de3c3089f6a3fb3ab0
|
||||
jean@Project:~/Gem-Graph/gem-graph-client [env] $ git commit --amend -S
|
||||
pour chercher : grep
|
||||
pour éditer : sed
|
||||
2024-06-29
|
||||
-------------------------------------------------------------------------------
|
||||
contain.c: (136) gtk_box_append (middle_box, GTK_WIDGET (get_GLArea()));
|
||||
|
||||
graph_area.h: (177) static inline GLuint create_shader(const int stack_id, int type, const char *src) {...}
|
||||
graphics.h: (177) static inline GLuint create_shader(const int stack_id, int type, const char *src) {...}
|
||||
|
||||
graph_area.c: (153) graphics_draw (stack_index[i].stack_id);
|
||||
graphics.c: (153) graphics_draw (stack_index[i].stack_id);
|
||||
|
||||
graph_area.c: (233) g_signal_connect (adj, "value-changed", G_CALLBACK(on_axis_value_change), (gpointer) label);
|
||||
graph_area.c: (289) g_signal_connect(GTK_GL_AREA(gl_area), "render", G_CALLBACK(on_glarea_render), NULL);
|
||||
graph_area.c: g_signal_connect(gl_area, "realize", G_CALLBACK(on_glarea_realize), NULL);
|
||||
graph_area.c: g_signal_connect(gl_area, "unrealize", G_CALLBACK(on_glarea_unrealize), NULL);
|
||||
graphics.c: (233) g_signal_connect (adj, "value-changed", G_CALLBACK(on_axis_value_change), (gpointer) label);
|
||||
graphics.c: (289) g_signal_connect(GTK_GL_AREA(gl_area), "render", G_CALLBACK(on_glarea_render), NULL);
|
||||
graphics.c: g_signal_connect(gl_area, "realize", G_CALLBACK(on_glarea_realize), NULL);
|
||||
graphics.c: g_signal_connect(gl_area, "unrealize", G_CALLBACK(on_glarea_unrealize), NULL);
|
||||
|
||||
graph_stack.c: (149) if (!graphics_init_shaders(cur_id)) return -1;
|
||||
graph_stack.c: (153) graphics_init_buffers(cur_id);
|
||||
|
@ -22,7 +36,7 @@ graph_stack.c: (316) stack->arrows_nb = set_arrow (stack_id, stack->arrows_nb
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
contain is called (#included) in : callback, display, tree, graph_stack, graph_area, init,
|
||||
contain is called (#included) in : callback, display, tree, graph_stack, graphics, init,
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
|
Before Width: | Height: | Size: 370 KiB After Width: | Height: | Size: 370 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
Before Width: | Height: | Size: 707 KiB After Width: | Height: | Size: 707 KiB |
Before Width: | Height: | Size: 702 KiB After Width: | Height: | Size: 702 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
|
@ -1,16 +0,0 @@
|
|||
#include <gtk-4.0/gtk/gtk.h>
|
||||
#include <assert.h>
|
||||
|
||||
enum choice_EXEC_EDIT { EXEC, EDIT };
|
||||
enum choice_STATE_RULES_DATA { STATE, RULES, DATA };
|
||||
// MEASURE, OBSERVE, INTERPRET, HELP, CONFIGURE }; ?
|
||||
|
||||
void set_EXEC_EDIT (int prescribed);
|
||||
void set_STATE_RULES_DATA (int prescribed);
|
||||
|
||||
int get_EXEC_EDIT ();
|
||||
int get_STATE_RULES_DATA ();
|
||||
|
||||
// char *get_str_EXEC_EDIT (int value);
|
||||
// char *get_str_STATE_RULES_DATA (int value);
|
||||
|
156
include/base.h
|
@ -1,26 +1,31 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: Base header
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Base header *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <assert.h>
|
||||
|
@ -35,24 +40,60 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <glib-2.0/glib.h>
|
||||
//#define G_APPLICATION_DEFAULT_FLAGS 0
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
// #define G_APPLICATION_DEFAULT_FLAGS 0 < work TODO here ?
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* S T A T E M A C H I N E */
|
||||
/******************************************************************************/
|
||||
|
||||
enum choice_EXEC_EDIT { EXEC, EDIT }; // xor
|
||||
enum choice_STATE_RULES_DATA { STATE, RULES, DATA }; // xor
|
||||
|
||||
void set_EXEC_EDIT (int prescribed);
|
||||
void set_STATE_RULES_DATA (int prescribed);
|
||||
|
||||
int get_EXEC_EDIT ();
|
||||
int get_STATE_RULES_DATA ();
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* S P A C E S T R U C T U R E S */
|
||||
/******************************************************************************/
|
||||
|
||||
enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; // < used by graphics.h
|
||||
|
||||
struct arrow_t { uint load; uint site; uint x; uint y; uint z; };
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* U T I L I T I E S */
|
||||
/******************************************************************************/
|
||||
|
||||
enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; // < used by : graph_area.h
|
||||
enum { HOME_MODE, RUN_MODE, EDIT_MODE, PRESENTATION_MODE, N_MODE }; // Gem-graph modes
|
||||
struct arrow_t { uint load; uint site; uint x; uint y; uint z; }; // describes an arrow
|
||||
static inline char *read_file(char *filename); // < used by : init.c
|
||||
|
||||
/* I'm standing on Earth (or any spinning spheroid) and looking towards its North pole, then :
|
||||
X - X = EAST - WEST = rouge - cyan
|
||||
Y - Y = ZENITH - NADIR = vert - magenta (fuschia)
|
||||
Z - Z = NORTH - SOUTH = bleu - jaune */
|
||||
/*
|
||||
I'm standing on Earth (or any spinning spheroid),
|
||||
looking towards its North pole.
|
||||
|
||||
#define EAST 0 // + x rouge
|
||||
Then :
|
||||
|
||||
X - X = EAST - WEST = red - cyan
|
||||
Y - Y = ZENITH - NADIR = green - magenta (fuschia)
|
||||
Z - Z = NORTH - SOUTH = blue - yellow
|
||||
*/
|
||||
|
||||
#define EAST 0 // + x red
|
||||
#define WEST 1 // - x cyan
|
||||
#define ZENITH 2 // + y vert
|
||||
#define ZENITH 2 // + y green
|
||||
#define NADIR 3 // - y magenta
|
||||
#define SOUTH 4 // + z bleu
|
||||
#define NORTH 5 // - z jaune
|
||||
#define SOUTH 4 // + z blue
|
||||
#define NORTH 5 // - z yellow
|
||||
|
||||
|
||||
/*
|
||||
|
@ -89,3 +130,48 @@ static inline char *read_file(char *filename)
|
|||
return contents;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* T E X T S */
|
||||
/******************************************************************************/
|
||||
|
||||
char *get_space_run_edit_specif();
|
||||
char *get_rules_run_edit_specif();
|
||||
|
||||
/*
|
||||
>>> Dans : [space_page - mode RUN] doivent être : ------------------------------------------------------
|
||||
|
||||
(1) les commandes de mouvement:
|
||||
- run/stop, slow down/speed up, step by step, do/undo/redo
|
||||
+ le buffer [elapsed time] qui montre le temps de simulation écoulé
|
||||
(2) les commandes qui modifient la perception de l'espace (la caméra)
|
||||
- son orientation (X,Y,Z),
|
||||
+ le zoom,
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel)
|
||||
(3) les commandes qui modifient les apparences des objets et des situations d'intérêt
|
||||
(+/- transparents, colorés, etc.)
|
||||
(4) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'ÉDITER L'ESPACE ! <<<
|
||||
|
||||
>>> Dans : [space_page - mode EDIT] doivent être : ------------------------------------------------------
|
||||
(1) les commandes qui modifient la perception de l'espace (la caméra)
|
||||
- son orientation (X,Y,Z),
|
||||
+ le zoom,
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel)
|
||||
(2) les commandes qui modifient les apparences des objets et des situations d'intérêt
|
||||
(+/- transparents, colorés, etc.)
|
||||
(3) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)
|
||||
(4) les commandes d'édition locales (drag and drop une flèche)
|
||||
('faire de la place' pour insérer)
|
||||
(sélectionner pour déplacer ou enlever...)
|
||||
NB ces commandes doivent être graphiques et/ou accessibles par raccourcis ou en ligne
|
||||
(5) les commandes d'édition globales
|
||||
(ex: introduire, retirer, transformer +/-aléatoirement (n) objets dans l'espace)
|
||||
NB une action effectuée sur une zone d'intérêt devrait pouvoir être automatiquement appliquée
|
||||
à d'autres zones d'intérêt identifiées comme similaires
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'EXÉCUTER UN RUN ! <<<
|
||||
>>> L'objectif est que l'utilisateur ait accès à une organsisation aussi ergonomique que possible -----
|
||||
i.e : chaque utilisateur devrait disposer de 'préférences'
|
||||
c'est-à-dire avoir la possiblité de faire des choix ergonomiques personnalisés.
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,9 +1,38 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Callbacks header *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
// void on_auto_notification (const char *message);
|
||||
|
||||
void on_main_window_activation (GtkApplication *app, gpointer user_data);
|
||||
void on_dialog_window_activation (GtkApplication *app, gpointer user_data);
|
||||
void on_auto_notification (const char *message);
|
||||
|
||||
void on_user_tree_expander_toggled (GtkExpander *expander, gpointer user_data);
|
||||
void on_bind_user_tree_factory (GtkSignalListItemFactory *factory, GObject* object, gpointer user_data);
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
//******************************************************************************/
|
||||
/* */
|
||||
/* E coli by David S. Goodsell (2009) */
|
||||
/* --- */
|
||||
/* Let this freeze frame guide us towards the model */
|
||||
/* that alone can account for the phenomenon ! */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
#define W 1920
|
||||
#define H 960
|
||||
#define W_IMAGE W - 320
|
||||
#define H_IMAGE H - 126
|
||||
#define H_STYLES_PANE 30
|
||||
#define W_IMAGE_LOCAL W / 16
|
||||
#define H_IMAGE_LOCAL H / 16
|
||||
|
||||
/*
|
||||
G_BEGIN_DECLS
|
||||
#define MY_TYPE_WINDOW (my_window_get_type())
|
||||
G_DECLARE_FINAL_TYPE (MyWindow, my_window, MY, WINDOW, GtkApplicationWindow)
|
||||
G_END_DECLS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define MY_TYPE_APPLICATION (my_application_get_type())
|
||||
G_DECLARE_FINAL_TYPE (MyApplication, my_application, MY, APPLICATION, GtkApplication)
|
||||
MyApplication *my_application_new (const char *application_id, GApplicationFlags flags);
|
||||
G_END_DECLS
|
||||
*/
|
||||
|
||||
void main_window_design (GtkWindow *main_window);
|
||||
void set_check_button_active (GtkButton *button, int active);
|
||||
void two_notebooks_in_two_panes (GtkWindow *window);
|
||||
|
||||
GtkFrame *get_frame_with_label();
|
||||
GtkWidget *get_selected_rules_vpaned_new();
|
||||
GtkWidget *get_TIME_EXEC_controls_box();
|
||||
GtkWidget *get_SPACE_EDIT_controls_box();
|
||||
GtkButton *get_GtkButton (char *btt_name);
|
||||
GtkWidget *get_window_child_STATE();
|
||||
GtkWidget *get_window_child_RULES();
|
||||
GtkWidget *get_window_child_DATA();
|
|
@ -1,2 +0,0 @@
|
|||
void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window);
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* */
|
||||
/* E coli by David S. Goodsell (2009) */
|
||||
/* --- */
|
||||
/* Let this freeze frame guide us towards the model */
|
||||
/* that alone can account for the phenomenon ! */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
GtkWidget *get_text_view();
|
||||
GtkFrame *get_frame_with_label();
|
||||
GtkWidget *get_rules_page_new();
|
||||
GtkBox *get_rules_user_tree_new();
|
||||
|
||||
GtkWidget *get_image_ALL_SPACE();
|
||||
GtkWidget *get_image_GLUTAMATE();
|
||||
GtkWidget *get_image_GLUTAMINE();
|
||||
GtkWidget *get_image_HISTIDINE();
|
||||
GtkWidget *get_image_HISTAMINE();
|
||||
GtkWidget *get_image_PHENYLALANINE();
|
||||
GtkWidget *get_image_DOPAMINE();
|
||||
GtkWidget *get_image_ATP();
|
||||
GtkWidget *get_image_AMP();
|
||||
GtkWidget *get_rules_tree_hpaned_new();
|
||||
|
||||
GtkProgressBar *get_ELAPSED_TIME_ProgressBar();
|
||||
GtkBox *get_RUN_STOP_box();
|
||||
GtkBox *get_ZOOM_box();
|
||||
GtkBox *get_edit_TOOL_box();
|
||||
GtkBox *get_XYZ_box();
|
||||
GtkWidget *get_OBJECTS_and_SITUATIONS();
|
||||
GtkBox *get_ELAPSED_TIME_box();
|
||||
|
||||
GtkButton *get_btt_run_xor_edit();
|
||||
|
||||
void window_bar(GtkWindow *window, char *title);
|
||||
|
||||
|
|
@ -1,328 +0,0 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: OpenGL utils header
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
|
||||
* Copyright (C) 2023 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <unistd.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
#include <glib-2.0/glib.h>
|
||||
#include <stdbool.h>
|
||||
#include <epoxy/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <GL/glext.h>
|
||||
#include <cglm/cglm.h>
|
||||
|
||||
#include "base.h"
|
||||
//#include "draw.c"
|
||||
|
||||
// #define VERTEX_SHADER_FILE "src/graphics/shaders/shader.vert"
|
||||
// #define FRAG_SHADER_FILE "src/graphics/shaders/shader.frag"
|
||||
#define VERTEX_SHADER_FILE "shader.vert"
|
||||
#define FRAG_SHADER_FILE "shader.frag"
|
||||
#define GL_TARGET_MAJOR_VERSION 0
|
||||
#define GL_TARGET_MINOR_VERSION 4
|
||||
|
||||
/*
|
||||
* Structure describing a gl_area and its parameters, used to create a table
|
||||
* of Gem-graph client current gl_areas
|
||||
*/
|
||||
struct graphic_stack_t {
|
||||
|
||||
int id;
|
||||
int mode;
|
||||
|
||||
float rotation_angles[N_AXIS]; // Rotation angles on each axis
|
||||
|
||||
GLuint vao; // init_buffers
|
||||
GLuint position_buffer; // shutdown, draw
|
||||
GLuint color_buffer; // shutdown, draw
|
||||
GLuint program; // shutdown, init_shaders, draw
|
||||
GLuint m; // init_shaders, draw
|
||||
GLuint v; // init_shaders, draw
|
||||
GLuint p; // init_shaders, draw
|
||||
|
||||
struct arrow_t *arrows_ptr;
|
||||
long arrows_nb;
|
||||
|
||||
GLfloat *buffer_vertex_origin;
|
||||
GLfloat *buffer_colors_origin;
|
||||
GLuint *buffer_lines_origin;
|
||||
GLuint *buffer_plans_origin;
|
||||
|
||||
long buffer_vertex_size;
|
||||
long buffer_colors_size;
|
||||
long buffer_lines_size;
|
||||
long buffer_plans_size;
|
||||
|
||||
long buffer_vertex_0_arrow;
|
||||
long buffer_colors_0_arrow;
|
||||
long buffer_lines_0_arrow;
|
||||
long buffer_plans_0_arrow;
|
||||
};
|
||||
|
||||
bool ui_render_stack(GtkWidget *container_widget);
|
||||
|
||||
bool ui_setup_glarea(int target_mode, GtkWidget *target_widget);
|
||||
|
||||
/*
|
||||
* Dynamic array of ptrs to dynamically allocated gl_area_entry
|
||||
*/
|
||||
extern struct graphic_stack_t *graphic_stack;
|
||||
|
||||
/*
|
||||
* Initializes a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
int graphics_init(void *error_buffer);
|
||||
|
||||
/*
|
||||
* Draws the current buffer to a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw(const int stack_id);
|
||||
|
||||
/*
|
||||
* Shutdowns a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if success
|
||||
*/
|
||||
bool graphics_shutdown(const int stack_id, void *error_buffer);
|
||||
|
||||
/*
|
||||
* Initializes the shaders of a gl_area and link them to a program
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
bool graphics_init_shaders(const int stack_id);
|
||||
|
||||
bool ui_init_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value);
|
||||
|
||||
/* Initializes the buffer of a gl_area
|
||||
* Calls according to the user preferences
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
* @return void
|
||||
*/
|
||||
void graphics_init_buffers(const int stack_id);
|
||||
|
||||
/*
|
||||
* Draws a vertex (x, y, z)
|
||||
* if (console) prints (x, y, z) values to console
|
||||
*
|
||||
* @param GLfloat x, GLfloat y, GLfloat z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_vertex (const int stack_id,
|
||||
GLfloat x,
|
||||
GLfloat y,
|
||||
GLfloat z);
|
||||
|
||||
/*
|
||||
* Draws the color (r, g, b) associated to a vertex
|
||||
* if (console) prints (r, g, b) values to console
|
||||
*
|
||||
* @param GLfloat r, GLfloat g, GLfloat b
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_color (const int stack_id, GLfloat r, GLfloat g, GLfloat b);
|
||||
|
||||
/*
|
||||
* Writes values to describe a line from a to b into the line buffer
|
||||
*
|
||||
* @param coords GLuint (a,b)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_line (const int stack_id, GLuint a, GLuint b);
|
||||
|
||||
/*
|
||||
* Writes values to describe an (a,b,c) plan (triangle) into the plan buffer
|
||||
*
|
||||
* @param coords GLuint (a,b,c)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_plan (const int stack_id, GLuint a, GLuint b, GLuint c);
|
||||
|
||||
/*
|
||||
* Created and compile a shader
|
||||
*
|
||||
* @param type, shader type
|
||||
* src, source code of shader
|
||||
*
|
||||
* @return shader id
|
||||
*/
|
||||
static inline GLuint create_shader(const int stack_id, int type, const char *src)
|
||||
{
|
||||
GLuint shader;
|
||||
int status;
|
||||
|
||||
shader = glCreateShader(type);
|
||||
glShaderSource(shader, 1, &src, NULL);
|
||||
glCompileShader(shader);
|
||||
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||
if(status == GL_FALSE) {
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc(log_len + 1);
|
||||
assert (buffer);
|
||||
glGetShaderInfoLog(shader, log_len, NULL, buffer);
|
||||
|
||||
g_warning("Compile failure in %s shader:\n%s",
|
||||
type == GL_VERTEX_SHADER ? "vertex" : "fragment",
|
||||
buffer);
|
||||
|
||||
g_free(buffer);
|
||||
|
||||
glDeleteShader(shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
static inline void print_stack(int stack_id)
|
||||
{
|
||||
static int n = 0;
|
||||
|
||||
printf("\n[n=%d]***************", n);
|
||||
|
||||
printf("id = %d\tmode = %d\n",
|
||||
graphic_stack[stack_id].id,
|
||||
graphic_stack[stack_id].mode);
|
||||
|
||||
printf("rotation_angles = ");
|
||||
for (int i = 0; i < N_AXIS; i++) {
|
||||
printf("%f\t", graphic_stack[stack_id].rotation_angles[i]); // Rotation angles on each axis
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
printf("vao = %d\n", graphic_stack[stack_id].vao);
|
||||
printf("position_buffer = %d\n", graphic_stack[stack_id].position_buffer);
|
||||
printf("color_buffer = %d\n", graphic_stack[stack_id].color_buffer);
|
||||
printf("program = %d\n", graphic_stack[stack_id].program);
|
||||
printf("m = %d\n", graphic_stack[stack_id].m);
|
||||
printf("v = %d\n", graphic_stack[stack_id].v);
|
||||
printf("p = %d\n", graphic_stack[stack_id].p);
|
||||
|
||||
printf("arrows_ptr = %p\n", graphic_stack[stack_id].arrows_ptr);
|
||||
printf("arrows_nb = %ld\n", graphic_stack[stack_id].arrows_nb);
|
||||
|
||||
printf("buffer_vertex_origin = %p\n", graphic_stack[stack_id].buffer_vertex_origin);
|
||||
printf("buffer_colors_origin = %p\n", graphic_stack[stack_id].buffer_colors_origin);
|
||||
printf("buffer_lines_origin = %p\n", graphic_stack[stack_id].buffer_lines_origin);
|
||||
printf("buffer_plans_origin = %p\n", graphic_stack[stack_id].buffer_plans_origin);
|
||||
|
||||
printf("buffer_vertex_size = %ld\n", graphic_stack[stack_id].buffer_vertex_size);
|
||||
printf("buffer_colors_size = %ld\n", graphic_stack[stack_id].buffer_colors_size);
|
||||
printf("buffer_lines_size = %ld\n", graphic_stack[stack_id].buffer_lines_size);
|
||||
printf("buffer_plans_size = %ld\n", graphic_stack[stack_id].buffer_plans_size);
|
||||
|
||||
printf("buffer_vertex_0_arrow = %ld\n", graphic_stack[stack_id].buffer_vertex_0_arrow);
|
||||
printf("buffer_colors_0_arrow = %ld\n", graphic_stack[stack_id].buffer_colors_0_arrow);
|
||||
printf("buffer_lines_0_arrow = %ld\n", graphic_stack[stack_id].buffer_lines_0_arrow);
|
||||
printf("buffer_plans_0_arrow = %ld\n", graphic_stack[stack_id].buffer_plans_0_arrow);
|
||||
|
||||
printf("********************\n");
|
||||
n++;
|
||||
}
|
||||
|
||||
|
||||
void graphics_model_setup (const int stack_id);
|
||||
|
||||
int draw_one_arrow_vertex (const int stack_id,
|
||||
int space_X,
|
||||
int space_Y,
|
||||
int space_Z,
|
||||
int weight,
|
||||
int site,
|
||||
int x,
|
||||
int y,
|
||||
int z);
|
||||
|
||||
int draw_one_arrow_line(const int stack_id,
|
||||
int offset_vertex);
|
||||
|
||||
/*
|
||||
* Writes grid ridges to vertex and color buffers
|
||||
*
|
||||
* @param coords long (x,y,z), step_x, step_y, step_z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
int draw_space_ridges_vertex (const int stack_id,
|
||||
long offset_vertex,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
int draw_space_ridges_lines (const int stack_id);
|
||||
|
||||
/*
|
||||
* Writes grid lines on space faces
|
||||
*
|
||||
* @param coords long (x,y,z)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
long draw_grids_on_space_faces_vertex (const int stack_id,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
long draw_grids_on_space_faces_lines (const int stack_id,
|
||||
long offset_vertex,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
int set_arrow (int stack_id,
|
||||
int arrows_nb,
|
||||
int space_X,
|
||||
int space_Y,
|
||||
int space_Z,
|
||||
int requested_weight,
|
||||
int site,
|
||||
int arrow_x,
|
||||
int arrow_y,
|
||||
int arrow_z);
|
||||
|
|
@ -1,42 +1,43 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: OpenGL utils header
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
|
||||
* Copyright (C) 2023 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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Graphics header *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "base.h"
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
#include <epoxy/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <GL/glext.h>
|
||||
#include <cglm/cglm.h>
|
||||
|
||||
#define VERTEX_SHADER_FILE "src/graphics/shaders/shader.vert"
|
||||
#define FRAG_SHADER_FILE "src/graphics/shaders/shader.frag"
|
||||
#define VERTEX_SHADER_FILE "src/shader.vert"
|
||||
#define FRAG_SHADER_FILE "src/shader.frag"
|
||||
#define GL_TARGET_MAJOR_VERSION 0
|
||||
#define GL_TARGET_MINOR_VERSION 4
|
||||
|
||||
|
||||
/*
|
||||
* Structure describing a gl_area and its parameters, used to create a table
|
||||
* of Gem-graph client current gl_areas
|
||||
|
@ -80,6 +81,14 @@ struct graphic_stack_t {
|
|||
*/
|
||||
extern struct graphic_stack_t *graphic_stack;
|
||||
|
||||
/*
|
||||
* Structure describing a gl_area and its parameters, used to create a table
|
||||
* of Gem-graph client current gl_areas
|
||||
*/
|
||||
bool ui_render_stack(GtkWidget *container_widget);
|
||||
|
||||
bool ui_setup_glarea(int target_mode, GtkWidget *target_widget);
|
||||
|
||||
/*
|
||||
* Initializes a gl_area
|
||||
*
|
||||
|
@ -96,7 +105,7 @@ int graphics_init(void *error_buffer);
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
//void graphics_draw(const int stack_id);
|
||||
void graphics_draw(const int stack_id);
|
||||
|
||||
/*
|
||||
* Shutdowns a gl_area
|
||||
|
@ -116,6 +125,10 @@ bool graphics_shutdown(const int stack_id, void *error_buffer);
|
|||
*/
|
||||
bool graphics_init_shaders(const int stack_id);
|
||||
|
||||
bool ui_init_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value);
|
||||
|
||||
/* Initializes the buffer of a gl_area
|
||||
* Calls according to the user preferences
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
|
@ -253,6 +266,148 @@ static inline void print_stack(int stack_id)
|
|||
}
|
||||
|
||||
|
||||
void graphics_model_setup (const int stack_id);
|
||||
|
||||
int draw_one_arrow_vertex (const int stack_id,
|
||||
int space_X,
|
||||
int space_Y,
|
||||
int space_Z,
|
||||
int weight,
|
||||
int site,
|
||||
int x,
|
||||
int y,
|
||||
int z);
|
||||
|
||||
int draw_one_arrow_line(const int stack_id,
|
||||
int offset_vertex);
|
||||
|
||||
/*
|
||||
* Writes grid ridges to vertex and color buffers
|
||||
*
|
||||
* @param coords long (x,y,z), step_x, step_y, step_z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
int draw_space_ridges_vertex (const int stack_id,
|
||||
long offset_vertex,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
int draw_space_ridges_lines (const int stack_id);
|
||||
|
||||
/*
|
||||
* Writes grid lines on space faces
|
||||
*
|
||||
* @param coords long (x,y,z)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
long draw_grids_on_space_faces_vertex (const int stack_id,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
long draw_grids_on_space_faces_lines (const int stack_id,
|
||||
long offset_vertex,
|
||||
long x,
|
||||
long y,
|
||||
long z);
|
||||
|
||||
int set_arrow (int stack_id,
|
||||
int arrows_nb,
|
||||
int space_X,
|
||||
int space_Y,
|
||||
int space_Z,
|
||||
int requested_weight,
|
||||
int site,
|
||||
int arrow_x,
|
||||
int arrow_y,
|
||||
int arrow_z);
|
||||
/*
|
||||
* Initializes a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
int graphics_init(void *error_buffer);
|
||||
|
||||
/*
|
||||
* Draws the current buffer to a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
//void graphics_draw(const int stack_id);
|
||||
|
||||
/*
|
||||
* Shutdowns a gl_area
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if success
|
||||
*/
|
||||
bool graphics_shutdown(const int stack_id, void *error_buffer);
|
||||
|
||||
/*
|
||||
* Initializes the shaders of a gl_area and link them to a program
|
||||
*
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
bool graphics_init_shaders(const int stack_id);
|
||||
|
||||
/* Initializes the buffer of a gl_area
|
||||
* Calls according to the user preferences
|
||||
* @param gl_area, ptr to the gl_area widget
|
||||
* @return void
|
||||
*/
|
||||
void graphics_init_buffers(const int stack_id);
|
||||
|
||||
/*
|
||||
* Draws a vertex (x, y, z)
|
||||
* if (console) prints (x, y, z) values to console
|
||||
*
|
||||
* @param GLfloat x, GLfloat y, GLfloat z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_vertex (const int stack_id,
|
||||
GLfloat x,
|
||||
GLfloat y,
|
||||
GLfloat z);
|
||||
|
||||
/*
|
||||
* Draws the color (r, g, b) associated to a vertex
|
||||
* if (console) prints (r, g, b) values to console
|
||||
*
|
||||
* @param GLfloat r, GLfloat g, GLfloat b
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_color (const int stack_id, GLfloat r, GLfloat g, GLfloat b);
|
||||
|
||||
/*
|
||||
* Writes values to describe a line from a to b into the line buffer
|
||||
*
|
||||
* @param coords GLuint (a,b)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_line (const int stack_id, GLuint a, GLuint b);
|
||||
|
||||
/*
|
||||
* Writes values to describe an (a,b,c) plan (triangle) into the plan buffer
|
||||
*
|
||||
* @param coords GLuint (a,b,c)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void graphics_draw_plan (const int stack_id, GLuint a, GLuint b, GLuint c);
|
||||
|
||||
void graphics_model_setup (const int stack_id);
|
||||
|
||||
int draw_one_arrow_vertex (const int stack_id,
|
||||
|
|
|
@ -1,30 +1,32 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: Model parsing header
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Model parsing header *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <unistd.h>
|
||||
#include "base.h"
|
||||
|
||||
bool model_init(const char *content, size_t length, const char *basename);
|
||||
bool model_shutdown(void);
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
char *get_space_run_edit_specif();
|
||||
char *get_rules_run_edit_specif();
|
||||
|
||||
/*
|
||||
>>> Dans : [space_page - mode RUN] doivent être : ------------------------------------------------------
|
||||
|
||||
(1) les commandes de mouvement:
|
||||
- run/stop, slow down/speed up, step by step, do/undo/redo
|
||||
+ le buffer [elapsed time] qui montre le temps de simulation écoulé
|
||||
(2) les commandes qui modifient la perception de l'espace (la caméra)
|
||||
- son orientation (X,Y,Z),
|
||||
+ le zoom,
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel)
|
||||
(3) les commandes qui modifient les apparences des objets et des situations d'intérêt
|
||||
(+/- transparents, colorés, etc.)
|
||||
(4) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'ÉDITER L'ESPACE ! <<<
|
||||
>>> Dans : [space_page - mode EDIT] doivent être : ------------------------------------------------------
|
||||
(1) les commandes qui modifient la perception de l'espace (la caméra)
|
||||
- son orientation (X,Y,Z),
|
||||
+ le zoom,
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel)
|
||||
(2) les commandes qui modifient les apparences des objets et des situations d'intérêt
|
||||
(+/- transparents, colorés, etc.)
|
||||
(3) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)
|
||||
(4) les commandes d'édition locales (drag and drop une flèche)
|
||||
('faire de la place' pour insérer)
|
||||
(sélectionner pour déplacer ou enlever...)
|
||||
NB ces commandes doivent être graphiques et/ou accessibles par raccourcis ou en ligne
|
||||
(5) les commandes d'édition globales
|
||||
(ex: introduire, retirer, transformer +/-aléatoirement (n) objets dans l'espace)
|
||||
NB une action effectuée sur une zone d'intérêt devrait pouvoir être automatiquement appliquée
|
||||
à d'autres zones d'intérêt identifiées comme similaires
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'EXÉCUTER UN RUN ! <<<
|
||||
>>> L'objectif est que l'utilisateur ait accès à une organsisation aussi ergonomique que possible -----
|
||||
i.e : chaque utilisateur devrait disposer de 'préférences'
|
||||
c'est-à-dire avoir la possiblité de faire des choix ergonomiques personnalisés.
|
||||
*/
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* */
|
||||
/* E coli by David S. Goodsell (2009) */
|
||||
/* --- */
|
||||
/* Let this freeze frame guide us towards the model */
|
||||
/* that alone can account for the phenomenon ! */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#pragma once // < WTF !?
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <glib-2.0/glib.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
//#include "cold.h"
|
||||
#include "display.h"
|
||||
#include "contain.h"
|
||||
|
||||
|
||||
// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO
|
||||
|
||||
GtkScrolledWindow *get_user_rules_tree ();
|
||||
void set_run_edit_mode(int prescribed_mode);
|
||||
int get_run_edit_mode();
|
||||
GListModel* get_user_tree_model (GObject *item, gpointer root);
|
||||
void on_setup_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object, gpointer user_data);
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Widgets header *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
|
||||
#define W 1920
|
||||
#define H 960
|
||||
#define W_IMAGE W - 320
|
||||
#define H_IMAGE H - 126
|
||||
#define H_STYLES_PANE 30
|
||||
#define W_IMAGE_LOCAL W / 16
|
||||
#define H_IMAGE_LOCAL H / 16
|
||||
|
||||
void main_window_design (GtkWindow *main_window);
|
||||
void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window);
|
||||
|
||||
GtkFrame *get_frame_with_label();
|
||||
GtkWidget *get_selected_rules_vpaned_new();
|
||||
GtkWidget *get_TIME_EXEC_controls_box();
|
||||
GtkWidget *get_SPACE_EDIT_controls_box();
|
||||
GtkButton *get_GtkButton (char *btt_name);
|
||||
GtkWidget *get_window_child_STATE();
|
||||
GtkWidget *get_window_child_RULES();
|
||||
GtkWidget *get_window_child_DATA();
|
||||
|
||||
GtkWidget *get_text_view();
|
||||
GtkFrame *get_frame_with_label();
|
||||
GtkWidget *get_rules_page_new();
|
||||
GtkBox *get_rules_user_tree_new();
|
||||
|
||||
GtkWidget *get_image_ALL_SPACE();
|
||||
GtkWidget *get_image_GLUTAMATE();
|
||||
GtkWidget *get_image_GLUTAMINE();
|
||||
GtkWidget *get_image_HISTIDINE();
|
||||
GtkWidget *get_image_HISTAMINE();
|
||||
GtkWidget *get_image_PHENYLALANINE();
|
||||
GtkWidget *get_image_DOPAMINE();
|
||||
GtkWidget *get_image_ATP();
|
||||
GtkWidget *get_image_AMP();
|
||||
GtkWidget *get_rules_tree_hpaned_new();
|
||||
|
||||
GtkProgressBar *get_ELAPSED_TIME_ProgressBar();
|
||||
GtkBox *get_RUN_STOP_box();
|
||||
GtkBox *get_ZOOM_box();
|
||||
GtkBox *get_edit_TOOL_box();
|
||||
GtkBox *get_XYZ_box();
|
||||
GtkWidget *get_OBJECTS_and_SITUATIONS();
|
||||
GtkBox *get_ELAPSED_TIME_box();
|
||||
|
||||
GtkButton *get_btt_run_xor_edit();
|
||||
|
||||
void window_bar(GtkWindow *window, char *title);
|
||||
|
||||
|
||||
// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO
|
||||
|
||||
GtkScrolledWindow *get_user_rules_tree ();
|
||||
void set_run_edit_mode(int prescribed_mode);
|
||||
int get_run_edit_mode();
|
||||
GListModel* get_user_tree_model (GObject *item, gpointer root);
|
||||
void on_setup_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object, gpointer user_data);
|
||||
char *get_space_run_edit_specif();
|
||||
void icons_for_fun (GtkHeaderBar *header_bar);
|
|
@ -1,7 +1,32 @@
|
|||
#include <gtk-4.0/gtk/gtk.h>
|
||||
#include <assert.h>
|
||||
#include "../include/callback.h"
|
||||
#include "../include/automaton.h"
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* State machine *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include "../include/base.h"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -60,13 +85,13 @@ static char *get_str_STATE_RULES_DATA (int value) {
|
|||
static void debug_printing (int prescribed, int sub_automaton) {
|
||||
switch (sub_automaton) { // sub_automaton 0 is EXEC_EDIT and
|
||||
// sub_automaton 1 is STATE_RULES_DATA
|
||||
case (0) : printf("switch > %5s X %5s <> %5s X %5s\n",
|
||||
case (0) : printf("switch %5s x %5s > %5s X %5s\n",
|
||||
get_str_EXEC_EDIT (choice_EXEC_EDIT),
|
||||
get_str_STATE_RULES_DATA (choice_STATE_RULES_DATA),
|
||||
get_str_EXEC_EDIT (prescribed),
|
||||
get_str_STATE_RULES_DATA (choice_STATE_RULES_DATA));
|
||||
break;
|
||||
case (1) : printf("switch > %5s X %5s <> %5s X %5s\n",
|
||||
case (1) : printf("switch %5s x %5s > %5s X %5s\n",
|
||||
get_str_EXEC_EDIT (choice_EXEC_EDIT),
|
||||
get_str_STATE_RULES_DATA (choice_STATE_RULES_DATA),
|
||||
get_str_EXEC_EDIT (choice_EXEC_EDIT),
|
||||
|
|
192
src/callback.c
|
@ -1,39 +1,67 @@
|
|||
#include <stdio.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Callbacks *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include "../include/callback.h"
|
||||
#include "../include/contain.h"
|
||||
#include "../include/tree.h"
|
||||
#include "../include/contain.h"
|
||||
#include "../include/dialog.h"
|
||||
#include "../include/texts.h"
|
||||
#include "../include/automaton.h"
|
||||
#include "../include/parsing.h"
|
||||
#include "../include/graph_area.h"
|
||||
#include "../include/widgets.h"
|
||||
#include "../include/graphics.h"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* W I N D O W S A C T I V A T I O N */
|
||||
/* W I N D O W S A C T I V A T I O N S */
|
||||
/******************************************************************************/
|
||||
|
||||
static GtkWindow *main_window, *dialog_window;
|
||||
|
||||
void on_main_window_activation (GtkApplication *app, gpointer no_user_data)
|
||||
|
||||
void on_main_window_activation (GtkApplication *app,
|
||||
gpointer no_user_data)
|
||||
{
|
||||
main_window = GTK_WINDOW (gtk_application_window_new (app));
|
||||
main_window_design (main_window);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (on_dialog_window_activation), main_window);
|
||||
g_signal_connect (app,
|
||||
"activate",
|
||||
G_CALLBACK (on_dialog_window_activation),
|
||||
main_window);
|
||||
}
|
||||
|
||||
void on_dialog_window_activation (GtkApplication *app, gpointer no_user_data)
|
||||
|
||||
void on_dialog_window_activation (GtkApplication *app,
|
||||
gpointer no_user_data)
|
||||
{
|
||||
dialog_window = GTK_WINDOW (gtk_application_window_new (app));
|
||||
dialog_window_design (main_window, dialog_window);
|
||||
dialog_window_design (main_window,
|
||||
dialog_window);
|
||||
}
|
||||
|
||||
|
||||
void on_auto_notification (const char *message)
|
||||
static void on_auto_notification (const char *message)
|
||||
{
|
||||
/* Ignored (2024-06-06) because I don't know how to get "main_window" easily
|
||||
/* Ignored (2024-06-06) because I don't know how to get "main_window" easily
|
||||
|
||||
if (window->toast_revealer == NULL) {
|
||||
g_printerr("Can't find app->toast_overlay !\n");
|
||||
|
@ -51,32 +79,53 @@ void on_auto_notification (const char *message)
|
|||
g_printerr("%s\n", message);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* T R E E */
|
||||
/******************************************************************************/
|
||||
void on_user_tree_expander_toggled (GtkExpander *expander, gpointer user_data)
|
||||
|
||||
void on_user_tree_expander_toggled (GtkExpander *expander,
|
||||
gpointer user_data)
|
||||
{
|
||||
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);
|
||||
gboolean is_expanded = gtk_tree_list_row_get_expanded (row);
|
||||
gtk_tree_list_row_set_expanded (row,
|
||||
!is_expanded);
|
||||
}
|
||||
|
||||
void on_bind_user_tree_factory (GtkSignalListItemFactory *factory, GObject* object, gpointer user_data)
|
||||
|
||||
void on_bind_user_tree_factory (GtkSignalListItemFactory *factory,
|
||||
GObject* object,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListItem *list_item = GTK_LIST_ITEM (object); assert (list_item);
|
||||
GtkTreeListRow *row = gtk_list_item_get_item (list_item); assert (row); // if (row != NULL) {...} ?
|
||||
const gchar *text = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_tree_list_row_get_item (row)));
|
||||
GtkListItem *list_item = GTK_LIST_ITEM (object);
|
||||
assert (list_item);
|
||||
|
||||
GtkTreeListRow *row = gtk_list_item_get_item (list_item);
|
||||
assert (row); // if (row != NULL) {...} do something ?
|
||||
|
||||
const gchar *text = gtk_string_object_get_string (
|
||||
GTK_STRING_OBJECT (gtk_tree_list_row_get_item (row)));
|
||||
GtkWidget *expander = gtk_list_item_get_child (list_item);
|
||||
gtk_expander_set_label (GTK_EXPANDER (expander), text);
|
||||
g_signal_handlers_disconnect_by_func(expander, G_CALLBACK (on_user_tree_expander_toggled), row);
|
||||
g_signal_connect(expander, "activate", G_CALLBACK (on_user_tree_expander_toggled), row);
|
||||
gtk_widget_set_margin_start(expander, gtk_tree_list_row_get_depth(row) * 20);
|
||||
g_signal_handlers_disconnect_by_func (expander,
|
||||
G_CALLBACK (on_user_tree_expander_toggled),
|
||||
row);
|
||||
g_signal_connect (expander,
|
||||
"activate",
|
||||
G_CALLBACK (on_user_tree_expander_toggled),
|
||||
row);
|
||||
gtk_widget_set_margin_start (expander,
|
||||
gtk_tree_list_row_get_depth(row) * 20);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* G L A R E A */
|
||||
/******************************************************************************/
|
||||
gboolean on_glarea_render(GtkGLArea *area, GdkGLContext *context)
|
||||
|
||||
gboolean on_glarea_render(GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
// Check if the widget is a glarea
|
||||
if(gtk_gl_area_get_error(area) != NULL) {
|
||||
|
@ -167,53 +216,88 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
|
|||
/* B U T T O N S */
|
||||
/******************************************************************************/
|
||||
|
||||
static void switch_STATE_RULES_DATA() {
|
||||
|
||||
switch (get_STATE_RULES_DATA()) {
|
||||
|
||||
case (STATE) :
|
||||
gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_STATE()));
|
||||
break;
|
||||
|
||||
case (RULES) :
|
||||
gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_RULES()));
|
||||
break;
|
||||
|
||||
case (DATA) :
|
||||
gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_DATA()));
|
||||
break;
|
||||
|
||||
default :
|
||||
printf("default in callback.on_toggle_STATE_RULES_DATA()\n");
|
||||
}
|
||||
}
|
||||
|
||||
void on_toggle_EXEC_EDIT (GtkWidget *toggled_button, gpointer user_data) {
|
||||
|
||||
if (get_EXEC_EDIT ()) {
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button), "power-profile-balanced-rtl-symbolic");
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button),
|
||||
"power-profile-balanced-rtl-symbolic");
|
||||
set_EXEC_EDIT (EXEC);
|
||||
|
||||
} else {
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button), "text-editor-symbolic");
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (toggled_button),
|
||||
"text-editor-symbolic");
|
||||
|
||||
// https://docs.gtk.org/gtk4/class.Window.html TODO 2024-06-30
|
||||
// gtk_window_present (GTK_WINDOW (dialog_window)); // works once only !
|
||||
|
||||
set_EXEC_EDIT (EDIT);
|
||||
}
|
||||
switch (get_STATE_RULES_DATA()) {
|
||||
case (STATE) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_STATE())); break;
|
||||
case (RULES) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_RULES())); break;
|
||||
case (DATA) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_DATA())); break;
|
||||
default : printf("default in callback.on_toggle_STATE_RULES_DATA()\n");
|
||||
}
|
||||
|
||||
switch_STATE_RULES_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));
|
||||
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")) set_STATE_RULES_DATA (STATE);
|
||||
if (! strcmp (toggled_button_name, "rules")) set_STATE_RULES_DATA (RULES);
|
||||
if (! strcmp (toggled_button_name, "data analysis")) set_STATE_RULES_DATA (DATA);
|
||||
if (! strcmp (toggled_button_name, "state")) {
|
||||
set_STATE_RULES_DATA (STATE);
|
||||
}
|
||||
|
||||
if (is_active)
|
||||
switch (get_STATE_RULES_DATA()) {
|
||||
case (STATE) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_STATE())); break;
|
||||
case (RULES) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_RULES())); break;
|
||||
case (DATA) : gtk_window_set_child (main_window, GTK_WIDGET (get_window_child_DATA())); break;
|
||||
default : printf("default in callback.on_toggle_STATE_RULES_DATA()\n");
|
||||
}
|
||||
if (! strcmp (toggled_button_name, "rules")) {
|
||||
set_STATE_RULES_DATA (RULES);
|
||||
}
|
||||
|
||||
if (! strcmp (toggled_button_name, "data analysis")) {
|
||||
set_STATE_RULES_DATA (DATA);
|
||||
}
|
||||
|
||||
if (is_active) {
|
||||
switch_STATE_RULES_DATA();
|
||||
}
|
||||
}
|
||||
|
||||
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
|
||||
printf ("callback.c (line 201) - SAVE_CURRENT_MODEL_BEFORE_EDITING\n");
|
||||
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL,
|
||||
gpointer data) {
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (data),
|
||||
TRUE);
|
||||
printf ("callback.c (line 294) - SAVE_CURRENT_MODEL_BEFORE_EDITING\n");
|
||||
}
|
||||
|
||||
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
|
||||
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL,
|
||||
gpointer data) {
|
||||
gtk_window_close (GTK_WINDOW (data));
|
||||
printf ("callback.c (line 206) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n");
|
||||
printf ("callback.c (line 300) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n");
|
||||
}
|
||||
|
||||
void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data) {
|
||||
void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL,
|
||||
gpointer data) {
|
||||
gtk_window_close (GTK_WINDOW (data));
|
||||
printf ("callback.c (line 211) - WRITE_CURRENT_MODEL\n");
|
||||
printf ("callback.c (line 306) - WRITE_CURRENT_MODEL\n");
|
||||
}
|
||||
|
||||
|
|
27
src/dialog.c
|
@ -1,3 +1,30 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Dialog window *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include "../include/callback.h"
|
||||
|
||||
void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){
|
||||
|
|
63
src/draw.c
|
@ -1,26 +1,35 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: GL functions
|
||||
*
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
|
||||
* Copyright (C) 2023 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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Drawing *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include <cglm/cglm.h>
|
||||
|
||||
#include "../include/base.h"
|
||||
#include "../include/graphics.h"
|
||||
|
||||
/*
|
||||
* Writes values to describe a vertex at (x,y,z) intoq the vertex buffer
|
||||
|
@ -29,14 +38,6 @@
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <cglm/cglm.h>
|
||||
#include "../include/base.h"
|
||||
//#include "../include/ui.h"
|
||||
#include "../include/graph_area.h"
|
||||
|
||||
void graphics_draw_vertex (const int stack_id,
|
||||
GLfloat x,
|
||||
GLfloat y,
|
||||
|
|
|
@ -1,32 +1,31 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: User interface functions
|
||||
*
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Callbacks *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
#include <glib-2.0/glib.h>
|
||||
|
||||
#include "../include/contain.h"
|
||||
#include "../include/graph_area.h"
|
||||
#include "../include/graphics.h"
|
||||
#include "../include/callback.h"
|
||||
|
||||
struct stack_index_t {
|
||||
|
|
|
@ -1,33 +1,32 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: GL functions
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
|
||||
* Copyright (C) 2023 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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Graph - stack *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "../include/contain.h"
|
||||
#include "../include/graph_area.h"
|
||||
#include "../include/graphics.h"
|
||||
#include "../include/parsing.h"
|
||||
|
||||
#define TEST 0
|
||||
|
|
54
src/grid.c
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
* Gem-graph
|
||||
*
|
||||
* Desc: OpenGL grid functions
|
||||
*
|
||||
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Drawing empty space *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include "../include/base.h"
|
||||
//#include "../include/ui.h"
|
||||
#include "../include/graphics.h"
|
||||
|
||||
int draw_space_ridges_vertex (const int stack_id,
|
||||
|
|
56
src/init.c
|
@ -1,34 +1,34 @@
|
|||
/*
|
||||
* Gem-graph OpenGL experiments
|
||||
*
|
||||
* Desc: GL functions
|
||||
*
|
||||
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
|
||||
* Copyright (C) 2023 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Init OpenGL graphism *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include "../include/base.h"
|
||||
#include "../include/contain.h" // instead of "ui.h"
|
||||
#include "../include/graph_area.h"
|
||||
#include "../include/graphics.h"
|
||||
|
||||
/* Initializes the buffer of a gl_area
|
||||
* Calls according to the user preferences
|
||||
|
|
41
src/main.c
|
@ -1,11 +1,31 @@
|
|||
/******************************************************************************/
|
||||
/* */
|
||||
/* E coli by David S. Goodsell (2009) */
|
||||
/* --- */
|
||||
/* Let this freeze frame guide us towards the model */
|
||||
/* that alone can account for the phenomenon ! */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Main *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include "../include/callback.h"
|
||||
|
||||
|
@ -14,13 +34,14 @@ int main (int argc, char **argv)
|
|||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.jean.GTK4_GG_hack", G_APPLICATION_DEFAULT_FLAGS);
|
||||
app = gtk_application_new ("org.jean.GG_hack", G_APPLICATION_DEFAULT_FLAGS);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (on_main_window_activation), NULL);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (on_dialog_window_activation), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
printf("in contain.get_SPACE_VIEW_box() (line 138) > ui_setup_glarea (0, GTK_WIDGET (middle_box)); < commented 2024/06/27 > TODO\n");
|
||||
printf("\nTODO (2024-06-30) OpenGL see : widgets.get_SPACE_VIEW_box()\
|
||||
\nline 138 > ui_setup_glarea (0, GTK_WIDGET (middle_box));\n\n");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -1,34 +1,31 @@
|
|||
/*
|
||||
* Gem-graph client
|
||||
*
|
||||
* Desc: Model parsing functions
|
||||
*
|
||||
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
|
||||
* Copyright (C) 2024 Adrien Bourmault <neox@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/>.
|
||||
*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Parsing model XML *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlreader.h> // http://xmlsoft.org/examples/#parse1.c
|
||||
// https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/general.html
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Shader frag *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec4 color;
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Shader vert *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 Arthur Menges <arthur.menges@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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
#version 330 core
|
||||
|
||||
uniform mat4 projection_matrix;
|
||||
|
|
48
src/texts.c
|
@ -1,48 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* */
|
||||
/* E coli by David S. Goodsell (2009) */
|
||||
/* --- */
|
||||
/* Let this freeze frame guide us towards the model */
|
||||
/* that alone can account for the phenomenon ! */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
char *get_space_run_edit_specif(){ return "\n\
|
||||
>>> Dans : [space_page - mode RUN] doivent être : ------------------------------------------------------\n\n\
|
||||
(1) les commandes de mouvement:\n\
|
||||
- run/stop, slow down/speed up, step by step, do/undo/redo\n\
|
||||
+ le buffer [elapsed time] qui montre le temps de simulation écoulé\n\n\
|
||||
(2) les commandes qui modifient la perception de l'espace (la caméra)\n\
|
||||
- son orientation (X,Y,Z),\n\
|
||||
+ l'orientation (X,Y,Z) de l'état dans l'espace (six possibilités),\n\
|
||||
+ le zoom,\n\
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel) \n\n\
|
||||
(3) les commandes qui modifient les apparences des objets et des situations d'intérêt\n\
|
||||
(+/- transparents, colorés, etc.)\n\n\
|
||||
(4) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)\n\n\
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'ÉDITER L'ESPACE ! <<<\n\n\n\
|
||||
>>> Dans : [space_page - mode EDIT] doivent être : ------------------------------------------------------\n\n\
|
||||
(1) les commandes qui modifient la perception de l'espace (la caméra)\n\
|
||||
- son orientation (X,Y,Z),\n\
|
||||
+ l'orientation (X,Y,Z) de l'état dans l'espace (six possibilités),\n\
|
||||
+ le zoom,\n\
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel) \n\n\
|
||||
(2) les commandes qui modifient les apparences des objets et des situations d'intérêt\n\
|
||||
(+/- transparents, colorés, etc.)\n\n\
|
||||
(3) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)\n\n\
|
||||
(4) les commandes d'édition locales (drag and drop une flèche)\n\
|
||||
('faire de la place' pour insérer)\n\
|
||||
(sélectionner pour déplacer ou enlever...)\n\
|
||||
NB ces commandes doivent être graphiques et/ou accessibles par raccourcis ou en ligne\n\n\
|
||||
(5) les commandes d'édition globales\n\
|
||||
(ex: introduire, retirer, transformer +/-aléatoirement (n) objets dans l'espace)\n\n\n\
|
||||
NB une action effectuée sur une zone d'intérêt devrait pouvoir être automatiquement appliquée\n\
|
||||
à d'autres zones d'intérêt identifiées comme similaires\n\n\
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'EXÉCUTER UN RUN ! <<<\n\n\n\
|
||||
>>> L'objectif est que l'utilisateur ait accès à une organsisation aussi ergonomique que possible -----\n\n\
|
||||
i.e : chaque utilisateur devrait disposer de 'préférences'\n\
|
||||
c'est-à-dire avoir la possiblité de faire des choix ergonomiques personnalisés.\n\
|
||||
";}
|
||||
|
||||
char *get_rules_run_edit_specif(){ return "\n\
|
||||
";}
|
31
src/tree.c
|
@ -1,10 +1,31 @@
|
|||
#include <stdio.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* GTK4 Tree list *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2024 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "../include/contain.h"
|
||||
#include "../include/texts.h"
|
||||
#include "../include/callback.h"
|
||||
|
||||
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
||||
|
|
|
@ -1,12 +1,34 @@
|
|||
#include <stdio.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Widgets *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 Adrien Bourmault <neox@a-lec.org> *
|
||||
* Copyright © 2023 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "../include/graph_area.h"
|
||||
|
||||
#include "../include/base.h"
|
||||
#include "../include/callback.h"
|
||||
#include "../include/automaton.h"
|
||||
#include "../include/display.h"
|
||||
#include "../include/tree.h"
|
||||
#include "../include/texts.h"
|
||||
#include "../include/widgets.h"
|
||||
|
||||
// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO
|
||||
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
||||
|
@ -149,8 +171,6 @@ GtkWidget *get_SPACE_EDIT_controls_box() {
|
|||
}
|
||||
|
||||
|
||||
static void icons_for_fun (GtkHeaderBar *header_bar);
|
||||
|
||||
static GtkButton *btt_open_STATE;
|
||||
static GtkButton *btt_open_RULES;
|
||||
static GtkButton *btt_open_DATA;
|
||||
|
@ -204,10 +224,7 @@ void window_header_bar (GtkWindow *window, char *title){
|
|||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_DATA));
|
||||
|
||||
|
||||
icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
|
||||
// https://iconduck.com/sets/carbon-icons < pas mal ...
|
||||
// https://thenounproject.com/icon/train-134324/
|
||||
// ma préférée : Transport Steam Engine Icon mais : [ process icon ] semble un bon choix...
|
||||
icons_for_fun (GTK_HEADER_BAR (header_bar));
|
||||
}
|
||||
|
||||
void main_window_design (GtkWindow *main_window){
|
||||
|
@ -230,7 +247,7 @@ void main_window_design (GtkWindow *main_window){
|
|||
|
||||
|
||||
GtkWidget *get_window_child_STATE() {
|
||||
if (0) printf("contain.get_window_child_STATE (line 235)\n");
|
||||
if (0) printf("widgets.get_window_child_STATE (line 235)\n");
|
||||
GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||
gtk_box_append (page_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
|
||||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
|
@ -242,7 +259,7 @@ GtkWidget *get_window_child_STATE() {
|
|||
}
|
||||
|
||||
GtkWidget *get_window_child_RULES(){
|
||||
if (0) printf("contain.get_window_child_RULES (line 246)\n");
|
||||
if (0) printf("widgets.get_window_child_RULES (line 246)\n");
|
||||
GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
|
||||
// GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles");
|
||||
// GtkWidget *édition_de_la_règle_sélectionnée_n_1 = gtk_frame_new ("Inspection");
|
||||
|
@ -254,7 +271,7 @@ GtkWidget *get_window_child_RULES(){
|
|||
}
|
||||
|
||||
GtkWidget *get_window_child_DATA (){
|
||||
if (0) printf("contain.get_window_child_DATA (line 259)\n");
|
||||
if (0) printf("widgets.get_window_child_DATA (line 279)\n");
|
||||
GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 32));
|
||||
|
||||
GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect\n-----------");
|
||||
|
@ -353,74 +370,3 @@ GtkWidget *get_window_child_DATA (){
|
|||
return GTK_WIDGET (data_box);
|
||||
}
|
||||
|
||||
static void icons_for_fun (GtkHeaderBar *header_bar)
|
||||
{
|
||||
GtkButton *go_home = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (go_home, "go-home-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (go_home));
|
||||
|
||||
GtkButton *user_trash = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (user_trash, "user-trash-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (user_trash));
|
||||
|
||||
GtkButton *help_biblio = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_biblio, "accessories-dictionary-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_biblio));
|
||||
|
||||
GtkButton *help_doc = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_doc, "emblem-documents-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_doc));
|
||||
|
||||
GtkButton *help_about = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_about, "help-about-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_about));
|
||||
|
||||
GtkButton *help_faq = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_faq, "help-faq-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_faq));
|
||||
|
||||
GtkButton *terminal = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (terminal, "utilities-terminal-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (terminal));
|
||||
|
||||
GtkButton *search = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (search, "folder-saved-search-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (search));
|
||||
|
||||
GtkButton *preferences_desktop_appearance = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (preferences_desktop_appearance, "preferences-desktop-appearance-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_desktop_appearance));
|
||||
|
||||
GtkButton *preferences_system = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (preferences_system, "preferences-system-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_system));
|
||||
|
||||
GtkButton *document_properties = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (document_properties, "document-properties-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (document_properties));
|
||||
|
||||
GtkButton *text_edit = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (text_edit, "text-editor-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (text_edit));
|
||||
|
||||
GtkButton *applications_utilities = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (applications_utilities, "applications-utilities-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (applications_utilities));
|
||||
|
||||
GtkButton *open_menu = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (open_menu, "open-menu-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (open_menu));
|
||||
|
||||
GtkButton *power_max = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_max, "power-profile-performance-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_max));
|
||||
|
||||
GtkButton *power_middle = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_middle, "power-profile-balanced-rtl-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_middle));
|
||||
|
||||
GtkButton *power_low = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_low, "power-profile-power-saver-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_low));
|
||||
}
|
||||
|
|
@ -1,9 +1,31 @@
|
|||
#include <stdio.h>
|
||||
#include <gtk-4.0/gtk/gtk.h>
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* *
|
||||
* Gem-graph client *
|
||||
* *
|
||||
* Widgets *
|
||||
* *
|
||||
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
|
||||
* Copyright © 2023 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 publishedby 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/>. *
|
||||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "../include/contain.h"
|
||||
#include "../include/tree.h"
|
||||
#include "../include/texts.h"
|
||||
|
||||
#include "../include/widgets.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -12,63 +34,63 @@ GtkWidget *get_image_ALL_SPACE(){
|
|||
// forget > GTK_WIDGET(get_scrolled_gl_area());
|
||||
// Use GtkImage if you want to display a fixed-size icon
|
||||
// and GtkPicture if you want to display a (maybe) scaled picture.
|
||||
image = gtk_image_new_from_file("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/aXoris.png");
|
||||
image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/gg sketch.png");
|
||||
image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/E coli (Goodsell) 2.png");
|
||||
image = gtk_image_new_from_file("/home/jean/Gem-Graph/gem-graph-client/data/image/aXoris.png");
|
||||
image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/gg sketch.png");
|
||||
image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/E coli (Goodsell) 2.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE, H_IMAGE);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_GLUTAMATE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/glutamate.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamate.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_GLUTAMINE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/glutamine.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamine.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_HISTIDINE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/histidine.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/histidine.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_HISTAMINE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/histamine.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/histamine.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_PHENYLALANINE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/phénylalanine.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/phénylalanine.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_DOPAMINE(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/dopamine.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/dopamine.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_ATP(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/ATP.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_image_AMP(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/AMP.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
||||
GtkWidget *get_user_tree(){
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image/arbre utilisateur.png");
|
||||
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/arbre utilisateur.png");
|
||||
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
|
||||
return image;
|
||||
}
|
||||
|
@ -278,3 +300,122 @@ GtkWidget *get_rules_page_new(){
|
|||
return GTK_WIDGET (H_tree_vs_selected);
|
||||
}
|
||||
|
||||
|
||||
char *get_space_run_edit_specif(){
|
||||
return "\n\
|
||||
\
|
||||
>>> Dans : [space_page - mode RUN] doivent être : ------------------------------------------------------\n\n\
|
||||
(1) les commandes de mouvement:\n\
|
||||
- run/stop, slow down/speed up, step by step, do/undo/redo\n\
|
||||
+ le buffer [elapsed time] qui montre le temps de simulation écoulé\n\n\
|
||||
(2) les commandes qui modifient la perception de l'espace (la caméra)\n\
|
||||
- son orientation (X,Y,Z),\n\
|
||||
+ l'orientation (X,Y,Z) de l'état dans l'espace (six possibilités),\n\
|
||||
+ le zoom,\n\
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel) \n\n\
|
||||
(3) les commandes qui modifient les apparences des objets et des situations d'intérêt\n\
|
||||
(+/- transparents, colorés, etc.)\n\n\
|
||||
(4) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)\n\n\
|
||||
\
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'ÉDITER L'ESPACE ! <<<\n\n\n\
|
||||
\
|
||||
>>> Dans : [space_page - mode EDIT] doivent être : ------------------------------------------------------\n\n\
|
||||
(1) les commandes qui modifient la perception de l'espace (la caméra)\n\
|
||||
- son orientation (X,Y,Z),\n\
|
||||
+ l'orientation (X,Y,Z) de l'état dans l'espace (six possibilités),\n\
|
||||
+ le zoom,\n\
|
||||
+ les paramètres qui définissent la perspective (distances oeil/écran, écran/objet virtuel) \n\n\
|
||||
(2) les commandes qui modifient les apparences des objets et des situations d'intérêt\n\
|
||||
(+/- transparents, colorés, etc.)\n\n\
|
||||
(3) les commandes qui modifient l'apparence de l'espace (grilles, +/- surfaces, aspect des flèches, etc.)\n\n\
|
||||
(4) les commandes d'édition locales (drag and drop une flèche)\n\
|
||||
('faire de la place' pour insérer)\n\
|
||||
(sélectionner pour déplacer ou enlever...)\n\
|
||||
NB ces commandes doivent être graphiques et/ou accessibles par raccourcis ou en ligne\n\n\
|
||||
(5) les commandes d'édition globales\n\
|
||||
(ex: introduire, retirer, transformer +/-aléatoirement (n) objets dans l'espace)\n\n\n\
|
||||
NB une action effectuée sur une zone d'intérêt devrait pouvoir être automatiquement appliquée\n\
|
||||
à d'autres zones d'intérêt identifiées comme similaires\n\n\
|
||||
\
|
||||
(0) NB >>> AUCUNE COMMANDE NE DOIT PERMETTRE D'EXÉCUTER UN RUN ! <<<\n\n\n\
|
||||
\
|
||||
>>> L'objectif est que l'utilisateur ait accès à une organsisation aussi ergonomique que possible -----\n\n\
|
||||
i.e : chaque utilisateur devrait disposer de 'préférences'\n\
|
||||
c'est-à-dire avoir la possiblité de faire des choix ergonomiques personnalisés.\n";
|
||||
}
|
||||
|
||||
|
||||
void icons_for_fun (GtkHeaderBar *header_bar) // https://iconduck.com/sets/adwaita-icon-theme
|
||||
// https://iconduck.com/sets/carbon-icons < pas mal ...
|
||||
// https://thenounproject.com/icon/train-134324/
|
||||
// ma préférée : Transport Steam Engine Icon mais : [ process icon ] semble un bon choix...
|
||||
{
|
||||
GtkButton *go_home = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (go_home, "go-home-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (go_home));
|
||||
|
||||
GtkButton *user_trash = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (user_trash, "user-trash-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (user_trash));
|
||||
|
||||
GtkButton *help_biblio = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_biblio, "accessories-dictionary-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_biblio));
|
||||
|
||||
GtkButton *help_doc = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_doc, "emblem-documents-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_doc));
|
||||
|
||||
GtkButton *help_about = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_about, "help-about-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_about));
|
||||
|
||||
GtkButton *help_faq = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (help_faq, "help-faq-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_faq));
|
||||
|
||||
GtkButton *terminal = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (terminal, "utilities-terminal-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (terminal));
|
||||
|
||||
GtkButton *search = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (search, "folder-saved-search-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (search));
|
||||
|
||||
GtkButton *preferences_desktop_appearance = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (preferences_desktop_appearance, "preferences-desktop-appearance-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_desktop_appearance));
|
||||
|
||||
GtkButton *preferences_system = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (preferences_system, "preferences-system-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_system));
|
||||
|
||||
GtkButton *document_properties = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (document_properties, "document-properties-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (document_properties));
|
||||
|
||||
GtkButton *text_edit = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (text_edit, "text-editor-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (text_edit));
|
||||
|
||||
GtkButton *applications_utilities = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (applications_utilities, "applications-utilities-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (applications_utilities));
|
||||
|
||||
GtkButton *open_menu = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (open_menu, "open-menu-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (open_menu));
|
||||
|
||||
GtkButton *power_max = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_max, "power-profile-performance-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_max));
|
||||
|
||||
GtkButton *power_middle = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_middle, "power-profile-balanced-rtl-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_middle));
|
||||
|
||||
GtkButton *power_low = GTK_BUTTON (gtk_button_new ());
|
||||
gtk_button_set_icon_name (power_low, "power-profile-power-saver-symbolic");
|
||||
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_low));
|
||||
}
|
||||
|