This commit is contained in:
Jean Sirmai 2024-08-02 00:09:14 +02:00
parent 3d47418a1a
commit e01982e71d
Signed by: jean
GPG Key ID: FB3115C340E057E3
6 changed files with 53 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
data/stamp/ADP.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
data/stamp/ADP.pdf Normal file

Binary file not shown.

BIN
data/stamp/AMP.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
data/stamp/AMP.xcf Normal file

Binary file not shown.

View File

@ -35,35 +35,30 @@
#define H_IMAGE_ABSURD 960 #define H_IMAGE_ABSURD 960
#define MAX_SIZE 255 #define MAX_SIZE 255
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Below is ^c^v from RMS C manual // Below is ^c^v from RMS C manual (p 77) 24 * 256 * 256 * 2 = 3 145 728
// //
struct intlistlink {int datum; struct intlistlink *next;} babar; struct images_bff {GtkWidget *arr[MAX_SIZE]; int top;};
struct intlistlink *my_list = NULL; static struct images_bff *my_list = NULL, *babar = NULL;
struct intlistlink *alloc_intlistlink () static struct images_bff *alloc_images_bff ()
{ {
struct intlistlink *p; struct images_bff *p;
p = malloc (sizeof (struct intlistlink)); p = malloc (sizeof (struct images_bff));
if (p == NULL) printf ("fatal: ran out of storage"); if (p == NULL) printf ("fatal: ran out of storage");
p->datum = 0; p->arr[MAX_SIZE] = NULL;
p->next = NULL; p->top = 0;
return p; return p;
} }
void add_to_mylist (int my_int) static void add_to_mylist (int my_int)
{ {
struct intlistlink *p = alloc_intlistlink (); struct images_bff *p = alloc_images_bff ();
p->datum = my_int; p->arr[MAX_SIZE] = NULL; // TODO
p->next = my_list; p->top = my_int;
my_list = p; my_list = p;
} }
void free_intlist (struct intlistlink *p) static void free_intlist (struct images_bff *p)
{ {
while (p) // TODO
{
struct intlistlink *q = p;
p = p->next;
free (q);
}
} }
// TODO free_intlist (mylist); // TODO free_intlist (mylist);
// TODO mylist = NULL; // TODO mylist = NULL;
@ -103,7 +98,30 @@ static GtkWidget *peek(Stack *stack)
} }
// ----------------------------------------------------------- // -----------------------------------------------------------
// confrontation of both examples and methods // 2024-08-01
// GTK possède un espace mémoire où les widgets sont alloués/désalloués
// Un widget ne conserve pas son pointeur. Son adresse peut changer.
// Donc créer une stack de widget avec un outil hors GTK n'est pas faisable >>
// - soit tu traites les images hors de GTK,
// - soit tu trouves un outil dans GTK pour ce type d'opération.
// C'est le cas de toute bibliothèque externe que tu utilises :
// Tu n'as pas le droit de faire d'assomptions sur les espaces mémoires externes.
// J'imagine un tableau de vignettes, toutes de même taille.
// https://en.wikipedia.org/wiki/Color_depth 24 * 256 * 256 * 2 = 3 145 728
// Aucun utilisateur ne comparera toutes les règles une à une. 🤔️
// On ne peut en comparer qu'une centaine au plus à la fois.
//
// Chaque utilisateur sélectionnera UNE vignette (par règle)
// pour pouvoir comparer SES quelques règles d'intérêt.
// Et si ces vignettes sont perdues, rien de grave !
// Elles seront toujours très faciles à refaire. 🙂️
//
// Toute vignette aura UNE règle
// mais toute règle n'aura pas nécessairement de vignette. 🤔️
// Donc une application injective & non-surjective.
//
// https://docs.gtk.org/gio/iface.ListModel.html?q=icon << TODO
static void *push_images_onto_stack (Stack stack_b); static void *push_images_onto_stack (Stack stack_b);
@ -117,23 +135,32 @@ void *get_an_impression_of_what_a_rules_comparator_could_be(){
initialize(&stack_b); initialize(&stack_b);
push_images_onto_stack (stack_b); // push_images_onto_stack (stack_b);
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/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")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png"))); ("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png"))); ("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));
push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename push(&stack_b, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png"))); ("/home/jean/Gem-Graph/gem-graph-client/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")));
printf(" --------- \n");//%d\n", *stack_b->arr[0]); printf(" --------- \n");//%d\n", *stack_b->arr[0]);
peek(&stack_b); // peek(&stack_b);
// gtk_box_append (compare_left, peek(&stack_b)); // gtk_box_append (compare_left, peek(&stack_b));
gtk_box_append (compare_left, pop(&stack_b)); gtk_box_append (compare_left, pop(&stack_b));
gtk_box_append (compare_left, pop(&stack_b)); gtk_box_append (compare_left, pop(&stack_b));
gtk_box_append (compare_left, pop(&stack_b)); gtk_box_append (compare_left, pop(&stack_b));
// gtk_box_append (compare_left, pop(&stack)); gtk_box_append (compare_left, pop(&stack_b));
gtk_box_append (compare_left, pop(&stack_b));
gtk_box_append (compare_left, pop(&stack_b));
// gtk_box_append (compare_left, pop(&stack_b));
GtkBox *comparator = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); GtkBox *comparator = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (comparator, GTK_WIDGET (compare_left)); gtk_box_append (comparator, GTK_WIDGET (compare_left));
@ -163,7 +190,7 @@ static void *push_images_onto_stack (Stack stack)
printf("compare.c push_images_onto_stack() start >> "); printf("compare.c push_images_onto_stack() start >> ");
start = clock(); start = clock();
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png"))); ("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png")));
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png"))); ("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));