diff --git a/data/image/xyz icon.png b/data/image/xyz icon.png new file mode 100644 index 0000000..83739eb Binary files /dev/null and b/data/image/xyz icon.png differ diff --git a/data/stamp/balance icon.png b/data/stamp/balance icon.png new file mode 100644 index 0000000..b2f2d97 Binary files /dev/null and b/data/stamp/balance icon.png differ diff --git a/data/stamp/camera icon.png b/data/stamp/camera icon.png new file mode 100644 index 0000000..9e961b2 Binary files /dev/null and b/data/stamp/camera icon.png differ diff --git a/data/stamp/diameter icon.png b/data/stamp/diameter icon.png new file mode 100644 index 0000000..2c29801 Binary files /dev/null and b/data/stamp/diameter icon.png differ diff --git a/data/stamp/measure balance science icon.png b/data/stamp/measure balance science icon.png new file mode 100644 index 0000000..0967811 Binary files /dev/null and b/data/stamp/measure balance science icon.png differ diff --git a/data/stamp/measure caliper icon.png b/data/stamp/measure caliper icon.png new file mode 100644 index 0000000..95d5f20 Binary files /dev/null and b/data/stamp/measure caliper icon.png differ diff --git a/data/stamp/measure centimeter icon.png b/data/stamp/measure centimeter icon.png new file mode 100644 index 0000000..09ded99 Binary files /dev/null and b/data/stamp/measure centimeter icon.png differ diff --git a/data/stamp/measure compass icon.png b/data/stamp/measure compass icon.png new file mode 100644 index 0000000..9d58108 Binary files /dev/null and b/data/stamp/measure compass icon.png differ diff --git a/data/stamp/measure pressure icon.png b/data/stamp/measure pressure icon.png new file mode 100644 index 0000000..925063a Binary files /dev/null and b/data/stamp/measure pressure icon.png differ diff --git a/data/stamp/measure size (height) icon.png b/data/stamp/measure size (height) icon.png new file mode 100644 index 0000000..38c21ef Binary files /dev/null and b/data/stamp/measure size (height) icon.png differ diff --git a/data/stamp/measure size icon.png b/data/stamp/measure size icon.png new file mode 100644 index 0000000..26eb371 Binary files /dev/null and b/data/stamp/measure size icon.png differ diff --git a/data/stamp/measure sizes icon.png b/data/stamp/measure sizes icon.png new file mode 100644 index 0000000..e86e2b0 Binary files /dev/null and b/data/stamp/measure sizes icon.png differ diff --git a/data/stamp/measure temperature icon.png b/data/stamp/measure temperature icon.png new file mode 100644 index 0000000..8e15ecb Binary files /dev/null and b/data/stamp/measure temperature icon.png differ diff --git a/data/stamp/measure time icon.png b/data/stamp/measure time icon.png new file mode 100644 index 0000000..c1ea731 Binary files /dev/null and b/data/stamp/measure time icon.png differ diff --git a/data/stamp/measure tool scale icon.png b/data/stamp/measure tool scale icon.png new file mode 100644 index 0000000..b23c9aa Binary files /dev/null and b/data/stamp/measure tool scale icon.png differ diff --git a/data/stamp/mesure diameter icon.png b/data/stamp/mesure diameter icon.png new file mode 100644 index 0000000..9d13982 Binary files /dev/null and b/data/stamp/mesure diameter icon.png differ diff --git a/include/signal.h b/include/signal.h index 6a2c9b8..1ab4fd8 100644 --- a/include/signal.h +++ b/include/signal.h @@ -121,7 +121,7 @@ void on_axis_value_change (GtkAdjustment *adjustment, gpointer data); void on_clicked_home (GtkWidget *btt_reset, gpointer data); void on_clicked_search (GtkWidget *btt_menu, gpointer list_box); - +void on_clicked_measure (GtkWidget *btt_measure, gpointer data); /******************************************************************************/ diff --git a/include/widget.h b/include/widget.h index d65dd7d..b836d95 100644 --- a/include/widget.h +++ b/include/widget.h @@ -41,17 +41,6 @@ #define H_TEXT_WINDOW H_MY_SCREEN -// called in widget / dispatch.c / on_windows_activation() -// defined in widget / topbar / dispatch.c -// - widget / topbar / dialog.c -// - widget / topbar / polytext.c -// after gtk_application_window_new (app) x 3 - -void widget_design_main_window (GtkWindow *main_window); -void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window); -void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window); - - // called in signal.c / switch_state_rules_data() / gtk_window_set_child() // defined in widget / dispatch.c @@ -60,6 +49,17 @@ void *widget_get_dialog_window(); void *widget_get_text_window(); +// called in widget / dispatch.c / on_windows_activation() +// defined in widget / topbar / dispatch.c +// - widget / topbar / dialog.c +// - widget / topbar / polytext.c +// (after gtk_application_window_new (app) x 3) + +void widget_design_main_window (GtkWindow *main_window); +void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window); +void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window); + + /******************************************************************************/ /* W I D G E T S */ /******************************************************************************/ @@ -98,12 +98,14 @@ void window_design_header_bar_right (GtkWidget *header_bar); // defined in widget / synth / dispatch.c // - widget / state / dispatch.c // - widget / rules / dispatch.c -// - widget / data / dispatch.c +// - widget / data / dispatch.c +// - widget / measure / dispatch.c void *widget_get_synth_page(); // in : widget / synth / dispatch.c void *widget_get_state_page(); // in : widget / state / dispatch.c void *widget_get_rules_page(); // in : widget / rules / dispatch.c -void *widget_get_data_page(); // in : widget / data / dispatch.c +void *widget_get_data_page(); // in : widget / data / dispatch.c +void *widget_get_measure_page();// in : widget / measure / dispatch.c /******************************************************************************/ @@ -243,3 +245,11 @@ void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_ /* M E N U */ /******************************************************************************/ + +/******************************************************************************/ +/* M E A S U R E S */ +/******************************************************************************/ +// called by : signal.c +// defined in : widget / measure / dispatch.c + +void *widget_measure_new (); diff --git a/src/signal.c b/src/signal.c index efac802..5df0780 100644 --- a/src/signal.c +++ b/src/signal.c @@ -359,3 +359,13 @@ void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrol } + +/******************************************************************************/ +/* M E A S U R E S */ +/******************************************************************************/ + +void on_clicked_measure (GtkWidget *btt_measure, gpointer data) +{ + gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), + GTK_WIDGET (widget_get_measure_page())); +} diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c new file mode 100644 index 0000000..355127a --- /dev/null +++ b/src/widget/measure/dispatch.c @@ -0,0 +1,74 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* Gem-graph client * +* * +* Windows && Headers * +* * +* Copyright © 2021 Libre en Communs * +* Copyright © 2021 Adrien Bourmault * +* Copyright © 2021 Jean Sirmai * +* * +* 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 . * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +#include "../../../include/base.h" +#include "../../../include/signal.h" +#include "../../../include/widget.h" + + +/******************************************************************************/ +/* M E A S U R E S */ +/******************************************************************************/ + +#define PARTITION_MEASURE 500 + +void *widget_measure_new () +{ + printf("on_clicked_measure() >> dispatch.c / widget_measure_new()\n"); + GtkBox *results_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); + gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename + ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure caliper icon.png"))); + return results_box; +} + +void *widget_measure_II () +{ + printf("on_clicked_measure() >> dispatch.c / widget_measure_II()\n"); + GtkBox *measure_II_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); + gtk_box_append (measure_II_box, GTK_WIDGET (gtk_picture_new_for_filename + ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure pressure icon.png"))); + return measure_II_box; +} + +void *widget_get_measure_page() +{ + printf("dispatch.c / widget_measure_new() >> dispatch.c / widget_get_measure_page()\n"); + GtkWidget *anything = gtk_paned_new (GTK_ORIENTATION_VERTICAL); + gtk_paned_set_start_child (GTK_PANED (anything), + GTK_WIDGET (widget_measure_new())); + gtk_paned_set_end_child (GTK_PANED (anything), + GTK_WIDGET (widget_measure_II())); + gtk_paned_set_position (GTK_PANED (anything), PARTITION_MEASURE); + gtk_paned_set_shrink_start_child (GTK_PANED (anything), FALSE); + gtk_paned_set_shrink_end_child (GTK_PANED (anything), FALSE); + gtk_widget_set_size_request (anything, 0, H_MY_SCREEN); // OK (required)) + + return anything; +} diff --git a/src/widget/state/middle.c b/src/widget/state/middle.c index bd96a8c..5682b9b 100644 --- a/src/widget/state/middle.c +++ b/src/widget/state/middle.c @@ -45,7 +45,7 @@ void widget_state_XYZ_reset_all() gtk_adjustment_set_value (Z_adjust, 0); } -static GtkBox *rec_XYZ_box() +static void *get_XYZ_box() { GtkBox *XYZ_labels_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); // spacing = 2 GtkBox *XYZ_scrollbar_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); @@ -77,13 +77,12 @@ static GtkBox *rec_XYZ_box() return XYZ_labels_box; } -static GtkBox *rec_ZOOM_box() +static void *get_ZOOM_box() { GtkBox *ZOOM_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\ "\n TOOLS\n ---\n zoom\n ---\n space\n struct.\n\ ---\n arrows\n struct.\n ---\n orient\n state\n in space\n")); -// gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 10, 80); gtk_box_append (ZOOM_box, ZOOM_Label); return ZOOM_box; } @@ -100,9 +99,9 @@ void *widget_get_space_view() // TODO replace this image by >> ui_setup_glarea (0, GTK_WIDGET (~)); GtkBox *camera = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); - gtk_box_append (camera, GTK_WIDGET (rec_XYZ_box())); + gtk_box_append (camera, GTK_WIDGET (get_XYZ_box())); gtk_box_append (camera, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (camera, GTK_WIDGET (rec_ZOOM_box())); + gtk_box_append (camera, GTK_WIDGET (get_ZOOM_box())); GtkWidget *view_space_vs_camera = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_set_start_child (GTK_PANED (view_space_vs_camera), GTK_WIDGET (E_coli)); @@ -111,6 +110,11 @@ void *widget_get_space_view() gtk_paned_set_shrink_end_child (GTK_PANED (view_space_vs_camera), FALSE); gtk_paned_set_position (GTK_PANED (view_space_vs_camera), PARTITION_SPACE_VS_CAMERA); +/* GtkBox *un_essai = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6)); + gtk_box_append (GTK_BOX (un_essai), GTK_WIDGET (E_coli)); + gtk_box_append (GTK_BOX (un_essai), GTK_WIDGET (camera)); + + return GTK_WIDGET (un_essai); <<< Ça devrait suffire ? */ return GTK_WIDGET (view_space_vs_camera); } diff --git a/src/widget/synth/dispatch.c b/src/widget/synth/dispatch.c index 8fc5b87..e87a054 100644 --- a/src/widget/synth/dispatch.c +++ b/src/widget/synth/dispatch.c @@ -57,8 +57,8 @@ static void *widget_get_space_vs_non_time_dependent_analysis() gtk_paned_set_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), GTK_WIDGET (widget_get_non_time_dependent_analysis_elements())); gtk_paned_set_position (GTK_PANED (space_vs_non_time_dependent_analysis), PARTITION_SYNTH); - gtk_paned_set_shrink_start_child (GTK_PANED (space_vs_non_time_dependent_analysis), TRUE); - gtk_paned_set_shrink_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), TRUE); + gtk_paned_set_shrink_start_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE); + gtk_paned_set_shrink_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE); // TRUE return space_vs_non_time_dependent_analysis; } diff --git a/src/widget/topbar/dispatch.c b/src/widget/topbar/dispatch.c index 1e251d1..1bb1874 100644 --- a/src/widget/topbar/dispatch.c +++ b/src/widget/topbar/dispatch.c @@ -54,7 +54,7 @@ void widget_design_main_window (GtkWindow *main_window) gtk_check_button_set_active (GTK_CHECK_BUTTON (widget_get_btt_data()), TRUE); gtk_check_button_set_active (GTK_CHECK_BUTTON (widget_get_btt_synth()), TRUE); -// THE LAST ONE IS THE WINNER (AND THE WINNER TAKES IT ALL !...) + // THE LAST ONE IS THE WINNER (AND THE WINNER TAKES IT ALL !...) gtk_window_present (GTK_WINDOW (main_window)); } diff --git a/src/widget/topbar/right.c b/src/widget/topbar/right.c index d460934..3c67806 100644 --- a/src/widget/topbar/right.c +++ b/src/widget/topbar/right.c @@ -54,6 +54,11 @@ void window_design_header_bar_right (GtkWidget *header_bar) g_signal_connect (search, "clicked", G_CALLBACK (on_clicked_search), no_local_data); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (search)); + GtkButton *measure = GTK_BUTTON (gtk_button_new ()); + gtk_button_set_icon_name (measure, "color-select-symbolic"); + g_signal_connect (measure, "clicked", G_CALLBACK (on_clicked_measure), no_local_data); + gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (measure)); +