diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
commit | f6e56cebfa878dd32a2405fd0c916a40140a1ff0 (patch) | |
tree | 3e364d2e2b2de19b85ab6d14f856d4b8db11737a /src/gui/menus/menubar.c | |
parent | e0d03e3eddb9d240cc21ac1b7a7ade915fd17942 (diff) |
Applied a new GUI update with the new loaded panels features.
Diffstat (limited to 'src/gui/menus/menubar.c')
-rw-r--r-- | src/gui/menus/menubar.c | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/src/gui/menus/menubar.c b/src/gui/menus/menubar.c index 989d964..7bc7e85 100644 --- a/src/gui/menus/menubar.c +++ b/src/gui/menus/menubar.c @@ -76,14 +76,14 @@ static void g_menu_bar_dispose(GMenuBar *); /* Procède à la libération totale de la mémoire. */ static void g_menu_bar_finalize(GMenuBar *); -/* Lance une actualisation du fait d'un changement de vue. */ -static void update_menu_bar_for_view(GMenuBar *, GtkDisplayPanel *); +/* Réagit à un changement d'affichage principal de contenu. */ +static void change_menubar_current_content(GMenuBar *, GLoadedContent *, GLoadedContent *); -/* Réagit à un changement de focus des panneaux d'affichage. */ -static void notify_focus_change_for_menu_bar(GMenuBar *, GtkDisplayPanel *); +/* Lance une actualisation du fait d'un changement de support. */ +static void change_menubar_current_view(GMenuBar *, GLoadedPanel *, GLoadedPanel *); /* Met à jour les accès aux menus en fonction de la position. */ -static void track_caret_address_for_menu_bar(GMenuBar *, GtkDisplayPanel *, const vmpa2t *); +static void track_caret_address_for_menu_bar(GMenuBar *, GLoadedPanel *, const GLineCursor *); /* Lance une actualisation relative à l'étendue du projet. */ static void update_menu_bar_for_project(GMenuBar *, GStudyProject *); @@ -118,9 +118,9 @@ static void g_menu_bar_class_init(GMenuBarClass *klass) editem = G_EDITOR_ITEM_CLASS(klass); - editem->update_view = (update_item_view_fc)update_menu_bar_for_view; - editem->notify_focus = (notify_focus_change_fc)notify_focus_change_for_menu_bar; - editem->track_caret = (track_caret_in_view_fc)track_caret_address_for_menu_bar; + editem->change_content = (change_item_content_fc)change_menubar_current_content; + editem->change_view = (change_item_view_fc)change_menubar_current_view; + editem->track_cursor = (track_cursor_in_view_fc)track_caret_address_for_menu_bar; editem->update_project = (update_project_fc)update_menu_bar_for_project; } @@ -264,10 +264,6 @@ GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup) result->help = build_menu_help(ref, accgroup); gtk_container_add(GTK_CONTAINER(item->widget), result->help); - /* Finalisation générique */ - - notify_focus_change_for_menu_bar(result, NULL); - return G_EDITOR_ITEM(result); } @@ -275,10 +271,11 @@ GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup) /****************************************************************************** * * -* Paramètres : bar = barre de menus à actualiser. * -* panel = nouveau panneau d'affichage actif. * +* Paramètres : bar = barre de menus à mettre à jour. * +* old = ancien contenu chargé analysé. * +* new = nouveau contenu chargé à analyser. * * * -* Description : Lance une actualisation du fait d'un changement de vue. * +* Description : Réagit à un changement d'affichage principal de contenu. * * * * Retour : - * * * @@ -286,19 +283,20 @@ GEditorItem *g_menu_bar_new(GObject *ref, GtkAccelGroup *accgroup) * * ******************************************************************************/ -static void update_menu_bar_for_view(GMenuBar *bar, GtkDisplayPanel *panel) +static void change_menubar_current_content(GMenuBar *bar, GLoadedContent *old, GLoadedContent *new) { - update_menu_view_for_view(bar->view, panel, bar); + update_access_for_content_in_menu_binary(new); } /****************************************************************************** * * -* Paramètres : bar = barre de menus à actualiser. * -* panel = composant d'affichage concerné par l'opération. * +* Paramètres : bar = barre de menus à mettre à jour. * +* old = ancienne vue du contenu chargé analysé. * +* new = nouvelle vue du contenu chargé analysé. * * * -* Description : Réagit à un changement de focus des panneaux d'affichage. * +* Description : Lance une actualisation du fait d'un changement de support. * * * * Retour : - * * * @@ -306,23 +304,12 @@ static void update_menu_bar_for_view(GMenuBar *bar, GtkDisplayPanel *panel) * * ******************************************************************************/ -static void notify_focus_change_for_menu_bar(GMenuBar *bar, GtkDisplayPanel *panel) +static void change_menubar_current_view(GMenuBar *bar, GLoadedPanel *old, GLoadedPanel *new) { - const vmpa2t *addr; /* Position courante */ - GEditorItem *item; /* Autre version de l'élément */ - - if (panel != NULL) - addr = gtk_display_panel_get_caret_location(panel); - else - addr = NULL; - - item = G_EDITOR_ITEM(bar); - - update_access_in_menu_edition(item->ref, panel, addr); + update_access_for_view_in_menu_edition(new); - update_access_in_menu_view(item->ref, panel); - - update_access_in_menu_binary(item->ref, panel); + rebuild_menu_view(bar->view, new, bar); + update_access_for_view_in_menu_view(G_EDITOR_ITEM(bar)->ref, new); } @@ -330,8 +317,8 @@ static void notify_focus_change_for_menu_bar(GMenuBar *bar, GtkDisplayPanel *pan /****************************************************************************** * * * Paramètres : bar = barre de menus à actualiser. * -* panel = panneau d'affichage actif ou NULL si aucun. * -* addr = nouvelle adresse du curseur courant. * +* panel = composant d'affichage parcouru. * +* cursor = nouvel emplacement du curseur courant. * * * * Description : Met à jour les accès aux menus en fonction de la position. * * * @@ -341,13 +328,9 @@ static void notify_focus_change_for_menu_bar(GMenuBar *bar, GtkDisplayPanel *pan * * ******************************************************************************/ -static void track_caret_address_for_menu_bar(GMenuBar *bar, GtkDisplayPanel *panel, const vmpa2t *addr) +static void track_caret_address_for_menu_bar(GMenuBar *bar, GLoadedPanel *panel, const GLineCursor *cursor) { - GEditorItem *item; /* Autre version de l'élément */ - - item = G_EDITOR_ITEM(bar); - - update_access_in_menu_edition(item->ref, panel, addr); + update_access_for_cursor_in_menu_edition(panel, cursor); } |