#include #include #include "hot.h" #include "display.h" #include "contain.h" #include "texts.h" #include "callback.h" GtkWidget *get_edit_rules_page_new(){ 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); } 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(){ 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; } 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(){ 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; } /* GtkWidget *get_run_rules_page_new(){ @see hot.c 2024-05-11 } (line 166) */ GtkWidget *get_edit_space_page_new(){ GtkWidget *space_grid = gtk_grid_new(); gtk_grid_attach (GTK_GRID(space_grid), get_image_ALL_SPACE(), 0, 0, 1, 3); gtk_grid_attach (GTK_GRID(space_grid), get_OBJECTS_and_SITUATIONS(), 0, 4, 1, 1); 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); 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; } //------------------------------------------------------------------------------ GtkWidget *get_selected_rules_vpaned_new(){ GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); GtkWidget *règle_sélectionnée_n_1 = gtk_frame_new ("(1)"); GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)"); GtkBox *up_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE())); gtk_box_append (up_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); 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())); */ GtkBox *bottom_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); gtk_box_append (bottom_box, GTK_WIDGET (get_image_ATP())); gtk_box_append (bottom_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); 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)); 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())); return GTK_WIDGET (V_selected_1_vs_2); } GtkWidget *get_run_space_top_box(){ GtkBox *top_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); gtk_box_append (top_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar())); gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box())); return GTK_WIDGET (top_box); } GtkWidget *get_run_space_left_box(){ GtkBox *left_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (left_box, GTK_WIDGET (get_image_ALL_SPACE())); gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS())); return GTK_WIDGET (left_box); } GtkWidget *get_run_space_right_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())); return GTK_WIDGET (right_box); } GtkWidget *get_run_space_bottom_box(){ GtkBox *bottom_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_left_box())); 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") gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_right_box())); return GTK_WIDGET (bottom_box); } GtkWidget *get_run_space_page_new(){ GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (page_box, GTK_WIDGET (get_run_space_top_box())); gtk_box_append (page_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (page_box, GTK_WIDGET (get_run_space_bottom_box())); return GTK_WIDGET (page_box); } GtkWidget *get_btt_run_xor_edit() { GtkWidget *run_xor_edit = gtk_toggle_button_new (); return GTK_WIDGET (run_xor_edit); } void window_bar(GtkWindow *window, char *title){ GtkWidget *header_bar = gtk_header_bar_new(); gtk_window_set_titlebar (window, header_bar); // 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); gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "document-edit-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "text-editor-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic"); g_signal_connect (GTK_BUTTON (get_btt_run_xor_edit()), "clicked", G_CALLBACK (on_togglerunedit_action), NULL); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), get_btt_run_xor_edit()); gtk_window_set_titlebar (window, header_bar); GtkWidget *run_stop_model_exec = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (run_stop_model_exec), "system-shutdown-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (run_stop_model_exec), "media-playback-start-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (run_stop_model_exec), "media-playback-pause-symbolic"); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), run_stop_model_exec); // https://iconduck.com/sets/adwaita-icon-theme GtkWidget *go_home = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (go_home), "go-home-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), go_home); GtkWidget *user_trash = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (user_trash), "user-trash-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), user_trash); GtkWidget *help_biblio = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (help_biblio), "accessories-dictionary-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), help_biblio); GtkWidget *help_doc = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (help_doc), "emblem-documents-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), help_doc); GtkWidget *help_about = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (help_about), "help-about-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), help_about); GtkWidget *help_faq = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (help_faq), "help-faq-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), help_faq); GtkWidget *terminal = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (terminal), "utilities-terminal-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), terminal); GtkWidget *search = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (search), "folder-saved-search-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), search); GtkWidget *preferences_desktop_appearance = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (preferences_desktop_appearance), "preferences-desktop-appearance-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), preferences_desktop_appearance); GtkWidget *preferences_system = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (preferences_system), "preferences-system-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), preferences_system); GtkWidget *document_properties = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (document_properties), "document-properties-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), document_properties); GtkWidget *text_edit = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (text_edit), "text-editor-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), text_edit); GtkWidget *applications_utilities = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (applications_utilities), "applications-utilities-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), applications_utilities); GtkWidget *open_menu = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (open_menu), "open-menu-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), open_menu); GtkWidget *power_max = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (power_max), "power-profile-performance-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), power_max); GtkWidget *power_middle = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (power_middle), "power-profile-balanced-rtl-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), power_middle); GtkWidget *power_low = gtk_button_new (); gtk_button_set_icon_name (GTK_BUTTON (power_low), "power-profile-power-saver-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), power_low); } void activate (GtkApplication *app, gpointer user_data) { GtkWindow *window = GTK_WINDOW (gtk_application_window_new (app)); window_bar (window, "E coli (with permission from David S. Goodsell, 2009)"); 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 *run_xor_edit_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_size_request (run_xor_edit_horizontal_pane, 0, 0); gtk_paned_set_start_child (GTK_PANED(run_xor_edit_horizontal_pane), GTK_WIDGET (run_notebook)); gtk_paned_set_end_child (GTK_PANED(run_xor_edit_horizontal_pane), GTK_WIDGET (edit_notebook)); gtk_paned_set_position (GTK_PANED (run_xor_edit_horizontal_pane), W_IMAGE + 350); // '350' : AD HOC gtk_window_set_child (window, GTK_WIDGET(run_xor_edit_horizontal_pane)); gtk_window_present (GTK_WINDOW (window)); 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) }