From a65f586892a034a0fc2fbc6728f673b52e6b4de0 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 28 Apr 2024 06:21:57 +0200 Subject: [PATCH] =?UTF-8?q?premiers=20essais=20description=20fen=C3=AAtre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 +- Makefile_de_gem-graph-client | 132 ----------------------------------- cold.c | 25 +++++++ cold.h | 14 ++-- exec.o | Bin 26728 -> 27936 bytes main.c | 19 ++--- 6 files changed, 42 insertions(+), 154 deletions(-) delete mode 100644 Makefile_de_gem-graph-client mode change 100755 => 100644 main.c diff --git a/Makefile b/Makefile index 7e718ca..1dda004 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ run: exec.o #------------------------------------------------------------------------------# -# To study : can the following commands be removed ? # +# To study : how can the following commands be modified ? # #------------------------------------------------------------------------------# #SHELL = /bin/sh @@ -55,8 +55,8 @@ run: exec.o #OPTIMIZE = -O2 # in exec.o: -# $(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE) -# après les $(...), dans : warm.c -o $@ main.c le $@ peut être supprimé +# $(WARNINGS) $(DEBUG) $(OPTIMIZE) < ne sont pas indispensables +# si le $@ est supprimé, main.cest modifié #all: # exec diff --git a/Makefile_de_gem-graph-client b/Makefile_de_gem-graph-client deleted file mode 100644 index 7012b2b..0000000 --- a/Makefile_de_gem-graph-client +++ /dev/null @@ -1,132 +0,0 @@ -## -## Gem-graph OpenGL experiments -## -## Desc: Makefile -## -## Copyright (C) 2023 Arthur Menges -## Copyright (C) 2023 Adrien Bourmault -## -## 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 . -## - -.PHONY: all clean install run build_system -.DELETE_ON_ERROR: $(BINDIR)/gem-graph-client -.DEFAULT_GOAL := all - -# -# Color codes -# -CL='\033[0;32m' -CL2='\033[1;36m' -CL3='\033[0m' -NC='\033[1;37m' - -# -# Variables & constants -# -NTHREADS= $(shell nproc) - -CC=gcc -WARNINGS= -Wall -DEBUG= -ggdb -fno-omit-frame-pointer -fdiagnostics-color=always -fsanitize=bounds -fstack-check - #-fsanitize=address \ - #-fsanitize=pointer-compare -fsanitize=pointer-subtract \ - #-fsanitize=leak -fsanitize=undefined -fsanitize=null -fsanitize=bounds -OPTIMIZE= -O3 -INCLUDE= $(shell pkg-config --cflags glib-2.0 libxml-2.0 gtk4) -LIBS= $(shell pkg-config --libs glib-2.0 libxml-2.0 gtk4) -lGL -lGLU -lm -lepoxy -lX11 -lGLEW - -BINDIR=bin -BUILDDIR=build -SRCDIR=src -#vpath %.c $(SRCDIR) - -SOURCES= $(shell find $(SRCDIR) -type f -name "*.c") -BUILDBINS=$(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES)) -BUILDDEPS=$(patsubst %.c,$(BUILDDIR)/%.d,$(SOURCES)) - --include /etc/os-release - -# -# Directories -# -$(BUILDDIR): - @mkdir -p $@ - @echo -e ${CL2}[$@] ${CL}folder generated.${CL3} - -$(BINDIR): - @mkdir -p $@ - @echo -e ${CL2}[$@] ${CL}folder generated.${CL3} - -# -# Dependencies -# --include $(BUILDDEPS) - -$(BUILDDIR)/%.d: %.c | $(BUILDDIR) - @mkdir -p $(shell dirname $@) - @$(CC) -MM -MT $(@:%.d=%.o) -MF $@ $< - @echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3} - -# -# Compilation -# -$(BINDIR)/gem-graph-client: $(BUILDBINS) | $(BINDIR) - @$(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) $^ $(INCLUDE) $(LIBS) - @echo -e ${CL2}[$@] ${CL}built.${CL3} - - -$(BUILDDIR)/%.o: %.c | $(BUILDDIR) - @mkdir -p $(shell dirname $@) - @$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@ - @echo -e ${CL2}[$@] ${CL}compiled.${CL3} - - -# -# Virtual recipes -# -clean: - @rm -rf $(BINDIR) - @rm -rf $(BUILDDIR) - @echo -e ${CL2}[$@] ${CL}done.${CL3} - -install: - echo "Installing is not supported" - -build_system: - @echo -e ${CL2}[$@] ${CL}building...${CL3} - @make $(BINDIR)/gem-graph-client -j $(NTHREADS) - @echo -e ${CL2}[$@] ${CL}done.${CL3} - -run: build_system - @echo -e ${CL2}[$@] ${CL}executing...${CL3} - @$(BINDIR)/gem-graph-client - @echo -e ${CL2}[$@] ${CL}done.${CL3} - -debug: build_system - @echo -e ${CL2}[$@] ${CL}executing...${CL3} - @gdb $(BINDIR)/gem-graph-client - @echo -e ${CL2}[$@] ${CL}done.${CL3} - -valgrind: build_system - @echo -e ${CL2}[$@] ${CL}executing...${CL3} - @valgrind $(BINDIR)/gem-graph-client - @echo -e ${CL2}[$@] ${CL}done.${CL3} - -all: build_system - @echo -e ${CL2}[$@] ${CL}done.${CL3} - - diff --git a/cold.c b/cold.c index 79e887e..46a10da 100644 --- a/cold.c +++ b/cold.c @@ -2,3 +2,28 @@ #include void print_text(GtkWidget *widget, gpointer data) {g_print (data);} + +void button_0(GtkWindow *window, GtkWidget *grid, int x, int y, int w, int h){ + GtkWidget *button_0 = gtk_button_new_with_label ("Quit"); + g_signal_connect (button_0, "clicked", G_CALLBACK (print_text), "bye !...\n"); + g_signal_connect_swapped (button_0, "clicked", G_CALLBACK (gtk_window_destroy), window); + gtk_grid_attach (GTK_GRID (grid), button_0, x, y, w, h); +} + +void button_1(GtkWidget *grid, int x, int y, int w, int h){ + GtkWidget *button_1 = gtk_button_new_with_label ("bouton (I)"); + g_signal_connect (button_1, "clicked", G_CALLBACK (print_text), "n°1\n"); + gtk_grid_attach (GTK_GRID (grid), button_1, x, y, w, h); +} + +void window_bar(GtkWindow *window, char *title){ + GtkWidget *titlebar = gtk_header_bar_new(); + gtk_window_set_title (window, title); + gtk_window_set_titlebar (window, titlebar); // header_bar +} + +void window_grid(GtkWindow *window){ + GtkWidget *grid = gtk_grid_new(); + gtk_window_set_child (window, grid); +} + diff --git a/cold.h b/cold.h index bae6424..240b5c7 100644 --- a/cold.h +++ b/cold.h @@ -2,13 +2,15 @@ #include void print_text(GtkWidget *widget, gpointer data); +void button_0(GtkWindow *window, GtkWidget *grid, int x, int y, int w, int h); +void button_1(GtkWidget *grid, int x, int y, int w, int h); +void window_bar(GtkWindow *window, char *title); +void window_grid(GtkWindow *window); /* - 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 *button_5 = gtk_button_new_with_label ("V"); +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 *button_5 = gtk_button_new_with_label ("V"); */ // GtkToggleButton *tb1 = GTK_TOGGLE_BUTTON (gtk_button_new_with_label ("tb1")); diff --git a/exec.o b/exec.o index 9a622b732fa15f438e104634dc4c0e5b8e3acd1c..aebdf049c88e7807219366e63d41dae49ea4a83f 100755 GIT binary patch delta 8416 zcmZWv1zc23*WaZ0}&FiAcg_d#4zX?uJv_XU4yOhkPsk%SXh9y@8*1z192gYf8;(=C2Dm%f+6M*MJG$Ypo3p)>bAYXb zeE=XqB1eKV`#6UJb|g%|b7FR2mspzE!8gnn)HTC9u-Iz9S#g( z0zkVS`a2T63{q6vu*qy!;rc_sn1I%srv1p9(Zk4uei#CMh(KdB(5p!F(sfnT4OMGZ z8&zBDoh6Xw;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zvk7j1K)fseA@vUmozfP%Lclpl!nmL)OL Rx^QU%ouKQMEpY73`+t&kTGRjl diff --git a/main.c b/main.c old mode 100755 new mode 100644 index cf5c551..32e4ae0 --- a/main.c +++ b/main.c @@ -3,11 +3,9 @@ #include "warm.h" #include "cold.h" + static void activate (GtkApplication *app, gpointer user_data) { - GtkWidget *button_0 = gtk_button_new_with_label ("Quit"); - GtkWidget *button_1 = gtk_button_new_with_label ("bouton (I)"); - GtkWidget *window = gtk_application_window_new (app); - GtkWidget *titlebar = gtk_header_bar_new(); + GtkWindow *window = GTK_WINDOW (gtk_application_window_new (app)); GtkWidget *switcher = gtk_stack_switcher_new(); // GtkWidget *sidebar = gtk_stack_sidebar_new(); GtkStack *stack = GTK_STACK (gtk_stack_new()); @@ -16,15 +14,10 @@ static void activate (GtkApplication *app, gpointer user_data) { GtkWidget *grid = gtk_grid_new(); GtkWidget *box_1 = gtk_box_new (0, 6); // 6 = spacing - gtk_window_set_title (GTK_WINDOW (window), "Window"); - gtk_window_set_titlebar (GTK_WINDOW (window), titlebar); // header_bar - gtk_window_set_child (GTK_WINDOW (window), grid); - - g_signal_connect (button_1, "clicked", G_CALLBACK (print_text), "n°1\n"); - gtk_grid_attach (GTK_GRID (grid), button_1, 0, 0, 1, 1); - g_signal_connect (button_0, "clicked", G_CALLBACK (print_text), "bye !...\n"); - g_signal_connect_swapped (button_0, "clicked", G_CALLBACK (gtk_window_destroy), window); - gtk_grid_attach (GTK_GRID (grid), button_0, 1, 0, 1, 1); + window_bar (window, "window"); + gtk_window_set_child (window, grid); + button_0 (window, grid, 1,0,1,1); + button_1 (grid, 0,0,1,1); gtk_stack_add_titled (stack, page_0, "n°0", "A"); gtk_stack_add_titled (stack, page_1, "n°1", "B");