summaryrefslogtreecommitdiff
path: root/src/gui/panels/panel.h
blob: b293fd3b36cc9f3e3dcc0c4fe5401ca6438e3926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

/* Chrysalide - Outil d'analyse de fichiers binaires
 * panel.h - prototypes pour la gestion des éléments réactifs spécifiques aux panneaux
 *
 * Copyright (C) 2012-2017 Cyrille Bagard
 *
 *  This file is part of Chrysalide.
 *
 *  Chrysalide is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Chrysalide is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#ifndef _GUI_PANELS_PANEL_H
#define _GUI_PANELS_PANEL_H


#include <stdbool.h>


#include "../editem.h"
#include "../../glibext/configuration.h"
#include "../../gtkext/gtkstatusstack.h"



/* ------------------------- BASE D'UN PANNEAU POUR EDITEUR ------------------------- */


#define G_TYPE_PANEL_ITEM               g_panel_item_get_type()
#define G_PANEL_ITEM(obj)               (G_TYPE_CHECK_INSTANCE_CAST((obj), g_panel_item_get_type(), GPanelItem))
#define G_IS_PANEL_ITEM(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_panel_item_get_type()))
#define G_PANEL_ITEM_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_PANEL_ITEM, GPanelItemClass))
#define G_IS_PANEL_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_PANEL_ITEM))
#define G_PANEL_ITEM_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_PANEL_ITEM, GPanelItemClass))


/* Elément réactif pour panneaux de l'éditeur (instance) */
typedef struct _GPanelItem GPanelItem;

/* Elément réactif pour panneaux de l'éditeur (classe) */
typedef struct _GPanelItemClass GPanelItemClass;


/* Types de panneaux pour éditeur */
typedef enum _PanelItemPersonality
{
    PIP_INVALID,                            /* Information non initialisée */

    PIP_SINGLETON,                          /* Instance unique             */
    PIP_BINARY_VIEW,                        /* Affichage d'un binaire      */
    PIP_OTHER,                              /* Reste du monde              */

    PIP_COUNT

} PanelItemPersonality;


/* Indique le type défini pour un élément destiné à un panneau. */
GType g_panel_item_get_type(void);

/* Crée un élément de panneau réactif. */
GPanelItem *g_panel_item_new(PanelItemPersonality, const char *, const char *, GtkWidget *, bool, const char *);

/* Met en place les bases de la configuration du panneau. */
bool gtk_panel_item_setup_configuration(const GPanelItem *, GGenConfig *);

/* Charge un panneau sur les bases de la configuration fournie. */
bool gtk_panel_item_apply_configuration(GPanelItem *, GGenConfig *);

/* Fournit une indication sur la personnalité du panneau. */
PanelItemPersonality gtk_panel_item_get_personality(const GPanelItem *);

/* Fournit le chemin d'accès à utiliser pour les encapsulations. */
const char *gtk_panel_item_get_path(const GPanelItem *);

/* Définit le chemin d'accès à utiliser pour les encapsulations. */
void gtk_panel_item_set_path(GPanelItem *, const char *);

/* Indique la définition d'un éventuel raccourci clavier. */
const char *gtk_panel_item_get_key_bindings(const GPanelItem *);

/* Place un panneau dans l'ensemble affiché. */
void g_panel_item_dock(GPanelItem *);

/* Définit si le composant repose sur un support de l'éditeur. */
void g_panel_item_set_dock_status(GPanelItem *, bool);

/* Indique si le composant repose sur un support de l'éditeur. */
bool g_panel_item_is_docked(const GPanelItem *);

/* Supprime un panneau de l'ensemble affiché. */
void g_panel_item_undock(GPanelItem *);



/* ---------------------------- AIDE POUR LA MISE A JOUR ---------------------------- */


#define G_TYPE_PANEL_UPDATE            g_panel_update_get_type()
#define G_PANEL_UPDATE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_PANEL_UPDATE, GRoutinesStudy))
#define G_IS_PANEL_UPDATE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_PANEL_UPDATE))
#define G_PANEL_UPDATE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_PANEL_UPDATE, GRoutinesStudyClass))
#define G_IS_PANEL_UPDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_PANEL_UPDATE))
#define G_PANEL_UPDATE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_PANEL_UPDATE, GRoutinesStudyClass))


/* Procédure de mise à jour de panneau graphique (instance) */
typedef struct _GPanelUpdate GPanelUpdate;

/* Procédure de mise à jour de panneau graphique (classe) */
typedef struct _GPanelUpdateClass GPanelUpdateClass;


/* Assure l'étude des routines en différé. */
typedef void (* pu_fallback_cb) (GPanelItem *, GtkStatusStack *, activity_id_t);


/* Indique le type défini pour les tâches d'étude de routines. */
GType g_panel_update_get_type(void);

/* Crée une tâche de mise à jour non bloquante. */
GPanelUpdate *g_panel_update_new(GPanelItem *, const char *, size_t, pu_fallback_cb);



#endif  /* _GUI_PANELS_PANEL_H */