From c6ed3c5c0f2bf4e5f2f942d3dad7f06cb0a884ad Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 9 Sep 2024 23:22:31 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20r=C3=A9organisation=20widget/rules/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/widget.h | 4 ++-- src/fsm/engine/engine.c | 4 ++++ .../dispatch_cond_act_id.c} | 6 +++--- .../rules/{selected => algebra}/utilities.c | 0 src/widget/rules/dispatch.c | 16 ++++++++-------- .../dispatch.c => geometry/dispatch_edit_enq.c} | 7 ++++--- src/widget/rules/{selected => geometry}/edit.c | 0 .../rules/{selected => geometry}/enquire.c | 0 .../rules/{selected => geometry}/geometry.c | 0 src/widget/rules/{tree_tools => tree}/compare.c | 0 src/widget/rules/{tree_tools => tree}/dispatch.c | 0 src/widget/rules/{tree_tools => tree}/freq.c | 0 src/widget/rules/{tree_tools => tree}/labo.c | 0 .../rules/{tree_tools => tree}/pilot_box.c | 0 src/widget/rules/{tree_tools => tree}/tree.c | 0 src/widget/topbar/right.c | 5 +++-- 16 files changed, 24 insertions(+), 18 deletions(-) rename src/widget/rules/{selected/algebra/dispatch.c => algebra/dispatch_cond_act_id.c} (96%) rename src/widget/rules/{selected => algebra}/utilities.c (100%) rename src/widget/rules/{selected/dispatch.c => geometry/dispatch_edit_enq.c} (97%) rename src/widget/rules/{selected => geometry}/edit.c (100%) rename src/widget/rules/{selected => geometry}/enquire.c (100%) rename src/widget/rules/{selected => geometry}/geometry.c (100%) rename src/widget/rules/{tree_tools => tree}/compare.c (100%) rename src/widget/rules/{tree_tools => tree}/dispatch.c (100%) rename src/widget/rules/{tree_tools => tree}/freq.c (100%) rename src/widget/rules/{tree_tools => tree}/labo.c (100%) rename src/widget/rules/{tree_tools => tree}/pilot_box.c (100%) rename src/widget/rules/{tree_tools => tree}/tree.c (100%) diff --git a/include/widget.h b/include/widget.h index 0ba0077..488a7d6 100644 --- a/include/widget.h +++ b/include/widget.h @@ -170,7 +170,7 @@ void widget_state_XYZ_reset_all(); // def: widget / rules / selected / dispatch.c (= right) void *widget_get_rules_tree_tools_pane(); -void *widget_get_rules_selected_pane(); +void *widget_get_single_selected_rule_pane(); // call: widget / rules / tree_tools / dispatch.c / widget_get_rules_tree_tools_pane() @@ -182,7 +182,7 @@ void *widget_get_rules_tree_tools(); // pilot_box.c void *widget_get_rules_use(); // freq.c -// call: widget / rules / selected / dispatch.c / widget_get_rules_selected_pane() +// call: widget / rules / selected / dispatch.c / widget_get_single_selected_rule_pane() // def: widget / rules / selected / dispatch.c // def: widget / rules / selected / edit.c // def: widget / rules / selected / enquire.c diff --git a/src/fsm/engine/engine.c b/src/fsm/engine/engine.c index 0730473..49121db 100644 --- a/src/fsm/engine/engine.c +++ b/src/fsm/engine/engine.c @@ -45,6 +45,8 @@ /* */ /******************************************************************************/ + +/* static void setup_listitem_cb (GtkListItemFactory *factory, GtkListItem *list_item) @@ -79,6 +81,8 @@ activate_cb (GtkListView *list, g_app_info_launch (app_info, NULL, NULL, NULL); g_object_unref (app_info); } +*/ + /* static void diff --git a/src/widget/rules/selected/algebra/dispatch.c b/src/widget/rules/algebra/dispatch_cond_act_id.c similarity index 96% rename from src/widget/rules/selected/algebra/dispatch.c rename to src/widget/rules/algebra/dispatch_cond_act_id.c index cec2035..d6c3dce 100644 --- a/src/widget/rules/selected/algebra/dispatch.c +++ b/src/widget/rules/algebra/dispatch_cond_act_id.c @@ -27,9 +27,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "../../../../../include/fsm.h" -#include "../../../../../include/widget.h" -#include "../../../../../include/signal.h" +#include "../../../../include/fsm.h" +#include "../../../../include/widget.h" +#include "../../../../include/signal.h" void *widget_get_selected_rule_algebra() diff --git a/src/widget/rules/selected/utilities.c b/src/widget/rules/algebra/utilities.c similarity index 100% rename from src/widget/rules/selected/utilities.c rename to src/widget/rules/algebra/utilities.c diff --git a/src/widget/rules/dispatch.c b/src/widget/rules/dispatch.c index 675fea5..405f764 100644 --- a/src/widget/rules/dispatch.c +++ b/src/widget/rules/dispatch.c @@ -34,14 +34,14 @@ void *widget_get_rules_page() { - GtkPaned *tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); - gtk_paned_set_start_child (tree_vs_selected, GTK_WIDGET (widget_get_rules_tree_tools_pane())); - gtk_paned_set_end_child (tree_vs_selected, GTK_WIDGET (widget_get_rules_selected_pane())); - gtk_paned_set_position (tree_vs_selected, 340); // WARNING : c'est une position "absolue" - gtk_paned_set_wide_handle (tree_vs_selected, TRUE); - gtk_paned_set_shrink_start_child (tree_vs_selected, FALSE); - gtk_paned_set_shrink_end_child (tree_vs_selected, FALSE); + GtkPaned *tree_vs_selected_one = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_paned_set_start_child (tree_vs_selected_one, GTK_WIDGET (widget_get_rules_tree_tools_pane())); + gtk_paned_set_end_child (tree_vs_selected_one, GTK_WIDGET (widget_get_single_selected_rule_pane())); + gtk_paned_set_position (tree_vs_selected_one, 340); // WARNING : c'est une position "absolue" + gtk_paned_set_wide_handle (tree_vs_selected_one, TRUE); + gtk_paned_set_shrink_start_child (tree_vs_selected_one, FALSE); + gtk_paned_set_shrink_end_child (tree_vs_selected_one, FALSE); - return GTK_WIDGET (tree_vs_selected); + return GTK_WIDGET (tree_vs_selected_one); } diff --git a/src/widget/rules/selected/dispatch.c b/src/widget/rules/geometry/dispatch_edit_enq.c similarity index 97% rename from src/widget/rules/selected/dispatch.c rename to src/widget/rules/geometry/dispatch_edit_enq.c index 71bc85c..cbcca6f 100644 --- a/src/widget/rules/selected/dispatch.c +++ b/src/widget/rules/geometry/dispatch_edit_enq.c @@ -32,8 +32,8 @@ #include "../../../../include/signal.h" -void *widget_get_selected_rule() { - +void *widget_get_selected_rule() +{ GtkBox *images_and_texts = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (images_and_texts, GTK_WIDGET (widget_get_selected_rule_geometry ())); gtk_box_append (images_and_texts, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); @@ -42,7 +42,7 @@ void *widget_get_selected_rule() { return GTK_WIDGET (images_and_texts); } -void *widget_get_rules_selected_pane() +void *widget_get_single_selected_rule_pane() { GtkPaned *rule_itself_vs_explore_edit_pane = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); gtk_paned_set_start_child (rule_itself_vs_explore_edit_pane, GTK_WIDGET (widget_get_selected_rule())); @@ -59,3 +59,4 @@ void *widget_get_rules_selected_pane() } + diff --git a/src/widget/rules/selected/edit.c b/src/widget/rules/geometry/edit.c similarity index 100% rename from src/widget/rules/selected/edit.c rename to src/widget/rules/geometry/edit.c diff --git a/src/widget/rules/selected/enquire.c b/src/widget/rules/geometry/enquire.c similarity index 100% rename from src/widget/rules/selected/enquire.c rename to src/widget/rules/geometry/enquire.c diff --git a/src/widget/rules/selected/geometry.c b/src/widget/rules/geometry/geometry.c similarity index 100% rename from src/widget/rules/selected/geometry.c rename to src/widget/rules/geometry/geometry.c diff --git a/src/widget/rules/tree_tools/compare.c b/src/widget/rules/tree/compare.c similarity index 100% rename from src/widget/rules/tree_tools/compare.c rename to src/widget/rules/tree/compare.c diff --git a/src/widget/rules/tree_tools/dispatch.c b/src/widget/rules/tree/dispatch.c similarity index 100% rename from src/widget/rules/tree_tools/dispatch.c rename to src/widget/rules/tree/dispatch.c diff --git a/src/widget/rules/tree_tools/freq.c b/src/widget/rules/tree/freq.c similarity index 100% rename from src/widget/rules/tree_tools/freq.c rename to src/widget/rules/tree/freq.c diff --git a/src/widget/rules/tree_tools/labo.c b/src/widget/rules/tree/labo.c similarity index 100% rename from src/widget/rules/tree_tools/labo.c rename to src/widget/rules/tree/labo.c diff --git a/src/widget/rules/tree_tools/pilot_box.c b/src/widget/rules/tree/pilot_box.c similarity index 100% rename from src/widget/rules/tree_tools/pilot_box.c rename to src/widget/rules/tree/pilot_box.c diff --git a/src/widget/rules/tree_tools/tree.c b/src/widget/rules/tree/tree.c similarity index 100% rename from src/widget/rules/tree_tools/tree.c rename to src/widget/rules/tree/tree.c diff --git a/src/widget/topbar/right.c b/src/widget/topbar/right.c index cb6a85a..7deab3c 100644 --- a/src/widget/topbar/right.c +++ b/src/widget/topbar/right.c @@ -85,7 +85,7 @@ static void display_widgets_at_the_right_side (GtkWidget *header_bar) // https://stackoverflow.com/questions/69135934/creating-a-simple-menubar-menu-and-menu-item-in-c-using-gtk4 -static void callback_aa () {puts("callback_aa() > menu item A clicked.\n");} +//static void callback_aa () {puts("callback_aa() > menu item A clicked.\n");} static void action_a (GSimpleAction *action, GVariant *parameter, gpointer app) {puts("menu item A clicked.\n");} static void connect(GApplication *app, gpointer *data) { puts("Connect menu item clicked.\n"); } @@ -94,7 +94,7 @@ void window_design_topbar_right (GtkWidget *header_bar, GtkApplication *app) display_widgets_at_the_right_side (header_bar); GSimpleActionGroup *ga = g_simple_action_group_new (); - GtkShortcutAction *aa = gtk_named_action_new ("aa"); +// GtkShortcutAction *aa = gtk_named_action_new ("aa"); gtk_widget_insert_action_group (btt_A, "aa", G_ACTION_GROUP (ga)); // GActionGroup* group // GtkShortcutAction *act_aa = gtk_callback_action_new (callback_aa, NULL, NULL); @@ -140,3 +140,4 @@ void window_design_topbar_right (GtkWidget *header_bar, GtkApplication *app) } +