WIP: cleaning...

This commit is contained in:
Jean Sirmai 2024-05-29 16:14:41 +02:00
parent 9289de32f8
commit b78f51c58f
Signed by: jean
GPG Key ID: FB3115C340E057E3
5 changed files with 21 additions and 67 deletions

View File

@ -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 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 CSS
--- ---

View File

@ -22,18 +22,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/******************************************************************************/
/* */
/* 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 #pragma once
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
@ -49,49 +37,26 @@
#include <glib-2.0/glib.h> #include <glib-2.0/glib.h>
//#define G_APPLICATION_DEFAULT_FLAGS 0 //#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 /* I'm standing on Earth (or any spinning spheroid) and looking towards its North pole, then :
#define H 960 X - X = EAST - WEST = rouge - cyan
#define W_IMAGE W - 320 Y - Y = ZENITH - NADIR = vert - magenta (fuschia)
#define H_IMAGE H - 126 Z - Z = NORTH - SOUTH = bleu - jaune */
#define H_STYLES_PANE 30
#define W_IMAGE_LOCAL W / 16
#define H_IMAGE_LOCAL H / 16
// Graphical axis #define EAST 0 // + x rouge
enum #define WEST 1 // - x cyan
{ #define ZENITH 2 // + y vert
X_AXIS, #define NADIR 3 // - y magenta
Y_AXIS, #define SOUTH 4 // + z bleu
Z_AXIS, #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 * char *read_file(char *filename) reads a file from filename into a provided buffer
*/
struct arrow_t {
uint load;
uint site;
uint x;
uint y;
uint z;
};
/*
* Read a file from filename into a provided buffer
* *
* @param filename, file name * @param filename, file name
* contents, target ptr * contents, target ptr
@ -124,17 +89,3 @@ static inline char *read_file(char *filename)
return contents; 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

View File

@ -250,5 +250,7 @@ void ui_shutdown_all_graphic_stacks(void);
*/ */
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value); bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value);
// XXX // XXX
void ui_create_tree (GtkWidget *target_widget); void ui_create_tree (GtkWidget *target_widget);

View File

@ -115,7 +115,7 @@ void on_togglesidebar_action(GSimpleAction *action,
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self)); g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
printf("events on_togglesidebar_action() <><><>\n"); printf("events on_togglesidebar_action() ------\n");
ui_toggle_sidebar(); ui_toggle_sidebar();
} }

View File

@ -228,11 +228,11 @@ void ui_toggle_sidebar(void)
if (position != 0) { if (position != 0) {
gtk_paned_set_position (window->main_paned, 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"); gtk_button_set_icon_name (GTK_BUTTON (window->main_button_sidebar), "document-edit-symbolic");
} else { } else {
gtk_paned_set_position (window->main_paned, 400); 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"); gtk_button_set_icon_name (GTK_BUTTON (window->main_button_sidebar), "system-run-symbolic");
} }
} }