diff --git a/src/automaton.c b/src/automat.c similarity index 100% rename from src/automaton.c rename to src/automat.c diff --git a/src/callbacks.c b/src/callbacks.c index 672cecd..5a42ab8 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -135,7 +135,7 @@ gboolean on_glarea_render(GtkGLArea *area, return false; } - if (ui_render_stack(gtk_widget_get_parent(GTK_WIDGET(area))) == false) { + if (graphics_render_stack(gtk_widget_get_parent(GTK_WIDGET(area))) == false) { on_auto_notification("Failed to render corresponding graphic stack !"); return false; } @@ -159,7 +159,7 @@ void on_glarea_realize(GtkWidget *widget) } // Link graphical stack to widget - if (ui_init_graphic_stack(gtk_widget_get_parent(widget), + if (graphics_init_graphic_stack(gtk_widget_get_parent(widget), internal_error) == false) { on_auto_notification( "Failed to link the graphic stack to widgets !"); @@ -184,7 +184,7 @@ void on_glarea_unrealize(GtkWidget *widget) } // Destroy graphic stack - if (ui_shutdown_graphic_stack(gtk_widget_get_parent(widget), + if (graphics_shutdown_graphic_stack(gtk_widget_get_parent(widget), internal_error) == false) { on_auto_notification( "Failed to shutdown the graphic stack !"); @@ -206,7 +206,7 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data) g_assert(axis >= 0 && axis < N_AXIS); /* Update the rotation angle */ - ui_update_axis_stack(container_widget, + graphics_update_axis_stack(container_widget, axis, gtk_adjustment_get_value(adjustment)); diff --git a/src/draw.c b/src/graphics/draw.c similarity index 99% rename from src/draw.c rename to src/graphics/draw.c index a0d5637..f9e3589 100644 --- a/src/draw.c +++ b/src/graphics/draw.c @@ -28,8 +28,8 @@ #include -#include "../include/base.h" -#include "../include/graphics.h" +#include "../../include/base.h" +#include "../../include/graphics.h" /* * Writes values to describe a vertex at (x,y,z) intoq the vertex buffer diff --git a/src/graph_area.c b/src/graphics/graph_area.c similarity index 86% rename from src/graph_area.c rename to src/graphics/graph_area.c index db6720f..e7b3b3b 100644 --- a/src/graph_area.c +++ b/src/graphics/graph_area.c @@ -25,8 +25,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/graphics.h" -#include "../include/callbacks.h" +#include "../../include/graphics.h" +#include "../../include/callbacks.h" struct stack_index_t { long stack_id; @@ -62,7 +62,7 @@ int set_arrow (int stack_id, // 2024-06-27 DEBUG ! * * @returns stack_id */ -long ui_get_graphic_stack(void *container_widget) +long graphics_get_graphic_stack(void *container_widget) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -80,7 +80,7 @@ long ui_get_graphic_stack(void *container_widget) * * @returns stack_id */ -long ui_is_graphic_stack_ready(void *container_widget) +long graphics_is_graphic_stack_ready(void *container_widget) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -98,20 +98,20 @@ long ui_is_graphic_stack_ready(void *container_widget) * * @returns bool, true if success */ -bool ui_init_graphic_stack(void *container_widget, GError *error_buffer) +bool graphics_init_graphic_stack(void *container_widget, GError *error_buffer) { - g_printerr("[debug] ui_init_graphic_stack()\n"); + g_printerr("[debug] graphics_init_graphic_stack()\n"); - g_printerr("[debug] ui_init_graphic_stack() : target is %p\n", container_widget); + g_printerr("[debug] graphics_init_graphic_stack() : target is %p\n", container_widget); // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { - g_printerr("[debug] ui_init_graphic_stack() : i is %d\n", i); - g_printerr("[debug] ui_init_graphic_stack() : target would be %p\n", + g_printerr("[debug] graphics_init_graphic_stack() : i is %d\n", i); + g_printerr("[debug] graphics_init_graphic_stack() : target would be %p\n", stack_index[i].container_widget); if (stack_index[i].container_widget == (void *)container_widget) { stack_index[i].stack_id = graphics_init(&error_buffer); - g_printerr("[debug] ui_init_graphic_stack() : stack_id is %ld\n", + g_printerr("[debug] graphics_init_graphic_stack() : stack_id is %ld\n", stack_index[i].stack_id); if (stack_index[i].stack_id >= 0) return true; @@ -129,7 +129,7 @@ bool ui_init_graphic_stack(void *container_widget, GError *error_buffer) * * @returns bool, true if success */ -bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer) +bool graphics_shutdown_graphic_stack(void *container_widget, GError *error_buffer) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -146,7 +146,7 @@ bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer) } -void ui_clean_stack_index(void) +void graphics_clean_stack_index(void) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -162,7 +162,7 @@ void ui_clean_stack_index(void) * * @returns bool, true if success */ -bool ui_render_stack(GtkWidget *container_widget) +bool graphics_render_stack(GtkWidget *container_widget) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -183,7 +183,7 @@ bool ui_render_stack(GtkWidget *container_widget) * * @returns bool, true if success */ -bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value) +bool graphics_update_axis_stack(GtkWidget *container_widget, int axis, int value) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -203,7 +203,7 @@ bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value) * * @returns bool, true if success */ -void ui_shutdown_all_graphic_stacks(void) +void graphics_shutdown_all_graphic_stacks(void) { // look for stack_index entry for (int i = 0; i < stack_index_size; i++) { @@ -263,20 +263,20 @@ GtkWidget *create_axis_slider(int axis) /* * Creates GLArea and indexes it * - * @params target_mode, meaning which ui_stack we're on + * @params target_mode, meaning which graphics_stack we're on * target_widget, meaning the box that will host the GLArea * * @returns bool, true if success */ -bool ui_setup_glarea(int target_mode, GtkWidget *target_widget) +bool graphics_setup_glarea(int target_mode, GtkWidget *target_widget) { GtkWidget *gl_area; - g_printerr("[debug] ui_setup_glarea()\n"); + g_printerr("[debug] graphics_setup_glarea()\n"); assert(target_widget); - g_printerr("[debug] ui_setup_glarea() : target is %p\n", target_widget); + g_printerr("[debug] graphics_setup_glarea() : target is %p\n", target_widget); if (stack_index == NULL) { stack_index = g_malloc(sizeof(struct stack_index_t)); @@ -314,9 +314,9 @@ bool ui_setup_glarea(int target_mode, GtkWidget *target_widget) stack_index[stack_index_size-1].gl_area = (void*)gl_area; - g_printerr("[debug] ui_setup_glarea() : set target to %p\n", target_widget); + g_printerr("[debug] graphics_setup_glarea() : set target to %p\n", target_widget); - g_printerr("[debug] ui_setup_glarea() : stack_index (@0x%p) had %ld elements\n", + g_printerr("[debug] graphics_setup_glarea() : stack_index (@0x%p) had %ld elements\n", stack_index, stack_index_size); diff --git a/src/graph_stack.c b/src/graphics/graph_stack.c similarity index 99% rename from src/graph_stack.c rename to src/graphics/graph_stack.c index 627af4c..b404fb2 100644 --- a/src/graph_stack.c +++ b/src/graphics/graph_stack.c @@ -26,8 +26,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/graphics.h" -#include "../include/parsing.h" +#include "../../include/graphics.h" +#include "../../include/parsing.h" #define TEST 0 diff --git a/src/grid.c b/src/graphics/grid.c similarity index 99% rename from src/grid.c rename to src/graphics/grid.c index 7866d6e..8549668 100644 --- a/src/grid.c +++ b/src/graphics/grid.c @@ -26,7 +26,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/graphics.h" +#include "../../include/graphics.h" int draw_space_ridges_vertex (const int stack_id, long offset_vertex, diff --git a/src/init.c b/src/graphics/init.c similarity index 99% rename from src/init.c rename to src/graphics/init.c index 42c1650..233ddf8 100644 --- a/src/init.c +++ b/src/graphics/init.c @@ -28,7 +28,7 @@ /* -------------------------------------------------------------------------- */ -#include "../include/graphics.h" +#include "../../include/graphics.h" /* Initializes the buffer of a gl_area * Calls according to the user preferences diff --git a/src/shader.frag b/src/graphics/shader.frag similarity index 100% rename from src/shader.frag rename to src/graphics/shader.frag diff --git a/src/shader.vert b/src/graphics/shader.vert similarity index 100% rename from src/shader.vert rename to src/graphics/shader.vert diff --git a/src/dialog.c b/src/widgets/dialog.c similarity index 99% rename from src/dialog.c rename to src/widgets/dialog.c index 27e2226..e5f0589 100644 --- a/src/dialog.c +++ b/src/widgets/dialog.c @@ -25,7 +25,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/callbacks.h" +#include "../../include/callbacks.h" void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){ char *title = " Save the current model before modifying it? "; diff --git a/src/tree_lab.c b/src/widgets/tree_lab.c similarity index 98% rename from src/tree_lab.c rename to src/widgets/tree_lab.c index b7a25bc..583e33f 100644 --- a/src/tree_lab.c +++ b/src/widgets/tree_lab.c @@ -28,8 +28,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/callbacks.h" -#include "../include/widgets.h" +#include "../../include/callbacks.h" +#include "../../include/widgets.h" // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery // https://docs.gtk.org/gtk4/section-text-widget.html diff --git a/src/wdgt_lab_I b/src/widgets/wdgt_lab_I similarity index 98% rename from src/wdgt_lab_I rename to src/widgets/wdgt_lab_I index 28023fd..d5d702c 100644 --- a/src/wdgt_lab_I +++ b/src/widgets/wdgt_lab_I @@ -27,7 +27,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/widgets.h" +#include "../../include/widgets.h" // https://blog.gtk.org/2020/09/08/on-list-models/ < TODO // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery diff --git a/src/wdgt_lab_II.c b/src/widgets/wdgt_lab_II.c similarity index 99% rename from src/wdgt_lab_II.c rename to src/widgets/wdgt_lab_II.c index 22055cb..8824b16 100644 --- a/src/wdgt_lab_II.c +++ b/src/widgets/wdgt_lab_II.c @@ -27,7 +27,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/widgets.h" +#include "../../include/widgets.h" // https://blog.gtk.org/2020/09/08/on-list-models/ < TODO // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery diff --git a/src/widgets.c b/src/widgets/widgets.c similarity index 99% rename from src/widgets.c rename to src/widgets/widgets.c index f8c72b5..d761325 100644 --- a/src/widgets.c +++ b/src/widgets/widgets.c @@ -26,9 +26,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../include/base.h" -#include "../include/callbacks.h" -#include "../include/widgets.h" +#include "../../include/base.h" +#include "../../include/callbacks.h" +#include "../../include/widgets.h" #define W 1920 // TODO 2024-06-30 #define H 960 // Ad hoc (pour mon écran)