From 80603caff028fd3c852d44af4b8750bd41f74f47 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 26 Apr 2024 19:40:19 +0200 Subject: [PATCH] cleaning --- Makefile | 73 +++++++++-- ...aph-client => Makefile_de_gem-graph-client | 0 exec | Bin 16440 -> 0 bytes exec.o | Bin 0 -> 26680 bytes main.c | 119 ++++++++++++------ 5 files changed, 150 insertions(+), 42 deletions(-) rename Makefile de gem-graph-client => Makefile_de_gem-graph-client (100%) delete mode 100755 exec create mode 100755 exec.o diff --git a/Makefile b/Makefile index 51c4dbb..1b522bc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,9 @@ -all: Getting_Started_with_GTK +SHELL = /bin/sh +.SUFFIXES: +.SUFFIXES: .c .o +.PHONY = run +.PHONY = clean +.PHONY: Makefile CC=gcc @@ -7,20 +12,74 @@ WARNINGS = -Wall DEBUG = -ggdb -fno-omit-frame-pointer OPTIMIZE = -O2 +all: + exec -Getting_Started_with_GTK: main.c +exec.o: main.c Makefile $(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE) -o $@ main.c clean: - rm -f Getting_Started_with_GTK - rm -f exec + rm -f exec.o # Builder will call this to install the application before running. install: echo "Installing is not supported" # Builder uses this target to run your application. -run: - ./exec +run: exec.o + ./exec.o + +# gcc $( pkg-config --cflags gtk4 ) -o exec main.c $( pkg-config --libs gtk4 ) + +# https://www.gnu.org/software/make/manual/ + +# Makefiles contain five kinds of things: +# explicit rules, implicit rules, variable definitions, directives and comments. + + +# Variables automatiques -------------------------------------------------- +# $@ fait référence à la cible de la règle (au nom de la cible). +# $< fait référence à la première dépendance. +# $? fait référence aux noms de touess les dépendances plus récentes que la cible. +# = les fichiers qui ont été modifiés après la compilation de code la plus récente +# $^ fait référence aux noms de touess les dépendances avec des espaces entre eux. + +# Variables implicites ------------------------------------------------- +# VPATH Équivalent utilitaire de la variable PATH de Bash. Vide par défaut. +# Les chemins sont séparés par le signe deux-points (:). +# CC Le programme pour compiler des fichiers C. +# La valeur par défaut est cc. (Habituellement, cc pointe vers gcc.) +# CPP Le programme qui exécute le préprocesseur C. +# La valeur par défaut est $ (CC) -E. +# LEX Le programme qui transforme les grammaires lexicales en code source. +# La valeur par défaut est lex. (Vous devriez remplacer cela par flex.) +# LINT Le programme qui lint votre code source. La valeur par défaut est lint. +# RM La commande pour supprimer un fichier. La valeur par défaut est rm -f. +# CFLAGS Contient tous les indicateurs du compilateur C (cc). +# CPPFLAGS tous les indicateurs du préprocesseur C. +# .PHONY Spécifie des cibles qui ne ressemblent pas au nom d'un fichier. +# Un exemple est la cible "make clean" ; où clean est une valeur de .PHONY + +# Syntaxe de Base +# Règles : Une règle se compose d'une cible, des dépendances et des commandes. +# Elle est généralement structurée comme suit : +# cible: dépendances +# commande +# +# La cible (target) est le fichier à générer, +# les dépendances (prerequisites) sont les fichiers requis pour construire la cible +# et les commandes (recipe) sont les instructions exécutées pour créer la cible. +# +# A simple makefile consists of “rules” with the following shape: +# target ... : prerequisites ... +# recipe +# ... +# A target is usually the name of a file that is generated by a program; +# examples of targets are executable or object files. +# A target can also be the name of an action to carry out, such as ‘clean’ + + + +# https://blog.stephane-robert.info/docs/makefile/ +# https://blog.stephane-robert.info/docs/task/ -// gcc $( pkg-config --cflags gtk4 ) -o exec main.c $( pkg-config --libs gtk4 ) diff --git a/Makefile de gem-graph-client b/Makefile_de_gem-graph-client similarity index 100% rename from Makefile de gem-graph-client rename to Makefile_de_gem-graph-client diff --git a/exec b/exec deleted file mode 100755 index a00a6281ac58805aced56af63fc6c66fd4c9e5cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16440 zcmeHOeUKEz74O?aKoB@U?XWx9QYtwp9T^*z3VK*^Ex%nZ^vd)Yh3UVlTK{khl z*j4OGHXS(A;0W;&q*jjTs~)R>=u9D34;1wpF~e!7igt6v7*T2=Qq-GBA(6G{j=2^j z${H+;dKX|;VAc>q1USUWc3#LBQIf0F=jCFIc`bROrf3*Z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3&Nq~a z2iASj^SBb_zL+TucN!DJ$in0p@P<&pMFI(rKq>InO}2oKk$JHqHW|FGj||?%$7c&f z$%M$w-Ny-YH!VG9Yr1;SyjEpb8 zl11z!kj9sl$%0sXiJQ!hpoa@Uv^G701#A(LSkM^)0RyxOTA(y2m=VKef?8uiS>S_= zS0E`2tfpdQW^7Che8DK0#SV+-06XvoP&SZDAeR>&i_(m+FabLOA@GK5HcA6mp(GT8 zRn=cO7Q~+mMLh)yc;IE*5dTjJ#wozx6k?cz_t4YuBGLQk{c-f`1O5IW$#9T>u>i5dhCh# zjtXc12*qxpS=G@ zFb+W49>o(4wUDTxI2vRmQyi90*dza==lb}j43M`S84?`%4~Y+e1gsy~qxcB)cM0I0 z6KRsI{|v~Kwyz`N3hIb~10KHoMzZx+fLwU0iLVKU;-}ExDUj7i7;*Uh)|RqI@l{Ua zfDjPUlb~N1$sdCZICfC|C=LYu-HAfNF~rxgr#y5XUjbX#e`Jr|^V%{V2mv8I3Ho>a z??HyNeNVgzjj({3QiR%#cr(cR%^p3kcas>&s~;8l6(nF;sQu_Uy$)fI>OuN4&B5bF zpo}=(NDV{wW<3%~0@)+31QK{!rlJEr5`7mLdl@yXzZ`opVIMB@1(LNll4I{5B&nE% zH||#>WbMbuu`hywLV%L~gS``BPmw8@0xt}JL^5AEq=t(1kYj&fmc*Wc6eX}{{33A> zVc(NM=;_RnB=nG?j6DG{7>^^Pf@ck%E72f+29f%|bfGQ!?deeh2`4uR(t#IuKyVzv r7%$X+bp3><7mZzz>>+P2Nph}Crfgf`V_+E-+|ZL~zfi_N24epQ9PFY) literal 0 HcmV?d00001 diff --git a/main.c b/main.c index 3006c6f..416289f 100755 --- a/main.c +++ b/main.c @@ -1,50 +1,69 @@ -/* GtkBox GtkGrid GtkRevealer GtkStack - * GtkOverlay GtkPaned GtkExpander GtkFixed */ - -/* box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_widget_set_halign (box, GTK_ALIGN_FILL); - gtk_widget_set_valign (box, GTK_ALIGN_CENTER); * START CENTER END FILL * - gtk_window_set_child (GTK_WINDOW (window), box); - puis, après déclaration du bouton, gtk_box_append (GTK_BOX (box), button); */ - -/* grid = gtk_grid_new (); - gtk_window_set_child (GTK_WINDOW (window), grid); - button = gtk_button_new_with_label (" I "); n fois - gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); n fois */ - #include static void print (GtkWidget *widget, gpointer data) {g_print (data);} static void activate (GtkApplication *app, gpointer user_data) { - GtkWidget *window; - GtkWidget *grid; - GtkWidget *button; - GtkHeaderBar *titlebar; + GtkWidget *button_0 = gtk_button_new_with_label ("Quit"); + GtkWidget *button_1 = gtk_button_new_with_label ("I"); + GtkWidget *button_2 = gtk_button_new_with_label ("II"); + GtkWidget *button_3 = gtk_button_new_with_label ("III"); + GtkWidget *button_4 = gtk_button_new_with_label ("IV"); + + GtkWidget *window = gtk_application_window_new (app); + GtkWidget *titlebar = gtk_header_bar_new(); +// GtkWidget *overlay = gtk_overlay_new(); +// gtk_overlay_set_buildable_id (GTK_BUILDABLE(overlay), "overlay id"); +// printf("overlay %s\n", gtk_buildable_get_buildable_id (GTK_BUILDABLE(overlay))); + GtkWidget *switcher = gtk_stack_switcher_new(); +// GtkWidget *sidebar = gtk_stack_sidebar_new(); + GtkStack *stack = GTK_STACK (gtk_stack_new()); + GtkWidget *page_1 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); + GtkWidget *page_2 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); + GtkWidget *grid = gtk_grid_new(); + GtkWidget *box = gtk_box_new (0, 6); // 6 = spacing - window = gtk_application_window_new (app); gtk_window_set_title (GTK_WINDOW (window), "Window"); - gtk_widget_set_size_request (GTK_WINDOW (window), 100, 0); - - titlebar = gtk_header_bar_new(); - gtk_window_set_titlebar (GTK_WINDOW (window), titlebar); - - grid = gtk_grid_new (); + gtk_widget_set_size_request (window, 60, 0); + gtk_window_set_titlebar (GTK_WINDOW (window), titlebar); // header_bar +// gtk_window_set_overlay (GTK_WINDOW (window), overlay); // overlay gtk_window_set_child (GTK_WINDOW (window), grid); - button = gtk_button_new_with_label ("I"); - g_signal_connect (button, "clicked", G_CALLBACK (print), "I'm n°1\n"); - gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); + g_signal_connect (button_1, "clicked", G_CALLBACK (print), "I'm n°1\n"); + gtk_grid_attach (GTK_GRID (grid), button_1, 0, 0, 1, 1); + g_signal_connect (button_2, "clicked", G_CALLBACK (print), "I'm n°2\n"); + gtk_grid_attach (GTK_GRID (grid), button_2, 1, 0, 1, 1); + g_signal_connect (button_0, "clicked", G_CALLBACK (print), "bye !...\n"); + g_signal_connect_swapped (button_0, "clicked", G_CALLBACK (gtk_window_destroy), window); + gtk_grid_attach (GTK_GRID (grid), button_0, 0, 1, 2, 1); + gtk_box_append (GTK_BOX (box), button_3); + gtk_box_append (GTK_BOX (box), button_4); + gtk_grid_attach (GTK_GRID (grid), box, 0, 2, 2, 1); - button = gtk_button_new_with_label ("II"); - g_signal_connect (button, "clicked", G_CALLBACK (print), "I'm n°2\n"); - gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1); +// https://developer-old.gnome.org/gtk4/stable/GtkStack.html +// https://developer.gnome.org/documentation/index.html +// https://docs.gtk.org/gtk4/enum.AccessibleRole.html - button = gtk_button_new_with_label ("Quit"); - g_signal_connect (button, "clicked", G_CALLBACK (print), "bye !...\n"); - g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); - gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1); +// GtkToggleButton *tb1 = GTK_TOGGLE_BUTTON (gtk_button_new_with_label ("tb1")); + gtk_stack_add_titled (stack, page_1, "name 1", "page A"); + gtk_stack_add_titled (stack, page_2, "name 2", "page B"); + gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_HORIZONTAL); + gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_VERTICAL); + + gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), stack); +// gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), stack); + + gtk_stack_page_get_child (GTK_STACK_PAGE(page_1)); +// gtk_stack_page_set_name (GTK_STACK_PAGE(page_1), "new name"); + gtk_stack_set_visible_child_name (stack, "name 1"); + printf("visible is page [%s] with name (%s)\n", + "?", // gtk_stack_page_get_title (GTK_STACK_PAGE(page_1)), + gtk_stack_get_visible_child_name (stack)); + // gtk_stack_page_get_title (GTK_STACK_PAGE(page_1))); + gtk_stack_set_transition_type (GTK_STACK (stack), + GTK_STACK_TRANSITION_TYPE_CROSSFADE); + + gtk_grid_attach (GTK_GRID (grid), switcher, 0, 3, 2, 1); gtk_window_present (GTK_WINDOW (window)); } @@ -63,3 +82,33 @@ main (int argc, return status; } +/* GtkBox GtkGrid GtkRevealer GtkStack + * GtkOverlay GtkPaned GtkExpander GtkFixed */ + +/* GtkBox + * int spacing = 8; + * box = gtk_box_new (0, spacing); + * 0 = GTK_ORIENTATION_HORIZONTAL, 1 = GTK_ORIENTATION_VERTICAL + * gtk_widget_set_halign (box, GTK_ALIGN_FILL); + * gtk_widget_set_valign (box, GTK_ALIGN_CENTER); * START CENTER END FILL * + * gtk_window_set_child (GTK_WINDOW (window), box); + * gtk_box_append (GTK_BOX (box), button); */ + +/* grid = gtk_grid_new (); + gtk_window_set_child (GTK_WINDOW (window), grid); + button = gtk_button_new_with_label (" I "); n fois + gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); n fois */ + + + + + +/* TODO or NOT TODO + * + * GtkRevealer *revealer = gtk_revealer_new(); + * gtk_revealer_set_child (GTK_ ? (revealer), box); + * gtk_revealer_set_transition_type (revealer, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); + * + */ + +