WIP: comparateur <> https://docs.gtk.org/gio/iface.ListModel.html?q=icon < une piste ?
This commit is contained in:
parent
3d47418a1a
commit
e01982e71d
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
|
@ -35,35 +35,30 @@
|
|||
#define H_IMAGE_ABSURD 960
|
||||
#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 intlistlink *my_list = NULL;
|
||||
struct intlistlink *alloc_intlistlink ()
|
||||
struct images_bff {GtkWidget *arr[MAX_SIZE]; int top;};
|
||||
static struct images_bff *my_list = NULL, *babar = NULL;
|
||||
static struct images_bff *alloc_images_bff ()
|
||||
{
|
||||
struct intlistlink *p;
|
||||
p = malloc (sizeof (struct intlistlink));
|
||||
struct images_bff *p;
|
||||
p = malloc (sizeof (struct images_bff));
|
||||
if (p == NULL) printf ("fatal: ran out of storage");
|
||||
p->datum = 0;
|
||||
p->next = NULL;
|
||||
p->arr[MAX_SIZE] = NULL;
|
||||
p->top = 0;
|
||||
return p;
|
||||
}
|
||||
void add_to_mylist (int my_int)
|
||||
static void add_to_mylist (int my_int)
|
||||
{
|
||||
struct intlistlink *p = alloc_intlistlink ();
|
||||
p->datum = my_int;
|
||||
p->next = my_list;
|
||||
struct images_bff *p = alloc_images_bff ();
|
||||
p->arr[MAX_SIZE] = NULL; // TODO
|
||||
p->top = my_int;
|
||||
my_list = p;
|
||||
}
|
||||
void free_intlist (struct intlistlink *p)
|
||||
static void free_intlist (struct images_bff *p)
|
||||
{
|
||||
while (p)
|
||||
{
|
||||
struct intlistlink *q = p;
|
||||
p = p->next;
|
||||
free (q);
|
||||
}
|
||||
// TODO
|
||||
}
|
||||
// TODO free_intlist (mylist);
|
||||
// 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);
|
||||
|
||||
|
@ -117,23 +135,32 @@ void *get_an_impression_of_what_a_rules_comparator_could_be(){
|
|||
|
||||
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
|
||||
("/home/jean/Gem-Graph/gem-graph-client/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")));
|
||||
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]);
|
||||
|
||||
peek(&stack_b);
|
||||
// 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));
|
||||
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));
|
||||
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 >> ");
|
||||
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")));
|
||||
push(&stack, GTK_WIDGET (gtk_picture_new_for_filename
|
||||
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));
|
||||
|
|
Loading…
Reference in New Issue