WIP: contain.g_signal_connect (GTK_BUTTON (get_btt_run_xor_edit()), clicked, G_CALLBACK (on_togglerunedit_action()), NULL);

This commit is contained in:
Jean Sirmai 2024-05-31 22:34:15 +02:00
parent abf5c4ca3e
commit 8163333422
Signed by: jean
GPG Key ID: FB3115C340E057E3
18 changed files with 195 additions and 61 deletions

30
callback.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>
#include "hot.h"
#include "display.h"
#include "contain.h"
#include "texts.h"
void ui_toggle_run_edit()
{
if (get_run_edit_mode()) {g_printerr("Can't find self->main_button_run_edit !\n"); return;}
printf("window.ui_toggle_run_edit() >>> mode = %d", get_run_edit_mode ());
if (get_run_edit_mode()) {
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
set_run_edit_mode (0);
} else {
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "document-edit-symbolic");
set_run_edit_mode (1);
}
printf(" > %d\n", get_run_edit_mode ());
}
void on_togglerunedit_action(GSimpleAction *action, GVariant *parameter, gpointer user_data) {
// GemGraphClientApplication *self = user_data;
// g_assert (GEM_GRAPH_CLIENT_IS_APPLICATION(self));
printf("| >>> callback.on_togglerunedit_action() >>> ");
ui_toggle_run_edit ();
}

1
callback.h Normal file
View File

@ -0,0 +1 @@
void on_togglerunedit_action(GSimpleAction *action, GVariant *parameter, gpointer user_data);

131
contain.c
View File

@ -81,9 +81,9 @@ GtkWidget *get_edit_space_page_new(){
GtkWidget *space_grid = gtk_grid_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_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), 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_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_ZOOM_box()), 1, 2, 1, 2);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_edit_TOOL_box()), 1, 3, 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); gtk_widget_set_size_request (space_grid, W, H);
// How to use gtk_separators ? // How to use gtk_separators ?
// gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1); // gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1);
@ -95,12 +95,12 @@ GtkWidget *get_edit_space_page_new(){
GtkWidget *get_selected_rules_vpaned_new(){ GtkWidget *get_selected_rules_vpaned_new(){
GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); 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_1 = gtk_frame_new ("(1)");
// GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)"); GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)");
GtkBox *up_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 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 (get_image_GLUTAMATE()));
gtk_box_append (up_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (up_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMINE())); gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMINE()));
/* /*
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
@ -108,9 +108,9 @@ GtkWidget *get_selected_rules_vpaned_new(){
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_DOPAMINE())); gtk_box_append (bottom_box, GTK_WIDGET (get_image_DOPAMINE()));
*/ */
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); 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 (get_image_ATP()));
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (bottom_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_AMP())); 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_start_child (V_selected_1_vs_2, GTK_WIDGET (up_box));
@ -119,8 +119,8 @@ GtkWidget *get_selected_rules_vpaned_new(){
// gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (règle_sélectionnée_n_1)); // 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_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_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())); 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); return GTK_WIDGET (V_selected_1_vs_2);
} }
@ -128,7 +128,7 @@ GtkWidget *get_selected_rules_vpaned_new(){
GtkWidget *get_run_space_top_box(){ GtkWidget *get_run_space_top_box(){
GtkBox *top_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); 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 (get_ELAPSED_TIME_ProgressBar()));
gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box())); gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box()));
@ -136,14 +136,14 @@ GtkWidget *get_run_space_top_box(){
} }
GtkWidget *get_run_space_left_box(){ GtkWidget *get_run_space_left_box(){
GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); 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_image_ALL_SPACE()));
gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS())); gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
return GTK_WIDGET (left_box); return GTK_WIDGET (left_box);
} }
GtkWidget *get_run_space_right_box(){ GtkWidget *get_run_space_right_box(){
GtkBox *right_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); 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 (get_XYZ_box()));
gtk_box_append (right_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (right_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box())); gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box()));
@ -151,7 +151,7 @@ GtkWidget *get_run_space_right_box(){
} }
GtkWidget *get_run_space_bottom_box(){ GtkWidget *get_run_space_bottom_box(){
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); 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 (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_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 (gtk_label_new (" "))); // AD HOC (pour "centrer")
@ -160,19 +160,110 @@ GtkWidget *get_run_space_bottom_box(){
} }
GtkWidget *get_run_space_page_new(){ GtkWidget *get_run_space_page_new(){
GtkBox *page_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); 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 (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(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (page_box, GTK_WIDGET (get_run_space_bottom_box())); gtk_box_append (page_box, GTK_WIDGET (get_run_space_bottom_box()));
return GTK_WIDGET (page_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){ void window_bar(GtkWindow *window, char *title){
GtkWidget *titlebar = gtk_header_bar_new(); GtkWidget *header_bar = gtk_header_bar_new();
gtk_window_set_title (window, title); // gtk_window_set_title (window, title);
gtk_window_set_titlebar (window, titlebar); // header_bar gtk_window_set_titlebar (window, header_bar);
// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START // 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_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");
// gtk_actionable_set_action_name (GTK_ACTIONABLE (get_btt_run_xor_edit()), "app.togglerunedit");
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) { void activate (GtkApplication *app, gpointer user_data) {
@ -207,7 +298,7 @@ void activate (GtkApplication *app, gpointer user_data) {
gtk_window_set_child (window, GTK_WIDGET(run_xor_edit_horizontal_pane)); gtk_window_set_child (window, GTK_WIDGET(run_xor_edit_horizontal_pane));
gtk_window_present (GTK_WINDOW (window)); gtk_window_present (GTK_WINDOW (window));
gtk_notebook_set_current_page (run_notebook, 1); // @see hot.c 2024-05-11 (line 68) 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) gtk_notebook_set_current_page (edit_notebook, 1); // @see hot.c 2024-05-11 (line 68)
} }

View File

@ -86,21 +86,21 @@ static GtkWidget *get_scroll_speed(){
} }
static GtkBox *get_UNDO_SPEED_box(){ static GtkBox *get_UNDO_SPEED_box(){
GtkBox *SPEED_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); GtkBox *SPEED_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
gtk_box_append (SPEED_box, GTK_WIDGET(gtk_label_new ("< UNDO <\n"))); gtk_box_append (SPEED_box, GTK_WIDGET(gtk_label_new ("< UNDO <\n")));
gtk_box_append (SPEED_box, get_scroll_speed()); gtk_box_append (SPEED_box, get_scroll_speed());
return SPEED_box; return SPEED_box;
} }
static GtkBox *get_DO_SPEED_box(){ static GtkBox *get_DO_SPEED_box(){
GtkBox *SPEED_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); GtkBox *SPEED_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
gtk_box_append (SPEED_box, GTK_WIDGET(gtk_label_new ("> DO >\n"))); gtk_box_append (SPEED_box, GTK_WIDGET(gtk_label_new ("> DO >\n")));
gtk_box_append (SPEED_box, get_scroll_speed()); gtk_box_append (SPEED_box, get_scroll_speed());
return SPEED_box; return SPEED_box;
} }
GtkBox *get_RUN_STOP_box(){ GtkBox *get_RUN_STOP_box(){
GtkBox *RUN_STOP_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20)); GtkBox *RUN_STOP_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20));
gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_UNDO_SPEED_box())); gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_UNDO_SPEED_box()));
gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new (" STEP\n(show active rule) "))); gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new (" STEP\n(show active rule) ")));
gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_DO_SPEED_box())); gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_DO_SPEED_box()));
@ -110,7 +110,7 @@ GtkBox *get_RUN_STOP_box(){
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
GtkBox *get_ZOOM_box(){ GtkBox *get_ZOOM_box(){
GtkBox *ZOOM_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkBox *ZOOM_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\ GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\
"\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\ "\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\
---\n (arrows\n struct.)\n")); ---\n (arrows\n struct.)\n"));
@ -122,7 +122,7 @@ GtkBox *get_ZOOM_box(){
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
GtkBox *get_edit_TOOL_box(){ GtkBox *get_edit_TOOL_box(){
GtkBox *TOOL_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkBox *TOOL_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new ("TOOLS\n ---\n(space\nstruct.)")); GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new ("TOOLS\n ---\n(space\nstruct.)"));
gtk_widget_set_size_request (GTK_WIDGET (TOOL_box), 10, 120); gtk_widget_set_size_request (GTK_WIDGET (TOOL_box), 10, 120);
gtk_box_append (TOOL_box, ZOOM_Label); gtk_box_append (TOOL_box, ZOOM_Label);
@ -132,8 +132,8 @@ GtkBox *get_edit_TOOL_box(){
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
GtkBox *get_XYZ_box(){ GtkBox *get_XYZ_box(){
GtkBox *XYZ_labels_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); // spacing = 2 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)); // spacing = 2q GtkBox *XYZ_scrollbar_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2q
// GtkWidget *scale_X = gtk_scale_button_new (0, 360, 10, NULL); < à étudier // GtkWidget *scale_X = gtk_scale_button_new (0, 360, 10, NULL); < à étudier
// (double min, double max, double step, const char** icons) // (double min, double max, double step, const char** icons)
GtkAdjustment *X_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0); GtkAdjustment *X_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0);
@ -172,7 +172,7 @@ GtkProgressBar *get_ELAPSED_TIME_ProgressBar(){ // To rename : DO - UNDO - REDO
// Chaque label "objet" ou "situation" sera remplacé par un curseur "transparence" (vertical) // Chaque label "objet" ou "situation" sera remplacé par un curseur "transparence" (vertical)
static GtkBox *get_objects_box(){ static GtkBox *get_objects_box(){
GtkBox *objects_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkBox *objects_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
GtkAdjustment *adjust = gtk_adjustment_new (0, 0, 255, 1, 0, 0); GtkAdjustment *adjust = gtk_adjustment_new (0, 0, 255, 1, 0, 0);
if (0) for (int i = 0; i < 10; i++) if (0) for (int i = 0; i < 10; i++)
gtk_box_append (objects_box, gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust)); gtk_box_append (objects_box, gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust));
@ -190,7 +190,7 @@ static GtkBox *get_objects_box(){
} }
static GtkBox *get_situations_box(){ static GtkBox *get_situations_box(){
GtkBox *situations_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkBox *situations_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
char string[7]; char string[7];
for (int i = 0; i < 64; i++){ for (int i = 0; i < 64; i++){
sprintf(string, "[%d] ", i); sprintf(string, "[%d] ", i);
@ -233,7 +233,7 @@ GtkWidget *get_OBJECTS_and_SITUATIONS(){
GtkBox *get_rules_comparator_new(){ GtkBox *get_rules_comparator_new(){
GtkBox *comparator = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); GtkBox *comparator = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (comparator, GTK_WIDGET (get_image_ATP())); gtk_box_append (comparator, GTK_WIDGET (get_image_ATP()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_AMP())); gtk_box_append (comparator, GTK_WIDGET (get_image_AMP()));

View File

@ -30,4 +30,8 @@ GtkBox *get_XYZ_box();
GtkWidget *get_OBJECTS_and_SITUATIONS(); GtkWidget *get_OBJECTS_and_SITUATIONS();
GtkBox *get_ELAPSED_TIME_box(); GtkBox *get_ELAPSED_TIME_box();
GtkWidget *get_btt_run_xor_edit();
void window_bar(GtkWindow *window, char *title); void window_bar(GtkWindow *window, char *title);

67
hot.c
View File

@ -3,7 +3,7 @@
#include "warm.h" #include "warm.h"
#include "cold.h" #include "cold.h"
#include "display.h" //#include "display.h"
#include "contain.h" #include "contain.h"
#include "texts.h" #include "texts.h"
@ -12,6 +12,10 @@
// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management // https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management
// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL // GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL
static int run_edit_mode_val = 0;
void set_run_edit_mode(int prescribed_mode) {run_edit_mode_val = prescribed_mode;}
int get_run_edit_mode () {return run_edit_mode_val;}
static struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;}; static struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;};
static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child); static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child);
@ -22,35 +26,36 @@ static struct TreeNode_t *create_user_tree_node (const gchar* text){
return node; return node;
} }
static void create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root){ static void let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root) {
/* struct TreeNode_t *move_random = create_user_tree_node("move random"); add_child_node(tree_root, move_random); struct TreeNode_t *a = create_user_tree_node("We, the people");add_child_node(tree_root, a);
struct TreeNode_t *move_determ = create_user_tree_node("move determ"); add_child_node(tree_root, move_determ); struct TreeNode_t *b = create_user_tree_node("in Order to"); add_child_node(tree_root, b);
struct TreeNode_t *transport = create_user_tree_node("transport"); add_child_node(tree_root, transport);*/ struct TreeNode_t *c = create_user_tree_node("do establish"); add_child_node(tree_root, c);
struct TreeNode_t *transform = create_user_tree_node("transform"); add_child_node(tree_root, transform); struct TreeNode_t *aa = create_user_tree_node("aware of"); add_child_node(a, aa);
struct TreeNode_t *regulate = create_user_tree_node("regulate"); add_child_node(tree_root, regulate); struct TreeNode_t *aaa = create_user_tree_node("our rights"); add_child_node(aa, aaa);
/* struct TreeNode_t *isole = create_user_tree_node("isolated object"); add_child_node(move_random, isole); struct TreeNode_t *aab = create_user_tree_node("our duties"); add_child_node(aa, aab);
struct TreeNode_t *relie = create_user_tree_node("part of object"); add_child_node(move_random, relie); struct TreeNode_t *aaaa = create_user_tree_node("read"); add_child_node(aaa, aaaa);
struct TreeNode_t *no_payload = create_user_tree_node("free"); add_child_node(transport, no_payload); struct TreeNode_t *aaab = create_user_tree_node("write"); add_child_node(aaa, aaab);
struct TreeNode_t *charged = create_user_tree_node("charged"); add_child_node(transport, charged); struct TreeNode_t *aaac = create_user_tree_node("copy"); add_child_node(aaa, aaac);
struct TreeNode_t *spontaneous = create_user_tree_node("spontaneous"); add_child_node(transform, spontaneous);*/ struct TreeNode_t *aaad = create_user_tree_node("edit"); add_child_node(aaa, aaad);
struct TreeNode_t *catalysed = create_user_tree_node("catalysed"); add_child_node(transform, catalysed); struct TreeNode_t *aaaba= create_user_tree_node("code"); add_child_node(aaab, aaaba);
/* struct TreeNode_t *isole_1D = create_user_tree_node("isolated object move 1D"); add_child_node(isole, isole_1D); struct TreeNode_t *aaabb= create_user_tree_node("language"); add_child_node(aaab, aaabb);
struct TreeNode_t *isole_2D = create_user_tree_node("isolated object move 2D"); add_child_node(isole, isole_2D); struct TreeNode_t *aaabc= create_user_tree_node("any art..."); add_child_node(aaab, aaabc);
struct TreeNode_t *isole_3D = create_user_tree_node("isolated object move 3D"); add_child_node(isole, isole_3D); struct TreeNode_t *aaadb= create_user_tree_node("publish"); add_child_node(aaac, aaadb);
struct TreeNode_t *translat_2D = create_user_tree_node("translation"); add_child_node(isole_2D, translat_2D); struct TreeNode_t *aaada= create_user_tree_node("create"); add_child_node(aaad, aaada);
struct TreeNode_t *rotat_2D = create_user_tree_node("rotation"); add_child_node(isole_2D, rotat_2D); struct TreeNode_t *aaba = create_user_tree_node("learn"); add_child_node(aab, aaba);
struct TreeNode_t *rotat_X_2D = create_user_tree_node("rotation axe X"); add_child_node(rotat_2D, rotat_X_2D); struct TreeNode_t *aabb = create_user_tree_node("help"); add_child_node(aab, aabb);
struct TreeNode_t *rotat_Y_2D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_2D, rotat_Y_2D); struct TreeNode_t *ba = create_user_tree_node("promote"); add_child_node(b, ba);
struct TreeNode_t *translat_3D = create_user_tree_node("translation"); add_child_node(isole_3D, translat_3D); struct TreeNode_t *bb = create_user_tree_node("individual"); add_child_node(b, bb);
struct TreeNode_t *rotat_3D = create_user_tree_node("rotation"); add_child_node(isole_3D, rotat_3D); struct TreeNode_t *bc = create_user_tree_node("and common"); add_child_node(b, bc);
struct TreeNode_t *rotat_X_3D = create_user_tree_node("rotation axe X"); add_child_node(rotat_3D, rotat_X_3D); struct TreeNode_t *bca = create_user_tree_node("education"); add_child_node(bc, bca);
struct TreeNode_t *rotat_Y_3D = create_user_tree_node("rotation axe Y"); add_child_node(rotat_3D, rotat_Y_3D); struct TreeNode_t *bcb = create_user_tree_node("mutual"); add_child_node(bc, bcb);
struct TreeNode_t *rotat_Z_3D = create_user_tree_node("rotation axe Z"); add_child_node(rotat_3D, rotat_Z_3D); struct TreeNode_t *bcc = create_user_tree_node("support"); add_child_node(bc, bcc);
struct TreeNode_t *control = create_user_tree_node("negative feedback (control)"); add_child_node(regulate, control); struct TreeNode_t *bcd = create_user_tree_node("health"); add_child_node(bc, bcd);
struct TreeNode_t *enhance = create_user_tree_node("positive feedback (enhance)"); add_child_node(regulate, enhance);*/ struct TreeNode_t *bcda = create_user_tree_node("mental"); add_child_node(bcd, bcda);
struct TreeNode_t *n_importe = create_user_tree_node("n'importe"); add_child_node(catalysed, n_importe); struct TreeNode_t *bcdb = create_user_tree_node("physical"); add_child_node(bcd, bcdb);
struct TreeNode_t *quoi = create_user_tree_node("quoi"); add_child_node(n_importe, quoi); struct TreeNode_t *ca = create_user_tree_node("free"); add_child_node(c, ca);
struct TreeNode_t *ma_qué = create_user_tree_node("ma_qué"); add_child_node(quoi, ma_qué); struct TreeNode_t *cb = create_user_tree_node("code"); add_child_node(c, cb);
struct TreeNode_t *cc = create_user_tree_node("access"); add_child_node(c, cc);
} }
void on_user_tree_expander_toggled(GtkExpander *expander, gpointer user_data) void on_user_tree_expander_toggled(GtkExpander *expander, gpointer user_data)
@ -123,7 +128,7 @@ static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child)
GtkScrolledWindow *get_user_rules_tree (){ GtkScrolledWindow *get_user_rules_tree (){
struct TreeNode_t *tree_root = create_user_tree_node("root"); struct TreeNode_t *tree_root = create_user_tree_node("root");
create_a_complex_useless_and_expensive_tree (tree_root); let_us_create_a_complex_useless_and_expensive_tree (tree_root);
GtkStringList *model = gtk_string_list_new(NULL); GtkStringList *model = gtk_string_list_new(NULL);
gtk_string_list_append (model, tree_root->text); gtk_string_list_append (model, tree_root->text);

3
hot.h
View File

@ -13,3 +13,6 @@
#include "contain.h" #include "contain.h"
GtkScrolledWindow *get_user_rules_tree (); GtkScrolledWindow *get_user_rules_tree ();
void set_run_edit_mode(int prescribed_mode);
int get_run_edit_mode();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB