diff --git a/base.h b/base.h index 94ea964..365d60f 100644 --- a/base.h +++ b/base.h @@ -37,10 +37,10 @@ #include //#define G_APPLICATION_DEFAULT_FLAGS 0 -enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; // Graphical axis +enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; // < used by : graph_area.h 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); +static inline char *read_file(char *filename); // < used by : init.c /* I'm standing on Earth (or any spinning spheroid) and looking towards its North pole, then : X - X = EAST - WEST = rouge - cyan diff --git a/callback.d b/callback.d new file mode 100644 index 0000000..99127b3 --- /dev/null +++ b/callback.d @@ -0,0 +1,3 @@ +callback.o: callback.c tree.h \ + /gnu/store/hsby4biv4wjywr7slvjf0ykk1xzf31xb-glib-2.78.0/include/glib-2.0/glib.h \ + display.h contain.h texts.h in_depth.h diff --git a/callback.o b/callback.o new file mode 100644 index 0000000..11aea68 Binary files /dev/null and b/callback.o differ diff --git a/contain.c b/contain.c index dfbbb1c..4278d85 100644 --- a/contain.c +++ b/contain.c @@ -150,6 +150,79 @@ GtkWidget *get_run_space_page_new(){ return GTK_WIDGET (page_box); } +static void icons_for_fun (GtkHeaderBar *header_bar); + +void window_header_bar (GtkWindow *window, char *title){ + GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ()); + gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title)); + +// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START +// gtk_window_controls_set_decoration_layout (GTK_WINDOW_CONTROLS(my_window_controls), NULL); // const char* layout); + + GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_toggle_button_new ()); + gtk_button_set_icon_name (run_stop_model_exec, "system-shutdown-symbolic"); + gtk_button_set_icon_name (run_stop_model_exec, "media-playback-pause-symbolic"); + gtk_button_set_icon_name (run_stop_model_exec, "media-playback-start-symbolic"); + g_signal_connect (run_stop_model_exec, "clicked", G_CALLBACK (ui_toggle_model_exec), NULL); + + GtkButton *exec_xor_edit = GTK_BUTTON (gtk_toggle_button_new ()); +// gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); +// g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_run_edit), NULL); + gtk_button_set_icon_name (exec_xor_edit, "document-edit-symbolic"); + gtk_button_set_icon_name (exec_xor_edit, "text-editor-symbolic"); + gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); + g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_exec_edit), run_stop_model_exec); + + gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit)); + gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (run_stop_model_exec)); + gtk_window_set_titlebar (window, header_bar); + + icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme +} + +void two_notebooks_in_two_panes (GtkWindow *window) { + GtkNotebook *run_notebook = GTK_NOTEBOOK(gtk_notebook_new()); + gtk_notebook_set_tab_pos (GTK_NOTEBOOK(run_notebook), GTK_POS_TOP); // GTK_POS_LEFT + + gtk_notebook_append_page (run_notebook, get_run_space_page_new(), gtk_label_new ("space")); + gtk_notebook_append_page (run_notebook, get_run_rules_page_new(), gtk_label_new ("rules")); + gtk_notebook_append_page (run_notebook, get_run_measures_page_new(),gtk_label_new ("measures")); + gtk_notebook_append_page (run_notebook, get_run_results_page_new(), gtk_label_new ("results")); + gtk_notebook_append_page (run_notebook, get_run_discuss_page_new(), gtk_label_new ("interpret")); + gtk_notebook_append_page (run_notebook, get_run_help_page_new(), gtk_label_new ("help")); + + GtkNotebook *edit_notebook = GTK_NOTEBOOK(gtk_notebook_new()); + gtk_notebook_set_tab_pos (GTK_NOTEBOOK(edit_notebook), GTK_POS_TOP); // GTK_POS_RIGHT + + gtk_notebook_append_page (edit_notebook, get_edit_space_page_new(), gtk_label_new ("space")); + gtk_notebook_append_page (edit_notebook, get_edit_rules_page_new(), gtk_label_new ("rules")); + gtk_notebook_append_page (edit_notebook, get_edit_measures_page_new(),gtk_label_new ("measures")); + gtk_notebook_append_page (edit_notebook, get_edit_results_page_new(), gtk_label_new ("results")); + gtk_notebook_append_page (edit_notebook, get_edit_discuss_page_new(), gtk_label_new ("interpret")); + gtk_notebook_append_page (edit_notebook, get_edit_help_page_new(), gtk_label_new ("help")); + + GtkWidget *exec_xor_edit_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); + gtk_widget_set_size_request (exec_xor_edit_horizontal_pane, 0, 0); + gtk_paned_set_start_child (GTK_PANED(exec_xor_edit_horizontal_pane), GTK_WIDGET (run_notebook)); + gtk_paned_set_end_child (GTK_PANED(exec_xor_edit_horizontal_pane), GTK_WIDGET (edit_notebook)); + gtk_paned_set_position (GTK_PANED (exec_xor_edit_horizontal_pane), W_IMAGE + 350); // '350' : AD HOC + gtk_window_set_child (window, GTK_WIDGET(exec_xor_edit_horizontal_pane)); + + gtk_notebook_set_current_page (run_notebook, 0); // @see hot.c 2024-05-11 (line 68) + gtk_notebook_set_current_page (edit_notebook, 1); // @see hot.c 2024-05-11 (line 68) +} + + + + + + + + + + + + static void icons_for_fun (GtkHeaderBar *header_bar) { GtkButton *go_home = GTK_BUTTON (gtk_button_new ()); @@ -220,65 +293,3 @@ static void icons_for_fun (GtkHeaderBar *header_bar) gtk_button_set_icon_name (power_low, "power-profile-power-saver-symbolic"); gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_low)); } - -void window_header_bar (GtkWindow *window, char *title){ - GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ()); - gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title)); - -// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START -// gtk_window_controls_set_decoration_layout (GTK_WINDOW_CONTROLS(my_window_controls), NULL); // const char* layout); - - GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_toggle_button_new ()); - gtk_button_set_icon_name (run_stop_model_exec, "system-shutdown-symbolic"); - gtk_button_set_icon_name (run_stop_model_exec, "media-playback-pause-symbolic"); - gtk_button_set_icon_name (run_stop_model_exec, "media-playback-start-symbolic"); - g_signal_connect (run_stop_model_exec, "clicked", G_CALLBACK (ui_toggle_model_exec), NULL); - - GtkButton *exec_xor_edit = GTK_BUTTON (gtk_toggle_button_new ()); -// gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); -// g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_run_edit), NULL); - gtk_button_set_icon_name (exec_xor_edit, "document-edit-symbolic"); - gtk_button_set_icon_name (exec_xor_edit, "text-editor-symbolic"); - gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); - g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_exec_edit), run_stop_model_exec); - - gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit)); - gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (run_stop_model_exec)); - gtk_window_set_titlebar (window, header_bar); - - icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme -} - -void two_notebooks_in_two_panes (GtkWindow *window) { - GtkNotebook *run_notebook = GTK_NOTEBOOK(gtk_notebook_new()); - gtk_notebook_set_tab_pos (GTK_NOTEBOOK(run_notebook), GTK_POS_TOP); // GTK_POS_LEFT - - gtk_notebook_append_page (run_notebook, get_run_space_page_new(), gtk_label_new ("space")); - gtk_notebook_append_page (run_notebook, get_run_rules_page_new(), gtk_label_new ("rules")); - gtk_notebook_append_page (run_notebook, get_run_measures_page_new(),gtk_label_new ("measures")); - gtk_notebook_append_page (run_notebook, get_run_results_page_new(), gtk_label_new ("results")); - gtk_notebook_append_page (run_notebook, get_run_discuss_page_new(), gtk_label_new ("interpret")); - gtk_notebook_append_page (run_notebook, get_run_help_page_new(), gtk_label_new ("help")); - - GtkNotebook *edit_notebook = GTK_NOTEBOOK(gtk_notebook_new()); - gtk_notebook_set_tab_pos (GTK_NOTEBOOK(edit_notebook), GTK_POS_TOP); // GTK_POS_RIGHT - - gtk_notebook_append_page (edit_notebook, get_edit_space_page_new(), gtk_label_new ("space")); - gtk_notebook_append_page (edit_notebook, get_edit_rules_page_new(), gtk_label_new ("rules")); - gtk_notebook_append_page (edit_notebook, get_edit_measures_page_new(),gtk_label_new ("measures")); - gtk_notebook_append_page (edit_notebook, get_edit_results_page_new(), gtk_label_new ("results")); - gtk_notebook_append_page (edit_notebook, get_edit_discuss_page_new(), gtk_label_new ("interpret")); - gtk_notebook_append_page (edit_notebook, get_edit_help_page_new(), gtk_label_new ("help")); - - GtkWidget *exec_xor_edit_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); - gtk_widget_set_size_request (exec_xor_edit_horizontal_pane, 0, 0); - gtk_paned_set_start_child (GTK_PANED(exec_xor_edit_horizontal_pane), GTK_WIDGET (run_notebook)); - gtk_paned_set_end_child (GTK_PANED(exec_xor_edit_horizontal_pane), GTK_WIDGET (edit_notebook)); - gtk_paned_set_position (GTK_PANED (exec_xor_edit_horizontal_pane), W_IMAGE + 350); // '350' : AD HOC - gtk_window_set_child (window, GTK_WIDGET(exec_xor_edit_horizontal_pane)); - - gtk_notebook_set_current_page (run_notebook, 0); // @see hot.c 2024-05-11 (line 68) - gtk_notebook_set_current_page (edit_notebook, 1); // @see hot.c 2024-05-11 (line 68) -} - - diff --git a/contain.d b/contain.d new file mode 100644 index 0000000..6020cab --- /dev/null +++ b/contain.d @@ -0,0 +1,3 @@ +contain.o: contain.c tree.h \ + /gnu/store/hsby4biv4wjywr7slvjf0ykk1xzf31xb-glib-2.78.0/include/glib-2.0/glib.h \ + display.h contain.h texts.h callback.h diff --git a/contain.o b/contain.o new file mode 100644 index 0000000..bdddc98 Binary files /dev/null and b/contain.o differ diff --git a/display.d b/display.d new file mode 100644 index 0000000..a6e3b45 --- /dev/null +++ b/display.d @@ -0,0 +1,3 @@ +display.o: display.c tree.h \ + /gnu/store/hsby4biv4wjywr7slvjf0ykk1xzf31xb-glib-2.78.0/include/glib-2.0/glib.h \ + display.h contain.h texts.h diff --git a/display.o b/display.o new file mode 100644 index 0000000..f165c77 Binary files /dev/null and b/display.o differ diff --git a/graph_area.c b/graph_area.c index 6672191..0ddd790 100644 --- a/graph_area.c +++ b/graph_area.c @@ -25,7 +25,6 @@ #include #include -#include "base.h" #include "contain.h" #include "graph_area.h" diff --git a/graph_area.d b/graph_area.d new file mode 100644 index 0000000..7d9ddde --- /dev/null +++ b/graph_area.d @@ -0,0 +1,6 @@ +graph_area.o: graph_area.c \ + /gnu/store/hsby4biv4wjywr7slvjf0ykk1xzf31xb-glib-2.78.0/include/glib-2.0/glib.h \ + contain.h graph_area.h \ + /gnu/store/0gxl8awg16qysdmxsflwnz0gyynrgs99-mesa-24.0.4/include/GL/glext.h \ + /gnu/store/0gxl8awg16qysdmxsflwnz0gyynrgs99-mesa-24.0.4/include/KHR/khrplatform.h \ + base.h diff --git a/graph_area.h b/graph_area.h index 9324857..5ae983e 100644 --- a/graph_area.h +++ b/graph_area.h @@ -24,7 +24,6 @@ */ #pragma once -#include "base.h" #include #include #include @@ -32,6 +31,8 @@ #include #include +#include "base.h" + #define VERTEX_SHADER_FILE "src/graphics/shaders/shader.vert" #define FRAG_SHADER_FILE "src/graphics/shaders/shader.frag" #define GL_TARGET_MAJOR_VERSION 0 diff --git a/graph_area.o b/graph_area.o new file mode 100644 index 0000000..8a6155c Binary files /dev/null and b/graph_area.o differ diff --git a/graph_stack.c.todo b/graph_stack.c.todo index 55f5db2..6eff40d 100644 --- a/graph_stack.c.todo +++ b/graph_stack.c.todo @@ -25,9 +25,8 @@ #include #include -#include "base.h" + #include "contain.h" -//#include "parsing.h" #include "graph_area.h" #define TEST 0 diff --git a/in_depth.d b/in_depth.d new file mode 100644 index 0000000..cced342 --- /dev/null +++ b/in_depth.d @@ -0,0 +1 @@ +in_depth.o: in_depth.c callback.h diff --git a/in_depth.o b/in_depth.o new file mode 100644 index 0000000..d78f4ff Binary files /dev/null and b/in_depth.o differ diff --git a/main.d b/main.d new file mode 100644 index 0000000..6c89c45 --- /dev/null +++ b/main.d @@ -0,0 +1 @@ +main.o: main.c callback.h diff --git a/main.o b/main.o new file mode 100644 index 0000000..396a812 Binary files /dev/null and b/main.o differ diff --git a/myprogram b/myprogram new file mode 100755 index 0000000..cd64331 Binary files /dev/null and b/myprogram differ diff --git a/parsing.c.todo b/parsing.c.todo index 4879b66..8e2c97f 100644 --- a/parsing.c.todo +++ b/parsing.c.todo @@ -33,8 +33,6 @@ #include // http://xmlsoft.org/examples/#parse1.c // https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/general.html -#include "base.h" - #define READ_SITE 1 << 0 #define READ_WEIGHT 1 << 1 #define READ_X 1 << 2 diff --git a/parsing.h.todo b/parsing.h.todo index 2c9c484..307e723 100644 --- a/parsing.h.todo +++ b/parsing.h.todo @@ -25,8 +25,6 @@ #pragma once #include -#include "base.h" - bool model_init(const char *content, size_t length, const char *basename); bool model_shutdown(void); diff --git a/texts.d b/texts.d new file mode 100644 index 0000000..18de62c --- /dev/null +++ b/texts.d @@ -0,0 +1 @@ +texts.o: texts.c diff --git a/texts.o b/texts.o new file mode 100644 index 0000000..8ea2834 Binary files /dev/null and b/texts.o differ diff --git a/tree.d b/tree.d new file mode 100644 index 0000000..dccd5fb --- /dev/null +++ b/tree.d @@ -0,0 +1 @@ +tree.o: tree.c contain.h texts.h callback.h diff --git a/tree.o b/tree.o new file mode 100644 index 0000000..4c14a06 Binary files /dev/null and b/tree.o differ