2024-05-07 20:48:01 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <gtk-4.0/gtk/gtk.h>
|
2024-05-08 07:50:04 +02:00
|
|
|
|
2024-06-02 22:49:16 +02:00
|
|
|
#include "tree.h"
|
2024-05-10 06:19:20 +02:00
|
|
|
#include "display.h"
|
|
|
|
#include "contain.h"
|
2024-05-08 23:43:23 +02:00
|
|
|
#include "texts.h"
|
2024-05-31 23:22:12 +02:00
|
|
|
#include "callback.h"
|
2024-05-07 20:48:01 +02:00
|
|
|
|
2024-06-02 15:49:39 +02:00
|
|
|
// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO
|
|
|
|
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
|
|
|
|
|
|
|
|
|
|
|
//typedef anytype = {(int)(*fnct) {printf("typedef {(int)(*fnct) {printf("");}");} GtkModelFnct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GtkFrame *get_frame_with_label(){ // EN ATTENDANT DE SAVOIR UTILISER : GtkTextTagTable et GtkTextBuffer
|
|
|
|
GtkFrame *space_specif = GTK_FRAME(gtk_frame_new ("Space (run / edit) specifications"));
|
|
|
|
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (get_space_run_edit_specif()));
|
|
|
|
gtk_frame_set_child (GTK_FRAME (space_specif), GTK_WIDGET (any_Label));
|
|
|
|
return space_specif;
|
|
|
|
}
|
2024-05-07 20:48:01 +02:00
|
|
|
|
|
|
|
GtkWidget *get_edit_rules_page_new(){
|
2024-05-11 08:23:14 +02:00
|
|
|
GtkPaned *hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
|
|
|
|
|
|
|
|
GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles");
|
|
|
|
GtkWidget *édition_de_la_règle_sélectionnée = gtk_frame_new ("Édition de la règle sélectionnée");
|
|
|
|
|
|
|
|
gtk_paned_set_start_child (hpaned, GTK_WIDGET (arbre_des_règles));
|
|
|
|
gtk_paned_set_end_child (hpaned, GTK_WIDGET (édition_de_la_règle_sélectionnée));
|
|
|
|
// gtk_widget_set_size_request (GTK_WIDGET (hpaned), W, H);
|
|
|
|
gtk_paned_set_wide_handle (hpaned, TRUE);
|
|
|
|
|
|
|
|
return GTK_WIDGET (hpaned);
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_edit_measures_page_new(){
|
|
|
|
GtkWidget *measures_grid = gtk_grid_new();
|
|
|
|
return measures_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_edit_results_page_new(){
|
|
|
|
GtkWidget *xxx_grid = gtk_grid_new();
|
|
|
|
return xxx_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_edit_discuss_page_new(){
|
|
|
|
GtkWidget *xxx_grid = gtk_grid_new();
|
|
|
|
return xxx_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_edit_help_page_new(){
|
2024-05-08 11:13:33 +02:00
|
|
|
GtkWidget *edit_help_grid = gtk_grid_new();
|
|
|
|
gtk_grid_attach (GTK_GRID(edit_help_grid), GTK_WIDGET(get_frame_with_label()), 0, 0, 1, 1);
|
|
|
|
return edit_help_grid;
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_run_measures_page_new(){
|
|
|
|
GtkWidget *measures_grid = gtk_grid_new();
|
|
|
|
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("movements"), 0, 0, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transports"), 1, 0, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transformations"), 2, 0, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("objects"), 0, 1, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("situations"), 1, 1, 1, 1);
|
|
|
|
return measures_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_run_results_page_new(){
|
|
|
|
GtkWidget *results_grid = gtk_grid_new();
|
|
|
|
gtk_grid_attach (GTK_GRID(results_grid), gtk_button_new_with_label ("Repartitions"), 0, 0, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID(results_grid), gtk_button_new_with_label ("Correlations"), 0, 1, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID(results_grid), gtk_button_new_with_label ("Evolutions"), 0, 2, 1, 1);
|
|
|
|
return results_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_run_discuss_page_new(){
|
|
|
|
GtkWidget *discuss_grid = gtk_grid_new();
|
|
|
|
gtk_grid_attach (GTK_GRID (discuss_grid), gtk_button_new_with_label ("Interpretations"), 0, 0, 1, 1);
|
|
|
|
gtk_grid_attach (GTK_GRID (discuss_grid), gtk_button_new_with_label ("Discussions"), 0, 1, 1, 1);
|
|
|
|
return discuss_grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *get_run_help_page_new(){
|
2024-05-08 11:13:33 +02:00
|
|
|
GtkWidget *run_help_grid = gtk_grid_new();
|
|
|
|
gtk_grid_attach (GTK_GRID(run_help_grid), GTK_WIDGET(get_frame_with_label()), 0, 0, 1, 1);
|
|
|
|
return run_help_grid;
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
2024-05-11 07:57:37 +02:00
|
|
|
/*
|
|
|
|
GtkWidget *get_run_rules_page_new(){ @see hot.c 2024-05-11 } (line 166)
|
|
|
|
*/
|
2024-05-07 20:48:01 +02:00
|
|
|
|
|
|
|
GtkWidget *get_edit_space_page_new(){
|
|
|
|
GtkWidget *space_grid = gtk_grid_new();
|
2024-05-11 23:08:59 +02:00
|
|
|
gtk_grid_attach (GTK_GRID(space_grid), get_image_ALL_SPACE(), 0, 0, 1, 3);
|
2024-05-10 08:19:35 +02:00
|
|
|
gtk_grid_attach (GTK_GRID(space_grid), get_OBJECTS_and_SITUATIONS(), 0, 4, 1, 1);
|
2024-05-31 22:34:15 +02:00
|
|
|
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET (get_XYZ_box()), 1, 0, 1, 2);
|
|
|
|
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET (get_ZOOM_box()), 1, 2, 1, 2);
|
|
|
|
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET (get_edit_TOOL_box()), 1, 3, 1, 2);
|
2024-05-07 20:48:01 +02:00
|
|
|
gtk_widget_set_size_request (space_grid, W, H);
|
|
|
|
// How to use gtk_separators ?
|
|
|
|
// gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1);
|
|
|
|
return space_grid;
|
|
|
|
}
|
|
|
|
|
2024-05-10 14:37:44 +02:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2024-05-14 21:38:04 +02:00
|
|
|
GtkWidget *get_selected_rules_vpaned_new(){
|
|
|
|
GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
|
|
|
|
|
2024-06-02 13:13:37 +02:00
|
|
|
// GtkWidget *règle_sélectionnée_n_1 = gtk_frame_new ("(1)");
|
|
|
|
// GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)");
|
2024-05-14 21:38:04 +02:00
|
|
|
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *up_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
2024-05-14 21:38:04 +02:00
|
|
|
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE()));
|
2024-05-31 22:34:15 +02:00
|
|
|
gtk_box_append (up_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
2024-05-14 21:38:04 +02:00
|
|
|
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMINE()));
|
|
|
|
/*
|
|
|
|
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_image_PHENYLALANINE()));
|
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_image_DOPAMINE()));
|
|
|
|
*/
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *bottom_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
2024-05-14 21:38:04 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_image_ATP()));
|
2024-05-31 22:34:15 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
2024-05-14 21:38:04 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_image_AMP()));
|
|
|
|
|
|
|
|
gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (up_box));
|
|
|
|
gtk_paned_set_end_child (V_selected_1_vs_2, GTK_WIDGET (bottom_box));
|
|
|
|
|
|
|
|
// gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (règle_sélectionnée_n_1));
|
|
|
|
// gtk_paned_set_end_child (V_selected_1_vs_2, GTK_WIDGET (règle_sélectionnée_n_2));
|
|
|
|
|
2024-06-02 13:13:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
// LES DEUX 'Gtk-CRITICAL **: 12:56:16.886: gtk_box_append: assertion 'GTK_IS_BOX (box)' failed' VIENNENT DES DEUX LIGNES SUIVANTES (2024-06-02)
|
|
|
|
// gtk_box_append ( GTK_BOX (règle_sélectionnée_n_1), GTK_WIDGET (up_box));//, GTK_WIDGET (get_image_GLUTAMATE()));
|
|
|
|
// gtk_box_append ( GTK_BOX (règle_sélectionnée_n_2), GTK_WIDGET (bottom_box));//, GTK_WIDGET (get_image_GLUTAMATE()));
|
|
|
|
|
2024-05-14 21:38:04 +02:00
|
|
|
|
|
|
|
return GTK_WIDGET (V_selected_1_vs_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-02 23:21:04 +02:00
|
|
|
GtkWidget *get_TIME_EXEC_controls_box(){
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *top_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
2024-05-10 14:37:44 +02:00
|
|
|
gtk_box_append (top_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar()));
|
2024-05-10 15:10:34 +02:00
|
|
|
gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
2024-05-10 14:37:44 +02:00
|
|
|
gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box()));
|
|
|
|
return GTK_WIDGET (top_box);
|
|
|
|
}
|
|
|
|
|
2024-06-02 23:21:04 +02:00
|
|
|
GtkWidget *get_SPACE_VIEW_box(){
|
|
|
|
GtkBox *right_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
|
|
|
gtk_box_append (right_box, GTK_WIDGET (get_XYZ_box()));
|
|
|
|
gtk_box_append (right_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
|
|
|
gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box()));
|
|
|
|
|
|
|
|
GtkBox *middle_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
|
|
|
gtk_box_append (middle_box, GTK_WIDGET (get_image_ALL_SPACE()));
|
|
|
|
gtk_box_append (middle_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
|
|
|
gtk_box_append (middle_box, GTK_WIDGET (right_box));
|
|
|
|
return GTK_WIDGET (middle_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2024-05-10 06:52:48 +02:00
|
|
|
GtkWidget *get_run_space_left_box(){
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *left_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
2024-05-11 23:08:59 +02:00
|
|
|
gtk_box_append (left_box, GTK_WIDGET (get_image_ALL_SPACE()));
|
2024-05-10 08:19:35 +02:00
|
|
|
gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
|
2024-05-10 06:52:48 +02:00
|
|
|
return GTK_WIDGET (left_box);
|
|
|
|
}
|
2024-05-08 23:43:23 +02:00
|
|
|
|
2024-05-10 06:52:48 +02:00
|
|
|
GtkWidget *get_run_space_right_box(){
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *right_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
2024-05-10 06:52:48 +02:00
|
|
|
gtk_box_append (right_box, GTK_WIDGET (get_XYZ_box()));
|
2024-05-10 15:10:34 +02:00
|
|
|
gtk_box_append (right_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
2024-05-10 06:52:48 +02:00
|
|
|
gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box()));
|
|
|
|
return GTK_WIDGET (right_box);
|
|
|
|
}
|
2024-05-07 20:48:01 +02:00
|
|
|
|
2024-05-10 14:37:44 +02:00
|
|
|
GtkWidget *get_run_space_bottom_box(){
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *bottom_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
2024-05-10 14:37:44 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_left_box()));
|
2024-05-10 15:41:35 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (gtk_label_new (" "))); // AD HOC (pour "centrer")
|
2024-05-10 14:37:44 +02:00
|
|
|
gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_right_box()));
|
|
|
|
return GTK_WIDGET (bottom_box);
|
|
|
|
}
|
2024-06-02 23:21:04 +02:00
|
|
|
*/
|
2024-05-10 06:52:48 +02:00
|
|
|
GtkWidget *get_run_space_page_new(){
|
2024-05-31 22:34:15 +02:00
|
|
|
GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
2024-06-02 23:21:04 +02:00
|
|
|
gtk_box_append (page_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
|
|
|
|
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
|
|
|
gtk_box_append (page_box, GTK_WIDGET (get_SPACE_VIEW_box()));
|
|
|
|
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
|
|
|
gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
|
2024-05-10 06:52:48 +02:00
|
|
|
return GTK_WIDGET (page_box);
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
static void icons_for_fun (GtkHeaderBar *header_bar)
|
|
|
|
{
|
|
|
|
GtkButton *go_home = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (go_home, "go-home-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (go_home));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *user_trash = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (user_trash, "user-trash-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (user_trash));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *help_biblio = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (help_biblio, "accessories-dictionary-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_biblio));
|
2024-05-31 23:22:12 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *help_doc = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (help_doc, "emblem-documents-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_doc));
|
2024-05-31 23:22:12 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *help_about = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (help_about, "help-about-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_about));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *help_faq = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (help_faq, "help-faq-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (help_faq));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *terminal = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (terminal, "utilities-terminal-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (terminal));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *search = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (search, "folder-saved-search-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (search));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *preferences_desktop_appearance = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (preferences_desktop_appearance, "preferences-desktop-appearance-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_desktop_appearance));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *preferences_system = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (preferences_system, "preferences-system-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (preferences_system));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *document_properties = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (document_properties, "document-properties-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (document_properties));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *text_edit = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (text_edit, "text-editor-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (text_edit));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *applications_utilities = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (applications_utilities, "applications-utilities-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (applications_utilities));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *open_menu = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (open_menu, "open-menu-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (open_menu));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *power_max = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (power_max, "power-profile-performance-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_max));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *power_middle = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (power_middle, "power-profile-balanced-rtl-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_middle));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkButton *power_low = GTK_BUTTON (gtk_button_new ());
|
|
|
|
gtk_button_set_icon_name (power_low, "power-profile-power-saver-symbolic");
|
|
|
|
gtk_header_bar_pack_end (header_bar, GTK_WIDGET (power_low));
|
|
|
|
}
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-02 22:14:24 +02:00
|
|
|
void window_header_bar (GtkWindow *window, char *title){
|
2024-06-01 11:32:57 +02:00
|
|
|
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new());
|
|
|
|
gtk_window_set_titlebar (window, header_bar);
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
// 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);
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-03 05:46:01 +02:00
|
|
|
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), NULL);
|
|
|
|
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
gtk_window_set_titlebar (window, header_bar);
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-03 05:46:01 +02:00
|
|
|
GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_toggle_button_new ());
|
2024-06-01 11:32:57 +02:00
|
|
|
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");
|
2024-06-03 05:46:01 +02:00
|
|
|
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);
|
2024-06-01 11:32:57 +02:00
|
|
|
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (run_stop_model_exec));
|
2024-05-31 22:34:15 +02:00
|
|
|
|
2024-06-01 11:32:57 +02:00
|
|
|
icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
2024-06-01 22:15:07 +02:00
|
|
|
void two_notebooks_in_two_panes (GtkWindow *window) {
|
2024-05-07 20:48:01 +02:00
|
|
|
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"));
|
|
|
|
|
2024-06-03 05:46:01 +02:00
|
|
|
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));
|
2024-05-11 07:57:37 +02:00
|
|
|
|
2024-05-31 22:34:15 +02:00
|
|
|
gtk_notebook_set_current_page (run_notebook, 0); // @see hot.c 2024-05-11 (line 68)
|
2024-05-15 06:19:48 +02:00
|
|
|
gtk_notebook_set_current_page (edit_notebook, 1); // @see hot.c 2024-05-11 (line 68)
|
2024-05-07 20:48:01 +02:00
|
|
|
}
|
|
|
|
|
2024-06-01 22:15:07 +02:00
|
|
|
|