src/*: fix broken images links

This commit is contained in:
Adrien Bourmault 2024-09-10 14:53:25 +02:00
parent 17a337b2b8
commit 0862038597
8 changed files with 127 additions and 97 deletions

View File

@ -269,64 +269,94 @@ GtkWidget *create_axis_slider(int axis)
*
* @returns bool, true if success
*/
bool util_gl_setup_glarea(int target_mode, GtkWidget *target_widget)
{
GtkWidget *gl_area;
/* bool util_gl_setup_glarea(int target_mode, GtkWidget *target_widget) */
/* { */
/* GtkWidget *gl_area; */
g_printerr("[debug] util_gl_setup_glarea()\n");
/* g_printerr("[debug] util_gl_setup_glarea()\n"); */
assert(target_widget);
/* assert(target_widget); */
g_printerr("[debug] util_gl_setup_glarea() : target is %p\n", target_widget);
/* g_printerr("[debug] util_gl_setup_glarea() : target is %p\n", target_widget); */
if (stack_index == NULL) {
stack_index = g_malloc(sizeof(struct stack_index_t));
stack_index_size = 1;
} else {
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)target_widget) {
return false;
}
}
// create entry
stack_index =
g_realloc(stack_index,
++stack_index_size * sizeof(struct stack_index_t));
/* if (stack_index == NULL) { */
/* stack_index = g_malloc(sizeof(struct stack_index_t)); */
/* stack_index_size = 1; */
/* } else { */
/* // look for stack_index entry */
/* for (int i = 0; i < stack_index_size; i++) { */
/* if (stack_index[i].container_widget == (void *)target_widget) { */
/* return false; */
/* } */
/* } */
/* // create entry */
/* stack_index = */
/* g_realloc(stack_index, */
/* ++stack_index_size * sizeof(struct stack_index_t)); */
/* } */
/* gl_area = GTK_WIDGET(gtk_gl_area_new()); */
/* assert(gl_area); */
/* gtk_widget_set_size_request(gl_area, GL_AREA_1000, GL_AREA_1000); */
/* gtk_gl_area_set_auto_render(GTK_GL_AREA(gl_area), true); */
/* gtk_widget_set_hexpand(gl_area, TRUE); */
/* gtk_widget_set_vexpand(gl_area, TRUE); */
/* gtk_widget_set_halign(gl_area, GTK_ALIGN_CENTER); */
/* gtk_widget_set_valign(gl_area, GTK_ALIGN_CENTER); */
/* // The main "draw" call for GtkGLArea */
/* g_signal_connect(GTK_GL_AREA(gl_area), "render", G_CALLBACK(on_glarea_render), NULL); */
/* g_signal_connect(gl_area, "realize", G_CALLBACK(on_glarea_realize), NULL); */
/* g_signal_connect(gl_area, "unrealize", G_CALLBACK(on_glarea_unrealize), NULL); */
/* stack_index[stack_index_size-1].container_widget = */
/* (void*)target_widget; */
/* stack_index[stack_index_size-1].gl_area = (void*)gl_area; */
/* g_printerr("[debug] util_gl_setup_glarea() : set target to %p\n", target_widget); */
/* g_printerr("[debug] util_gl_setup_glarea() : stack_index (@0x%p) had %ld elements\n", */
/* stack_index, */
/* stack_index_size); */
/* gtk_box_append (GTK_BOX (target_widget), gl_area); */
/* gtk_widget_set_visible (GTK_WIDGET (gl_area), TRUE); */
/* // Create sliders */
/* for(int i = 0; i < N_AXIS; i++) */
/* gtk_box_append(GTK_BOX(target_widget), create_axis_slider(i)); */
/* return true; */
/* } */
static void
on_realize_debug (GtkGLArea *area) {
// Initialisation du contexte OpenGL
gdk_gl_context_make_current(gtk_gl_area_get_context(area));
// Si nécessaire, ajouter d'autres initialisations OpenGL ici
}
gl_area = GTK_WIDGET(gtk_gl_area_new());
assert(gl_area);
static gboolean
on_render_debug (GtkGLArea *area, GdkGLContext *context) {
// Ici vous pouvez dessiner avec OpenGL
glClearColor(0.0, 1.0, 0.0, 1.0); // Effacer en vert
glClear(GL_COLOR_BUFFER_BIT);
gtk_widget_set_size_request(gl_area, GL_AREA_1000, GL_AREA_1000);
gtk_gl_area_set_auto_render(GTK_GL_AREA(gl_area), true);
gtk_widget_set_hexpand(gl_area, TRUE);
gtk_widget_set_vexpand(gl_area, TRUE);
gtk_widget_set_halign(gl_area, GTK_ALIGN_CENTER);
gtk_widget_set_valign(gl_area, GTK_ALIGN_CENTER);
return TRUE;
}
// The main "draw" call for GtkGLArea
g_signal_connect(GTK_GL_AREA(gl_area), "render", G_CALLBACK(on_glarea_render), NULL);
g_signal_connect(gl_area, "realize", G_CALLBACK(on_glarea_realize), NULL);
g_signal_connect(gl_area, "unrealize", G_CALLBACK(on_glarea_unrealize), NULL);
bool util_gl_setup_glarea(int target_mode, GtkWidget *target_widget) {
GtkWidget *gl_area = gtk_gl_area_new();
stack_index[stack_index_size-1].container_widget =
(void*)target_widget;
stack_index[stack_index_size-1].gl_area = (void*)gl_area;
g_printerr("[debug] util_gl_setup_glarea() : set target to %p\n", target_widget);
g_printerr("[debug] util_gl_setup_glarea() : stack_index (@0x%p) had %ld elements\n",
stack_index,
stack_index_size);
g_signal_connect(gl_area, "realize", G_CALLBACK(on_realize_debug), NULL);
g_signal_connect(gl_area, "render", G_CALLBACK(on_render_debug), NULL);
gtk_box_append(GTK_BOX(target_widget), gl_area);
gtk_widget_set_visible (GTK_WIDGET (gl_area), TRUE);
// Create sliders
for(int i = 0; i < N_AXIS; i++)
gtk_box_append(GTK_BOX(target_widget), create_axis_slider(i));
gtk_widget_show(gl_area);
return true;
return TRUE;
}

View File

@ -161,17 +161,17 @@ void *widget_get_an_impression_of_what_a_rules_comparator_could_be(){
do_rtfd (stack_b);
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/glutathione.png")));
("./data/image/glutathione.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ribonuclease.png")));
("./data/image/ribonuclease.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png")));
("./data/image/ATP.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));
("./data/image/ADP.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/insuline.png")));
("./data/image/insuline.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/folic acid.png")));
("./data/image/folic acid.png")));
if (CHECK_STACK) printf(" ---------\
widget/rules/tree_tools/compare.c widget_get_an_impression_of_...()\n");//%d\n", *stack_b->arr[0]);
@ -198,9 +198,9 @@ void *widget_get_an_impression_of_what_a_rules_comparator_could_be(){
static GtkWidget *do_rtfd (Stack stack) // TODO
{
GtkImage *image_insuline = GTK_IMAGE (gtk_image_new_from_resource
("/home/jean/Gem-Graph/gem-graph-client/data/image/insuline.png"));
("./data/image/insuline.png"));
gtk_image_set_from_resource (image_insuline,
"/home/jean/Gem-Graph/gem-graph-client/data/image/legumin.png");
"./data/image/legumin.png");
gtk_image_set_pixel_size (image_insuline, 256);
GtkImageType image_insuline_storage_type = gtk_image_get_storage_type (image_insuline);
// gtk_image_set_from_paintable (image_insuline, ? GdkPaintable* paintable);
@ -241,49 +241,49 @@ static void *push_images_onto_stack (Stack stack)
start = clock();
/*
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png")));
("./data/image/AMP.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));
("./data/image/ADP.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamate.png")));
("./data/image/glutamate.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamine.png")));
("./data/image/glutamine.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/legumin.png")));
("./data/image/legumin.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png")));
("./data/image/ATP.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/histidine.png")));
("./data/image/histidine.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/phénylalanine.png")));
("./data/image/phénylalanine.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/dopamine.png")));
("./data/image/dopamine.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ribonuclease.png")));
("./data/image/ribonuclease.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ascorbic acid.png")));
("./data/image/ascorbic acid.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/biotin.png")));
("./data/image/biotin.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/erythorbic acid.png")));
("./data/image/erythorbic acid.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/folic acid.png")));
("./data/image/folic acid.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/glycerol.png")));
("./data/image/glycerol.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/insuline.png")));
("./data/image/insuline.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/glutathione.png")));
("./data/image/glutathione.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/lactic acid.png")));
("./data/image/lactic acid.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/pantothenic acid.png")));
("./data/image/pantothenic acid.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/pyridoxin.png")));
("./data/image/pyridoxin.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/riboflavin.png")));
("./data/image/riboflavin.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/hb.png")));
("./data/image/hb.png")));
*/
end = clock();
long double t = (long double)(end - start) / CLOCKS_PER_SEC;

View File

@ -48,7 +48,7 @@ static void *get_image_many_bars_vertical ()
{
GtkBox *image_many_bars_vertical_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
gtk_box_append (image_many_bars_vertical_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data many bars vertical.png")));
("./data/image/data many bars vertical.png")));
gtk_widget_set_size_request (GTK_WIDGET (image_many_bars_vertical_box), W_IMAGE_100, 0);
return image_many_bars_vertical_box;
}

View File

@ -122,7 +122,7 @@ void *widget_measure_do_end_creation_of_measurement_process()
{
last_one = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
clean = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/clean.png");
("./data/stamp/clean.png");
btt_end = gtk_toggle_button_new_with_label
("click to end the creation of a new measurement process");
// g_signal_connect (btt_end, "toggled", G_CALLBACK (on_closing_page), NULL);
@ -140,7 +140,7 @@ void *widget_measure_do_insert_in_measurements_list()
{
insertion_in_list_measurements_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
insert = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/data collection.png");
("./data/stamp/data collection.png");
btt_insert_in_measurements_list =
gtk_toggle_button_new_with_label ("insert in measurements list");
g_signal_connect (btt_insert_in_measurements_list, "toggled",
@ -159,7 +159,7 @@ void *widget_measure_do_correlate()
{
correlation_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
correl = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/harbor.png");
("./data/stamp/harbor.png");
btt_skip_this_step =
gtk_toggle_button_new_with_label ("next");
// g_signal_connect (btt_skip_this_step, "toggled", G_CALLBACK (on_skip_this_step), NULL);
@ -180,7 +180,7 @@ void *widget_measure_do_depends_on_a_single_event()
// ici, il faut inactiver le btt_select_first_of_two
one_rule_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
scale = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/camera icon.png");
("./data/stamp/camera icon.png");
btt_select_nb = gtk_toggle_button_new_with_label ("count the number of occurences");
btt_select_date = gtk_toggle_button_new_with_label ("save occurences dates");
btt_select_situation = gtk_toggle_button_new_with_label ("save occurences situations");
@ -211,7 +211,7 @@ void *widget_measure_do_select_a_second_rules_set()
{
select_second_rules_set_box= GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
sizes_xy = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure compass icon.png");
("./data/stamp/measure compass icon.png");
btt_select_rules_second = gtk_toggle_button_new_with_label ("select a second rules set");
g_signal_connect (btt_select_rules_second, "toggled",
G_CALLBACK (on_select_a_second_rules_set), NULL);
@ -231,7 +231,7 @@ void *widget_measure_do_choose_an_event_type()
gtk_label_new (" < done. A second set of rules was selected"));
two_rules_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
bridge = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure temperature icon.png");
("./data/stamp/measure temperature icon.png");
btt_time_elapsed = gtk_toggle_button_new_with_label ("time_elapsed");
btt_event_in_between = gtk_toggle_button_new_with_label ("event_in_between");
g_signal_connect (btt_time_elapsed, "toggled",
@ -259,7 +259,7 @@ void *widget_measure_do_depends_on_one_or_two_events()
// ici, il faudrait inactiver le btt_select_rules_first
select_one_or_two_rules_events_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
balance = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/balance icon.png");
("./data/stamp/balance icon.png");
btt_select_first_of_two = gtk_toggle_button_new_with_label ("measure depends on a single event");
btt_select_second_of_two = gtk_toggle_button_new_with_label ("measure depends on two events");
g_signal_connect (btt_select_first_of_two, "toggled",
@ -279,7 +279,7 @@ void *widget_measure_do_select_rules_first ()
{
select_rules_first_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
pressure = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure pressure icon.png");
("./data/stamp/measure pressure icon.png");
btt_select_rules_first = gtk_toggle_button_new_with_label ("select rules first");
g_signal_connect (btt_select_rules_first, "toggled",
G_CALLBACK (on_select_rules_first), NULL);
@ -296,7 +296,7 @@ void *widget_get_measure_page()
measure_page = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
edit_a_new_measure_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
caliper = gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure caliper icon.png");
("./data/stamp/measure caliper icon.png");
btt_edit_a_new_measure = gtk_toggle_button_new_with_label ("edit a new measure");
g_signal_connect (btt_edit_a_new_measure, "toggled",
G_CALLBACK (on_start_new_measure), NULL);

View File

@ -35,7 +35,7 @@
static void *widget_get_selected_rule_geometry_before()
{
GtkWidget *rule_before = GTK_WIDGET (gtk_picture_new_for_filename \
("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png"));
("./data/image/AMP.png"));
gtk_widget_set_size_request (GTK_WIDGET (rule_before), 0, W_IMAGE_800); // OK (provisoire)
return GTK_WIDGET (rule_before);
}
@ -43,7 +43,7 @@ static void *widget_get_selected_rule_geometry_before()
static void *widget_get_selected_rule_geometry_after()
{
GtkWidget *rule_after = GTK_WIDGET (gtk_picture_new_for_filename \
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png"));
("./data/image/ADP.png"));
gtk_widget_set_size_request (GTK_WIDGET (rule_after), 0, W_IMAGE_800); // OK (provisoire))
return GTK_WIDGET (rule_after);
}

View File

@ -33,7 +33,7 @@ void *widget_get_time_results_box () {
gtk_box_append (time_box, GTK_WIDGET (gtk_button_new_with_label ("\n a widget\n\
intended to\n modulate\n the look of\n the various\n represented\n flows\n")));
gtk_box_append (time_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data évolutions parallèles (n > 30) étendu.png")));
("./data/image/data évolutions parallèles (n > 30) étendu.png")));
// https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/blob/master/src/load-graph.cpp?ref_type=heads
// https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/blob/master/src/gsm-graph.c?ref_type=heads
// https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/tree/master/src?ref_type=heads
@ -47,11 +47,11 @@ void *widget_get_display_results_box () {
gtk_box_append (data_box, gtk_button_new_with_label ("repartitions (1D, 2D)"));
gtk_box_append (data_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data bar graph vertical.png")));
("./data/image/data bar graph vertical.png")));
gtk_box_append (data_box, gtk_button_new_with_label ("correlations"));
gtk_box_append (data_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data correlations (4, horizontal).png")));
("./data/image/data correlations (4, horizontal).png")));
gtk_box_append (data_box, gtk_button_new_with_label ("evolutions"));
GtkBox *scroll_bar_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));

View File

@ -33,13 +33,13 @@ static void *widget_get_non_time_dependent_analysis_elements() // for fun !
{
GtkBox *results_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data bar graph vertical.png")));
("./data/image/data bar graph vertical.png")));
gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data correlations (4, horizontal).png")));
("./data/image/data correlations (4, horizontal).png")));
gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/data network interpretation (bump chart).png")));
("./data/image/data network interpretation (bump chart).png")));
gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/hb.png")));
("./data/image/hb.png")));
return results_box;
}

View File

@ -76,11 +76,11 @@ static GtkWidget *window_topbar (GtkWindow *window)
/******************************************************************************/
char *widget_get_text_address_theory () {
return "/home/jean/Gem-Graph/gem-graph-client/data/text/théorie.txt";
return "./data/text/théorie.txt";
}
char *widget_get_text_address_practice () {
return "/home/jean/Gem-Graph/gem-graph-client/data/text/pratique.txt";
return "./data/text/pratique.txt";
}