summaryrefslogtreecommitdiff
path: root/src/gui/panels/panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/panels/panel.c')
-rw-r--r--src/gui/panels/panel.c577
1 files changed, 277 insertions, 300 deletions
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index b13c074..f70a1ab 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -32,6 +32,7 @@
#include "log.h"
#include "panel-int.h"
#include "symbols.h"
+#include "welcome.h"
#include "../../gtkext/easygtk.h"
#include "../../gtkext/gtkdockstation.h"
@@ -39,6 +40,7 @@
/* Support de fond pour les composants. */
static GtkWidget *_support;
+static panel_node *_nodes = NULL;
/* Procédure à appeler lors des changements de panneaux. */
static GCallback _handler;
@@ -54,20 +56,28 @@ static void g_panel_item_class_init(GPanelItemClass *);
/* Initialise une instance d'élément réactif pour l'éditeur. */
static void g_panel_item_init(GPanelItem *);
-/* Renvoie un élément du chemin d'insertion du panneau. */
-static char g_panel_item_get_path_at(GPanelItem *, size_t);
-/* Détermine le support faisant office d'étendue donnée. */
-static GtkWidget *get_panel_given_part(GtkWidget *, size_t, char);
-/* Fournit le premier morceau de chemin rencontré. */
-static char get_first_path_found(GtkWidget *, size_t);
+/* ---------------------- MECANISMES DE PLACEMENT DES PANNEAUX ---------------------- */
-/* Introduit une nouvelle division sur le support indiqué. */
-static void create_panel_division(GtkWidget *, GtkWidget *, const char *, GtkWidget *, const char *, char);
-/* Place un panneau dans l'ensemble affiché. */
-static void _g_panel_item_dock(GtkWidget *, GEditorItem *, const char *, size_t);
+/* Crée un nouveau noeud pour un panneau particulier. */
+static panel_node *create_simple_panel_node_for_item(GPanelItem *, const char *, size_t);
+
+/* Prépare une nouvelle sous-division pour deux panneaux. */
+static void switch_panel_node_into_paned(panel_node *, bool, bool);
+
+/* Met en place un nouveau noeud dans une division. */
+static void attach_panel_node_to_paned(panel_node *, panel_node *, bool);
+
+/* Indique si un noeud correspond à la branche recherchée. */
+static bool is_panel_node_matching(const panel_node *, char);
+
+/* Place au bon endroit un panneau donné. */
+static void insert_item_as_panel_node(GPanelItem *, panel_node *, const char *, size_t);
+
+/* Met à jour l'affichage suite à un changement hiérarchique. */
+static void rebuild_panels_interface(const panel_node *);
@@ -168,43 +178,19 @@ void g_panel_item_init_ext(GPanelItem *item, GObject *ref, const char *name, con
* *
******************************************************************************/
-GEditorItem *g_panel_item_new(const char *name, const char *lname, GtkWidget *widget, const char *path)
+GEditorItem *g_panel_item_new(GObject *ref, const char *name, const char *lname, GtkWidget *widget, const char *path)
{
GPanelItem *result; /* Structure à retourner */
result = g_object_new(G_TYPE_PANEL_ITEM, NULL);
- g_panel_item_init_ext(result, NULL/* FIXME */, name, lname, widget, path);
+ g_panel_item_init_ext(result, ref, name, lname, widget, path);
return G_EDITOR_ITEM(result);
}
-
-/******************************************************************************
-* *
-* Paramètres : item = composant d'affichage à consulter. *
-* pos = position de la tête de lecture dans le chemin. *
-* *
-* Description : Renvoie un élément du chemin d'insertion du panneau. *
-* *
-* Retour : Lettre caractéristique ou '\0'. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static char g_panel_item_get_path_at(GPanelItem *item, size_t pos)
-{
- if (pos >= strlen(item->path))
- return '\0';
- else
- return item->path[pos];
-
-}
-
-
/******************************************************************************
* *
* Paramètres : name = désignation courte servant de clef. *
@@ -248,37 +234,13 @@ GPanelItem *g_panel_item_get(const char *name)
void g_panel_item_dock(GPanelItem *item)
{
- GPanelItemClass *class; /* Encadrement global */
- GtkWidget *station; /* Premier support concentré */
- GEditorItem *editem; /* Autre vision des choses */
-
- class = G_PANEL_ITEM_GET_CLASS(item);
-
/* Tout est à faire... */
- if (class->first == NULL)
+ if (_nodes == NULL)
{
- /**
- * Note : on crée ici un support qui ne sera jamais déplacé,
- * laissant ainsi la variable 'class->first' pour les départs
- * de parcours toujours valide sans effort.
- */
- class->first = GTK_BIN(qck_create_padded_alignment(0, 0, 0, 0));
-
- gtk_widget_show(GTK_WIDGET(class->first));
- gtk_container_add(GTK_CONTAINER(_support), GTK_WIDGET(class->first));
-
- station = gtk_dock_station_new();
- g_signal_connect(station, "switch-widget", _handler, _data);
-
- gtk_widget_show(station);
- gtk_container_add(GTK_CONTAINER(class->first), station);
-
- editem = G_EDITOR_ITEM(item);
- gtk_dock_panel_add_widget(GTK_DOCK_STATION(station),
- editem->widget, editem->name);
-
+ _nodes = create_simple_panel_node_for_item(item, item->path, 0);
+ gtk_container_add(GTK_CONTAINER(_support), _nodes->station);
}
- else _g_panel_item_dock(gtk_bin_get_child(class->first), G_EDITOR_ITEM(item), item->path, 0);
+ else insert_item_as_panel_node(item, _nodes, item->path, 0);
}
@@ -307,93 +269,110 @@ void g_panel_item_undock(GPanelItem *item)
}
+
+/* ---------------------------------------------------------------------------------- */
+/* PLACEMENTS DES DIFFERENTS PANNEAUX */
+/* ---------------------------------------------------------------------------------- */
+
+
/******************************************************************************
* *
-* Paramètres : base = support sujet à analyse. *
-* pos = position de la tête de lecture dans le chemin. *
-* target = indentifiant de positionnement recherché. *
+* Paramètres : handler = procédure à réveiller en cas de changements. *
+* data = donnée à faire suivre. *
* *
-* Description : Détermine le support faisant office d'étendue donnée. *
+* Description : Prépare le terrain pour l'affichage central. *
* *
-* Retour : Composant en place retrouvé ou NULL si aucune correspondance.*
+* Retour : Composant de support sur lequel tout va se placer. *
* *
* Remarques : - *
* *
******************************************************************************/
-static GtkWidget *get_panel_given_part(GtkWidget *base, size_t pos, char target)
+GtkWidget *init_panels2(GCallback handler, gpointer data)
{
- GtkWidget *result; /* Trouvaille à retourner */
- GtkWidget *widget; /* Autre composant présent */
- GPanelItem *item; /* Autre version de l'instance */
- char path; /* Partie de chemin en place */
+ GtkWidget *result; /* Support à retourner */
- if (GTK_IS_DOCK_STATION(base))
- {
- widget = gtk_dock_panel_get_widget(GTK_DOCK_STATION(base), 0);
- item = G_PANEL_ITEM(g_object_get_data(G_OBJECT(widget), "pitem"));
+ result = qck_create_padded_alignment(0, 0, 0, 0);
+ gtk_widget_show(result);
- path = g_panel_item_get_path_at(item, pos);
+ _support = result;
+ _handler = handler;
+ _data = data;
- result = (path == target ? base : NULL);
+ return result;
- }
- else
- {
- widget = gtk_paned_get_child1(GTK_PANED(base));
- result = get_panel_given_part(widget, pos, target);
+}
- if (result == NULL)
- {
- widget = gtk_paned_get_child2(GTK_PANED(base));
- result = get_panel_given_part(widget, pos, target);
- }
- }
+/******************************************************************************
+* *
+* Paramètres : ref = espace de référencement global. *
+* *
+* Description : Charge les principaux panneaux de l'éditeur. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
- return result;
+void load_main_panels(GObject *ref)
+{
+ GPanelItem *item; /* Panneau de base à charger */
+
+ item = create_welcome_panel(ref);
+ g_panel_item_dock(item);
+
+ item = create_log_panel(ref);
+ g_panel_item_dock(item);
+
+ item = create_symbols_panel(ref);
+ g_panel_item_dock(item);
}
+/* ---------------------------------------------------------------------------------- */
+/* MECANISMES DE PLACEMENT DES PANNEAUX */
+/* ---------------------------------------------------------------------------------- */
+
+
/******************************************************************************
* *
-* Paramètres : base = support sujet à analyse. *
-* pos = position de la tête de lecture dans le chemin. *
+* Paramètres : item = composant à présenter à l'affichage. *
+* path = partie du chemin représentée ici. *
+* depth = profondeur du chemin utilisé. *
* *
-* Description : Fournit le premier morceau de chemin rencontré. *
+* Description : Crée un nouveau noeud pour un panneau particulier. *
* *
-* Retour : Premier élément de chemin rencontré. *
+* Retour : Structure d'accueil mise en place. *
* *
* Remarques : - *
* *
******************************************************************************/
-static char get_first_path_found(GtkWidget *base, size_t pos)
+static panel_node *create_simple_panel_node_for_item(GPanelItem *item, const char *path, size_t depth)
{
- char result; /* Trouvaille à retourner */
- GtkWidget *widget; /* Autre composant présent */
- GPanelItem *item; /* Autre version de l'instance */
+ panel_node *result; /* Structure à retourner */
+ GtkWidget *station; /* Premier support concentré */
+ GEditorItem *editem; /* Autre vision des choses */
- if (GTK_IS_DOCK_STATION(base))
- {
- widget = gtk_dock_panel_get_widget(GTK_DOCK_STATION(base), 0);
- item = G_PANEL_ITEM(g_object_get_data(G_OBJECT(widget), "pitem"));
+ result = (panel_node *)calloc(1, sizeof(panel_node));
- result = g_panel_item_get_path_at(item, pos);
+ result->path = path[depth];
+ result->depth = depth;
- }
- else
- {
- /**
- * A un certain niveau, si deux éléments sont groupés,
- * c'est qu'ils ont une base commune ! On ne parcourt donc
- * que le premier d'entre eux.
- */
- widget = gtk_paned_get_child1(GTK_PANED(base));
- result = get_first_path_found(widget, pos);
+ result->simple = true;
- }
+ station = gtk_dock_station_new();
+ g_signal_connect(station, "switch-widget", _handler, _data);
+ gtk_widget_show(station);
+
+ result->station = station;
+
+ editem = G_EDITOR_ITEM(item);
+ gtk_dock_panel_add_widget(GTK_DOCK_STATION(station),
+ editem->widget, editem->name);
return result;
@@ -402,14 +381,11 @@ static char get_first_path_found(GtkWidget *base, size_t pos)
/******************************************************************************
* *
-* Paramètres : parent = support où placer la nouvelle division. *
-* child1 = composant GTK à placer en position 1. *
-* name1 = éventuelle désignation en cas d'isolement. *
-* child2 = composant GTK à placer en position 2. *
-* name2 = éventuelle désignation en cas d'isolement. *
-* orientation = sens de la division. *
+* Paramètres : item = composant à présenter à l'affichage. *
+* horiz = indique le type d'orientation désiré. *
+* first = indication sur l'emplacement à utiliser. *
* *
-* Description : Introduit une nouvelle division sur le support indiqué. *
+* Description : Prépare une nouvelle sous-division pour deux panneaux. *
* *
* Retour : - *
* *
@@ -417,281 +393,282 @@ static char get_first_path_found(GtkWidget *base, size_t pos)
* *
******************************************************************************/
-static void create_panel_division(GtkWidget *parent, GtkWidget *child1, const char *name1, GtkWidget *child2, const char *name2, char orientation)
+static void switch_panel_node_into_paned(panel_node *current, bool horiz, bool first)
{
- unsigned int index; /* Indice de la réinsertion */
- bool resize; /* Redimensionnement à garder */
- GtkWidget *station; /* Nouvelle concentration */
- GtkWidget *paned; /* Nouveau support */
+ panel_node *moved; /* Noeud descendu d'un étage */
+ GtkWidget *widget; /* Composant à traiter */
- orientation = toupper(orientation);
+ /* Descend l'élément actuel */
- /* Détermination de la localisation d'origine */
+ moved = (panel_node *)calloc(1, sizeof(panel_node));
- if (GTK_IS_PANED(parent))
- {
- if (gtk_paned_get_child1(GTK_PANED(parent)) == child1
- || gtk_paned_get_child1(GTK_PANED(parent)) == child2)
- {
- index = 1;
- resize = GTK_PANED(parent)->child1_resize;
- }
- else
- {
- index = 2;
- resize = GTK_PANED(parent)->child2_resize;
- }
- }
+ memcpy(moved, current, sizeof(panel_node));
+ moved->parent = current;
+
+ widget = GET_PANEL_NODE_WIDGET(current);
+
+ g_object_ref(G_OBJECT(widget));
+ gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(widget)), widget);
+
+ if (first)
+ current->first = moved;
else
- {
- index = -1;
- resize = false; /* Pour gcc (Debian 4.4.5-8) 4.4.5 */
- }
+ current->second = moved;
- gtk_widget_ref(name1 == NULL ? child1 : child2);
+ /* Achève la transformation */
- gtk_container_remove(GTK_CONTAINER(parent), child2);
+ current->path = '\0';
- /* Enrobages éventuels */
+ current->simple = false;
- if (!GTK_IS_DOCK_STATION(child1))
- {
- station = gtk_dock_station_new();
- g_signal_connect(station, "switch-widget", _handler, _data);
+ current->station = NULL;
- gtk_widget_show(station);
- gtk_dock_panel_add_widget(GTK_DOCK_STATION(station), child1, name1);
+ if (horiz)
+ current->paned = gtk_hpaned_new();
+ else
+ current->paned = gtk_vpaned_new();
- child1 = station;
+ gtk_widget_show(current->paned);
- }
+ /* Replace le composant d'origine */
- if (!GTK_IS_DOCK_STATION(child2))
- {
- station = gtk_dock_station_new();
- g_signal_connect(station, "switch-widget", _handler, _data);
+ if (first)
+ gtk_paned_add1(GTK_PANED(current->paned), widget);
+ else
+ gtk_paned_add2(GTK_PANED(current->paned), widget);
- gtk_widget_show(station);
- gtk_dock_panel_add_widget(GTK_DOCK_STATION(station), child2, name2);
+ g_object_unref(G_OBJECT(widget));
- child2 = station;
+}
- }
- /* Insertion complète */
+/******************************************************************************
+* *
+* Paramètres : parent = noeud d'accueil pour le nouveau noeud. *
+* node = nouveau noeud à intégrer dans l'ensemble. *
+* first = indication sur l'emplacement à utiliser. *
+* *
+* Description : Met en place un nouveau noeud dans une division. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void attach_panel_node_to_paned(panel_node *parent, panel_node *node, bool first)
+{
+ GtkWidget *widget; /* Composant à traiter */
+
+ /* Raccordement hiérarchique */
- if (orientation == 'N' || orientation == 'S')
- paned = gtk_vpaned_new();
+ if (first)
+ parent->first = node;
else
- paned = gtk_hpaned_new();
+ parent->second = node;
- gtk_widget_show(paned);
+ /* Raccordement graphique */
- switch (index)
- {
- case 1:
- gtk_paned_pack1(GTK_PANED(parent), paned, resize, FALSE);
- break;
- case 2:
- gtk_paned_pack2(GTK_PANED(parent), paned, resize, FALSE);
- break;
- default:
- gtk_container_add(GTK_CONTAINER(parent), paned);
- break;
- }
+ widget = GET_PANEL_NODE_WIDGET(node);
- switch (orientation)
- {
- case 'N':
- break;
- case 'E':
- gtk_paned_pack1(GTK_PANED(paned), child1, TRUE, FALSE);
- gtk_paned_pack2(GTK_PANED(paned), child2, FALSE, FALSE);
- gtk_paned_set_position(GTK_PANED(paned), 450);
- break;
- case 'S':
- gtk_paned_pack1(GTK_PANED(paned), child1, TRUE, FALSE);
- gtk_paned_pack2(GTK_PANED(paned), child2, FALSE, FALSE);
- gtk_paned_set_position(GTK_PANED(paned), 350);
- break;
- case 'W':
- break;
- }
+ if (first)
+ gtk_paned_add1(GTK_PANED(parent->paned), widget);
+ else
+ gtk_paned_add2(GTK_PANED(parent->paned), widget);
}
/******************************************************************************
* *
-* Paramètres : base = départ courant de la déscente. *
-* item = composant à présenter à l'affichage. *
-* path = chemin à consulter pour le placement idéal. *
-* pos = position de la tête de lecture dans le chemin. *
+* Paramètres : node = noeud d'où lancer les recherches. *
+* target = identifiant de la position visée. *
* *
-* Description : Place un panneau dans l'ensemble affiché. *
+* Description : Indique si un noeud correspond à la branche recherchée. *
* *
-* Retour : - *
+* Retour : Bilan de l'évaluation. *
* *
* Remarques : - *
* *
******************************************************************************/
-static void _g_panel_item_dock(GtkWidget *base, GEditorItem *item, const char *path, size_t pos)
+static bool is_panel_node_matching(const panel_node *node, char target)
{
- GtkWidget *part; /* Support principal détecté */
- GtkWidget *widget; /* Autre composant présent */
- GPanelItem *other; /* Autre version de l'instance */
- char path_i; /* Partie de chemin à insérer */
- char path_o; /* Partie de chemin en place */
- GtkWidget *parent; /* Support supérieur */
- char sel_path; /* Chemin à appliquer */
+ if (node->path == target)
+ return true;
+ if (node->simple)
+ return false;
- //printf(" ============== PATH :: '%c' =======================\n", path[pos]);
+ return is_panel_node_matching(node->first, target)
+ || is_panel_node_matching(node->second, target);
- part = get_panel_given_part(base, pos, path[pos]);
+}
- //printf("-- trouve :: %p ( station ?= %d) ( base ?= %d)\n", part, GTK_IS_DOCK_STATION(part), GTK_IS_DOCK_STATION(base));
+/******************************************************************************
+* *
+* Paramètres : item = composant à présenter à l'affichage. *
+* node = point d'insertion courant. *
+* path = partie du chemin représentée ici. *
+* depth = profondeur du chemin utilisé. *
+* *
+* Description : Place au bon endroit un panneau donné. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+static void insert_item_as_panel_node(GPanelItem *item, panel_node *node, const char *path, size_t depth)
+{
+ char div; /* Division demandée */
+ bool horiz; /* Traduction en composant */
+ bool first; /* Point d'insertion */
+ panel_node *new; /* Nouveau noeud créé */
+ panel_node *support; /* Noeud d'accueil désigné */
- if (GTK_IS_DOCK_STATION(part))
+ if (node->simple)
{
+ /* Si on est sur la bonne voie... */
+ if (path[depth] == '\0' || path[depth] == node->path)
+ {
+ /* Le parcours s'arrête ici ! */
+ if (path[depth] == '\0' || path[depth + 1] == '\0')
+ gtk_dock_panel_add_widget(GTK_DOCK_STATION(node->station),
+ G_EDITOR_ITEM(item)->widget,
+ G_EDITOR_ITEM(item)->name);
+ /* On ne peut aller plus loin, on doit diviser... */
+ else
+ {
+ div = toupper(path[depth + 1]);
+ first = (div == 'E' || div == 'S');
+ horiz = (div == 'W' || div == 'E');
- path_i = g_panel_item_get_path_at(G_PANEL_ITEM(item), pos);
+ switch_panel_node_into_paned(node, horiz, first);
- widget = gtk_dock_panel_get_widget(GTK_DOCK_STATION(part), 0);
- other = G_PANEL_ITEM(g_object_get_data(G_OBJECT(widget), "pitem"));
+ new = create_simple_panel_node_for_item(item, path, depth + 1);
- path_o = g_panel_item_get_path_at(other, pos);
+ attach_panel_node_to_paned(node, new, !first);
- //printf(" -- path -- '%c' vs '%c'\n", path_i, path_o);
+ rebuild_panels_interface(node);
+ }
- if (path_i == path_o)
- gtk_dock_panel_add_widget(GTK_DOCK_STATION(part), item->widget, item->name);
+ }
+ /* On ne peut aller plus loin, on doit diviser... */
else
{
- /* On fait primer le chemin d'importance */
- if (path_i == 'M' || (isupper(path_o) && !isupper(path_i)))
- sel_path = path_o;
- else
- sel_path = path_i;
+ div = toupper(path[depth]);
+ first = (div == 'E' || div == 'S');
+ horiz = (div == 'W' || div == 'E');
- parent = gtk_widget_get_parent(base);
- create_panel_division(parent, item->widget, item->name, base, NULL, sel_path);
- }
+ switch_panel_node_into_paned(node, horiz, first);
- }
+ new = create_simple_panel_node_for_item(item, path, depth);
- else if (GTK_IS_PANED(part))
- {
+ attach_panel_node_to_paned(node, new, !first);
+ rebuild_panels_interface(node);
+ }
- printf("Paf Paned !\n");
- exit(0);
+ }
+ /* On regarde des autres côtés... */
- }
+ else if (is_panel_node_matching(node->first, path[depth]))
+ insert_item_as_panel_node(item, node->first, path, depth + (node->first->simple ? 1 : 0));
- /* Si on n'a rien trouvé, alors on redivise */
- else /*if (part == NULL)*/
+ else if (is_panel_node_matching(node->second, path[depth]))
+ insert_item_as_panel_node(item, node->second, path, depth + (node->second->simple ? 1 : 0));
+
+ /* On doit diviser qqch... */
+ else
{
- if (!GTK_IS_DOCK_STATION(base))
+ /* Si l'élément doit passer en force */
+ if (isupper(path[depth]))
{
- path_i = get_first_path_found(gtk_paned_get_child1(GTK_PANED(base)), pos);
- path_o = get_first_path_found(gtk_paned_get_child2(GTK_PANED(base)), pos);
+ div = path[depth];
+ first = (div == 'E' || div == 'S');
+ horiz = (div == 'W' || div == 'E');
- if (path_i == 'M' || (isupper(path_o) && islower(path_i)))
- base = gtk_paned_get_child1(GTK_PANED(base));
- else
- base = gtk_paned_get_child2(GTK_PANED(base));
+ switch_panel_node_into_paned(node, horiz, first);
- }
+ new = create_simple_panel_node_for_item(item, path, depth);
- path_i = g_panel_item_get_path_at(G_PANEL_ITEM(item), pos);
+ attach_panel_node_to_paned(node, new, !first);
- widget = gtk_dock_panel_get_widget(GTK_DOCK_STATION(base), 0);
- other = G_PANEL_ITEM(g_object_get_data(G_OBJECT(widget), "pitem"));
+ rebuild_panels_interface(node);
- path_o = g_panel_item_get_path_at(other, pos);
+ }
- /* On fait primer le chemin d'importance */
- if (path_i == 'M' || (islower(path_i) && isupper(path_o)))
- sel_path = path_o;
else
- sel_path = path_i;
-
- //printf(" ++>> DIR :: '%c' vs '%c' => '%c'\n", path[pos], path_o, sel_path);
+ {
+ if (is_panel_node_matching(node->second, 'M'))
+ support = node->second;
+ else
+ support = node->first;
- parent = gtk_widget_get_parent(base);
- create_panel_division(parent, item->widget, item->name, base, NULL, sel_path);
+ div = toupper(path[depth]);
+ first = (div == 'E' || div == 'S');
+ horiz = (div == 'W' || div == 'E');
- }
+ switch_panel_node_into_paned(support, horiz, first);
+ new = create_simple_panel_node_for_item(item, path, depth);
+ attach_panel_node_to_paned(support, new, !first);
-}
+ rebuild_panels_interface(support);
+ }
+ }
-/* ---------------------------------------------------------------------------------- */
-/* PLACEMENTS DES DIFFERENTS PANNEAUX */
-/* ---------------------------------------------------------------------------------- */
+}
/******************************************************************************
* *
-* Paramètres : handler = procédure à réveiller en cas de changements. *
-* data = donnée à faire suivre. *
+* Paramètres : current = point de départ de la réorganisation graphique. *
* *
-* Description : Prépare le terrain pour l'affichage central. *
+* Description : Met à jour l'affichage suite à un changement hiérarchique. *
* *
-* Retour : Composant de support sur lequel tout va se placer. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-GtkWidget *init_panels2(GCallback handler, gpointer data)
+static void rebuild_panels_interface(const panel_node *current)
{
- GtkWidget *result; /* Support à retourner */
-
- result = qck_create_padded_alignment(0, 0, 0, 0);
- gtk_widget_show(result);
-
- _support = result;
- _handler = handler;
- _data = data;
+ GtkWidget *widget; /* Composant à traiter */
+ panel_node *parent; /* Raccourci confortable */
- return result;
+ widget = GET_PANEL_NODE_WIDGET(current);
-}
+ /* On se trouve à la racine... */
+ if (current->parent == NULL)
+ gtk_container_add(GTK_CONTAINER(_support), widget);
+ /* Sinon, une sous-division ne peut venir que d'une division... */
+ else
+ {
+ /* BUG_ON(parent->simple) */
-/******************************************************************************
-* *
-* Paramètres : ref = espace de référencement global. *
-* *
-* Description : Charge les principaux panneaux de l'éditeur. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
+ parent = current->parent;
-void load_main_panels(GObject *ref)
-{
- GPanelItem *item; /* Panneau de base à charger */
+ if (current == parent->first)
+ gtk_paned_add1(GTK_PANED(parent->paned), widget);
+ else
+ gtk_paned_add2(GTK_PANED(parent->paned), widget);
- item = create_log_panel();
- g_panel_item_dock(item);
+ }
- item = create_symbols_panel(ref);
- g_panel_item_dock(item);
+ //g_object_unref(G_OBJECT(widget));
}