From b78f51c58f8dc028a9b50ef4c5c97bcee08abc6f Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 29 May 2024 16:14:41 +0200 Subject: [PATCH] WIP: cleaning... --- TODO (next version).txt | 1 + include/base.h | 79 ++++++++--------------------------------- include/ui.h | 2 ++ src/ui/events.c | 2 +- src/ui/window.c | 4 +-- 5 files changed, 21 insertions(+), 67 deletions(-) diff --git a/TODO (next version).txt b/TODO (next version).txt index 350d89a..d050a4c 100644 --- a/TODO (next version).txt +++ b/TODO (next version).txt @@ -74,6 +74,7 @@ https://docs.gtk.org/gobject/signals.html#Memory_management_of_signal_handlers https://docs.gtk.org/gobject/func.signal_connect.html +WIP: le 3ème boutton de la barre, en haut à gauche, change d'icone si toggled CSS --- diff --git a/include/base.h b/include/base.h index 2718dd6..94ea964 100644 --- a/include/base.h +++ b/include/base.h @@ -22,18 +22,6 @@ * along with this program. If not, see . */ - -/******************************************************************************/ -/* */ -/* E coli by David S. Goodsell (2009) */ -/* --- */ -/* Knowing that only a dynamic model can explain this phenomenon, */ -/* let this beautiful freeze frame be our guide. */ -/* */ -/******************************************************************************/ - - - #pragma once #include #include @@ -49,49 +37,26 @@ #include //#define G_APPLICATION_DEFAULT_FLAGS 0 +enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; // Graphical axis +enum { HOME_MODE, RUN_MODE, EDIT_MODE, PRESENTATION_MODE, N_MODE }; // Gem-graph modes +struct arrow_t { uint load; uint site; uint x; uint y; uint z; }; // describes an arrow +static inline char *read_file(char *filename); -#define W 1920 -#define H 960 -#define W_IMAGE W - 320 -#define H_IMAGE H - 126 -#define H_STYLES_PANE 30 -#define W_IMAGE_LOCAL W / 16 -#define H_IMAGE_LOCAL H / 16 +/* I'm standing on Earth (or any spinning spheroid) and looking towards its North pole, then : + X - X = EAST - WEST = rouge - cyan + Y - Y = ZENITH - NADIR = vert - magenta (fuschia) + Z - Z = NORTH - SOUTH = bleu - jaune */ -// Graphical axis -enum -{ - X_AXIS, - Y_AXIS, - Z_AXIS, +#define EAST 0 // + x rouge +#define WEST 1 // - x cyan +#define ZENITH 2 // + y vert +#define NADIR 3 // - y magenta +#define SOUTH 4 // + z bleu +#define NORTH 5 // - z jaune - N_AXIS -}; - -// Gem-graph modes -enum -{ - HOME_MODE, - RUN_MODE, - EDIT_MODE, - PRESENTATION_MODE, - - N_MODE -}; /* - * Structure describing an arrow - */ -struct arrow_t { - uint load; - uint site; - uint x; - uint y; - uint z; -}; - -/* - * Read a file from filename into a provided buffer + * char *read_file(char *filename) reads a file from filename into a provided buffer * * @param filename, file name * contents, target ptr @@ -124,17 +89,3 @@ static inline char *read_file(char *filename) return contents; } -/* I'm standing on Earth (any planet or star or spinning spheroid, in fact) - * and looking towards its North pole - * - * X - X = EAST - WEST = rouge - cyan - * Y - Y = ZENITH - NADIR = vert - magenta - * Z - Z = NORTH - SOUTH = bleu - jaune - */ - -#define EAST 0 // + x rouge -#define WEST 1 // - x cyan -#define ZENITH 2 // + y vert -#define NADIR 3 // - y magenta -#define SOUTH 4 // + z bleu -#define NORTH 5 // - z jaune diff --git a/include/ui.h b/include/ui.h index a4dfd27..51bb530 100644 --- a/include/ui.h +++ b/include/ui.h @@ -250,5 +250,7 @@ void ui_shutdown_all_graphic_stacks(void); */ bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value); + + // XXX void ui_create_tree (GtkWidget *target_widget); diff --git a/src/ui/events.c b/src/ui/events.c index 7c87b38..d4c2724 100644 --- a/src/ui/events.c +++ b/src/ui/events.c @@ -115,7 +115,7 @@ void on_togglesidebar_action(GSimpleAction *action, g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self)); - printf("events on_togglesidebar_action() <><><>\n"); + printf("events on_togglesidebar_action() ------\n"); ui_toggle_sidebar(); } diff --git a/src/ui/window.c b/src/ui/window.c index f4c77ff..9dbb886 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -228,11 +228,11 @@ void ui_toggle_sidebar(void) if (position != 0) { gtk_paned_set_position (window->main_paned, 0); - printf("window ui_togglesidebar() >|=|<\n"); + printf("window ui_togglesidebar() ->||<-\n"); gtk_button_set_icon_name (GTK_BUTTON (window->main_button_sidebar), "document-edit-symbolic"); } else { gtk_paned_set_position (window->main_paned, 400); - printf("window ui_togglesidebar() <|=|>\n"); + printf("window ui_togglesidebar() <|==|>\n"); gtk_button_set_icon_name (GTK_BUTTON (window->main_button_sidebar), "system-run-symbolic"); } }