diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-03-08 21:44:52 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-03-08 21:46:19 (GMT) |
commit | 235b34006d734d55333a182ffd8bbe7fbf8f54bc (patch) | |
tree | f1c8f75391537c8c187aea46c16b3d2642c92107 /src/gui/panels/panel-int.h | |
parent | 02e978d601cdcf2ea9bb39ae21207c3b97d16e22 (diff) |
Loaded a dynamic list of dockable panels in the View menu.
Diffstat (limited to 'src/gui/panels/panel-int.h')
-rw-r--r-- | src/gui/panels/panel-int.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/gui/panels/panel-int.h b/src/gui/panels/panel-int.h index b3a9f10..e902722 100644 --- a/src/gui/panels/panel-int.h +++ b/src/gui/panels/panel-int.h @@ -29,8 +29,7 @@ #include "panel.h" -#include <gtk/gtkbin.h> -#include <gtk/gtkwidget.h> +#include <gtk/gtk.h> #include "../editem-int.h" @@ -45,10 +44,14 @@ struct _GPanelItem DL_LIST_ITEM(link); /* Maillon de liste chaînée */ + PanelItemPersonality personality; /* Nature de l'élément */ + const char *lname; /* Description longue */ const char *path; /* Chemin vers la place idéale */ + bool docked; /* Panneau inscrusté ? */ + }; @@ -57,18 +60,25 @@ typedef struct _panel_node { struct _panel_node *parent; /* Noeud parent */ - char *path; /* Chemin du nom courant */ - size_t depth; /* Profondeur utilisée */ + union + { + GtkWidget *widget; /* Accès généraliste */ + GtkWidget *station; /* Station d'accueil simple */ + GtkWidget *paned; /* Station d'accueil composée */ - bool simple; /* Noeud sans division */ + }; union { - GtkWidget *station; /* Station d'accueil simple */ + /* Version simple */ + struct + { + char *path; /* Chemin du nom courant */ + }; + /* Version composée */ struct { - GtkWidget *paned; /* Station d'accueil composée */ struct _panel_node *first; /* Premier sous élément */ struct _panel_node *second; /* Second sous élément */ }; @@ -78,7 +88,16 @@ typedef struct _panel_node } panel_node; -#define GET_PANEL_NODE_WIDGET(node) (node->simple ? node->station : node->paned) + +#define IS_SIMPLE_NODE(nd) \ + ({ \ + bool __result; \ + __result = GTK_IS_DOCK_STATION(nd->station); \ + assert(__result || GTK_IS_PANED(nd->paned)); \ + __result; \ + }) + + /* Elément réactif pour panneaux de l'éditeur (classe) */ @@ -86,6 +105,9 @@ struct _GPanelItemClass { GEditorItemClass parent; /* A laisser en premier */ + bool unique; /* Panneau instanciable ? */ + const char *bindings; /* Raccourci clavier éventuel */ + GtkBin *first; /* Elément racine */ }; |