diff options
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/dockstation.c | 51 | ||||
-rw-r--r-- | src/gtkext/dockstation.h | 4 | ||||
-rw-r--r-- | src/gtkext/grid.c | 29 | ||||
-rw-r--r-- | src/gtkext/grid.h | 3 | ||||
-rw-r--r-- | src/gtkext/panel-int.h | 4 | ||||
-rw-r--r-- | src/gtkext/panel.c | 26 | ||||
-rw-r--r-- | src/gtkext/panel.h | 2 |
7 files changed, 116 insertions, 3 deletions
diff --git a/src/gtkext/dockstation.c b/src/gtkext/dockstation.c index 359e3a1..80bae75 100644 --- a/src/gtkext/dockstation.c +++ b/src/gtkext/dockstation.c @@ -259,7 +259,7 @@ GtkWidget *gtk_dock_station_new(void) /****************************************************************************** * * -* Paramètres : station = station d'accueil pour panneau à compléter. * +* Paramètres : station = station d'accueil pour panneaux à compléter. * * panel = nouveau panneau à afficher. * * * * Description : Ajoute un panneau à un groupe de tuiles. * @@ -293,7 +293,7 @@ void gtk_dock_station_add_panel(GtkDockStation *station, GtkTiledPanel *panel) /****************************************************************************** * * -* Paramètres : station = station d'accueil pour panneau à compléter. * +* Paramètres : station = station d'accueil pour panneaux à compléter. * * panel = nouveau panneau à afficher. * * * * Description : Ajoute un panneau à conserver à un groupe de tuiles. * @@ -332,7 +332,7 @@ void gtk_dock_station_keep_panel(GtkDockStation *station, GtkTiledPanel *panel) /****************************************************************************** * * -* Paramètres : station = station d'accueil pour panneau à consulter. * +* Paramètres : station = station d'accueil pour panneaux à consulter. * * * * Description : Indique si la station d'accueil contient au moins un panneau.* * * @@ -361,6 +361,51 @@ bool gtk_dock_station_is_empty(const GtkDockStation *station) } +/****************************************************************************** +* * +* Paramètres : station = station d'accueil pour panneaux à manipuler. * +* main = panneau principal visé par l'opération. * +* activated = nature du changement de statut : ajout, retrait ?* +* * +* Description : Note un ajout ou un retrait de panneau principal. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_dock_station_notify_new_main_panel_state(const GtkDockStation *station, GtkTiledPanel *main, bool activated) +{ + GListModel *list; /* Liste de pages à parcourir */ + guint count; /* Nombre de pages */ + guint i; /* Boucle de parcours */ + GtkStackPage *page; /* Page à consulter */ + GtkWidget *panel; /* Panneau intégré */ + + list = G_LIST_MODEL(gtk_stack_get_pages(station->stack)); + + count = g_list_model_get_n_items(list); + + for (i = 0; i < count; i++) + { + page = GTK_STACK_PAGE(g_list_model_get_object(list, i)); + if (page == NULL) continue; + + panel = gtk_stack_page_get_child(page); + + gtk_tiled_panel_notify_new_main_panel_state(GTK_TILED_PANEL(panel), main, activated); + + unref_object(page); + + } + + unref_object(list); + +} + + + /* ---------------------------------------------------------------------------------- */ /* IMPLEMENTATION DES FONCTIONS DE CLASSE */ /* ---------------------------------------------------------------------------------- */ diff --git a/src/gtkext/dockstation.h b/src/gtkext/dockstation.h index 3106dae..e4c849f 100644 --- a/src/gtkext/dockstation.h +++ b/src/gtkext/dockstation.h @@ -50,6 +50,10 @@ void gtk_dock_station_keep_panel(GtkDockStation *, GtkTiledPanel *); /* Indique si la station d'accueil contient au moins un panneau. */ bool gtk_dock_station_is_empty(const GtkDockStation *); +/* Note un ajout ou un retrait de panneau principal. */ +void gtk_dock_station_notify_new_main_panel_state(const GtkDockStation *, GtkTiledPanel *, bool); + + #if 0 diff --git a/src/gtkext/grid.c b/src/gtkext/grid.c index afc74b7..eb3cdf9 100644 --- a/src/gtkext/grid.c +++ b/src/gtkext/grid.c @@ -544,6 +544,35 @@ void gtk_tiling_grid_add_panel(GtkTilingGrid *grid, GtkTiledPanel *panel, bool k /****************************************************************************** * * +* Paramètres : grid = zone d'affichage en tuiles à manipuler. * +* main = panneau principal visé par l'opération. * +* activated = nature du changement de statut : ajout, retrait ?* +* * +* Description : Note un ajout ou un retrait de panneau principal. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_tiling_grid_notify_new_main_panel_state(const GtkTilingGrid *grid, GtkTiledPanel *main, bool activated) +{ + gtk_dock_station_notify_new_main_panel_state(grid->top_station, main, activated); + + gtk_dock_station_notify_new_main_panel_state(grid->left_station, main, activated); + + gtk_dock_station_notify_new_main_panel_state(grid->main_station, main, activated); + + gtk_dock_station_notify_new_main_panel_state(grid->right_station, main, activated); + + gtk_dock_station_notify_new_main_panel_state(grid->bottom_station, main, activated); + +} + + +/****************************************************************************** +* * * Paramètres : station = plateforme GTK ayant connu un changement. * * widget = nouvel élément à intégrer. * * grid = gestionnaire de placement en tuile concerné. * diff --git a/src/gtkext/grid.h b/src/gtkext/grid.h index f02cf38..fd98035 100644 --- a/src/gtkext/grid.h +++ b/src/gtkext/grid.h @@ -66,6 +66,9 @@ bool gtk_tiling_grid_get_visible(GtkTilingGrid *, TilingGridBorder); /* Ajoute un panneau à un conteneur en tuiles. */ void gtk_tiling_grid_add_panel(GtkTilingGrid *, GtkTiledPanel *, bool); +/* Note un ajout ou un retrait de panneau principal. */ +void gtk_tiling_grid_notify_new_main_panel_state(const GtkTilingGrid *, GtkTiledPanel *, bool); + /* --------------------- FORME GENERIQUE DE MISE EN DISPOSITION --------------------- */ diff --git a/src/gtkext/panel-int.h b/src/gtkext/panel-int.h index cb210d9..5398e51 100644 --- a/src/gtkext/panel-int.h +++ b/src/gtkext/panel-int.h @@ -36,6 +36,8 @@ typedef char * (* get_tiled_panel_path) (const GtkTiledPanel *); /* Fournit les composants adaptés pour la barre de titre. */ typedef GListStore * (* get_tiled_panel_widgets_cb) (const GtkTiledPanel *, bool); +/* Note un ajout ou un retrait de panneau principal. */ +typedef void (* notify_tiled_panel_state_cb) (GtkTiledPanel *, GtkTiledPanel *, bool); /* Elément réactif pour panneaux de l'éditeur (instance) */ @@ -53,6 +55,8 @@ struct _GtkTiledPanelClass get_tiled_panel_path get_default_path; /* Localisation de l'affichage */ get_tiled_panel_widgets_cb get_widgets; /* Récupération de composants */ + notify_tiled_panel_state_cb notify; /* Note d'un ajout ou retrait */ + }; diff --git a/src/gtkext/panel.c b/src/gtkext/panel.c index 48019dc..f63cfa1 100644 --- a/src/gtkext/panel.c +++ b/src/gtkext/panel.c @@ -193,6 +193,32 @@ GListStore *gtk_tiled_panel_get_title_widgets(const GtkTiledPanel *panel, bool l } +/****************************************************************************** +* * +* Paramètres : panel = panneau graphique à manipuler. * +* main = panneau principal visé par l'opération. * +* activated = nature du changement de statut : ajout, retrait ?* +* * +* Description : Note un ajout ou un retrait de panneau principal. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_tiled_panel_notify_new_main_panel_state(GtkTiledPanel *panel, GtkTiledPanel *main, bool activated) +{ + GtkTiledPanelClass *class; /* Classe à actionner */ + + class = GTK_TILED_PANEL_GET_CLASS(panel); + + if (class->notify != NULL) + class->notify(panel, main, activated); + +} + + diff --git a/src/gtkext/panel.h b/src/gtkext/panel.h index 3b0361e..9b00657 100644 --- a/src/gtkext/panel.h +++ b/src/gtkext/panel.h @@ -44,6 +44,8 @@ char *gtk_tiled_panel_get_path(const GtkTiledPanel *); /* Fournit les composants adaptés pour la barre de titre. */ GListStore *gtk_tiled_panel_get_title_widgets(const GtkTiledPanel *, bool); +/* Note un ajout ou un retrait de panneau principal. */ +void gtk_tiled_panel_notify_new_main_panel_state(GtkTiledPanel *, GtkTiledPanel *, bool); |