summaryrefslogtreecommitdiff
path: root/src/gui/panels/welcome.c
blob: 0f11b584f790279f5bf01098c6bc01b7c5c4c741 (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

/* Chrysalide - Outil d'analyse de fichiers binaires
 * welcome.c - panneau d'affichage d'accueil
 *
 * Copyright (C) 2012-2014 Cyrille Bagard
 *
 *  This file is part of Chrysalide.
 *
 *  OpenIDA 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.
 *
 *  OpenIDA 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
 */


#include "welcome.h"


#include <string.h>
#include <gtk/gtk.h>


#include "panel-int.h"
#include "../../gtkext/easygtk.h"
#include "../../gtkext/support.h"



/* -------------------------- PARTIE PRINCIPALE DU PANNEAU -------------------------- */


/* Panneau d'aperçu de graphiques (instance) */
struct _GWelcomePanel
{
    GPanelItem parent;                      /* A laisser en premier        */

};


/* Panneau d'aperçu de graphiques (classe) */
struct _GWelcomePanelClass
{
    GPanelItemClass parent;                 /* A laisser en premier        */

};


/* Initialise la classe des panneaux d'accueil. */
static void g_welcome_panel_class_init(GWelcomePanelClass *);

/* Initialise une instance de panneau d'accueil. */
static void g_welcome_panel_init(GWelcomePanel *);



/* ---------------------------------------------------------------------------------- */
/*                            PARTIE PRINCIPALE DU PANNEAU                            */
/* ---------------------------------------------------------------------------------- */


/* Indique le type définit pour un panneau d'accueil. */
G_DEFINE_TYPE(GWelcomePanel, g_welcome_panel, G_TYPE_PANEL_ITEM);


/******************************************************************************
*                                                                             *
*  Paramètres  : klass = classe à initialiser.                                *
*                                                                             *
*  Description : Initialise la classe des panneaux d'accueil.                 *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void g_welcome_panel_class_init(GWelcomePanelClass *klass)
{

}


/******************************************************************************
*                                                                             *
*  Paramètres  : panel = instance à initialiser.                              *
*                                                                             *
*  Description : Initialise une instance de panneau d'accueil.                *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void g_welcome_panel_init(GWelcomePanel *panel)
{
    GtkWidget *support;                     /* Fond du panneau             */
    GtkWidget *align;                       /* Alignement centré           */
    gchar *filename;                        /* Chemin d'accès au fichier   */
    GtkWidget *image;                       /* Image chargée               */
    GEditorItem *base;                      /* Version basique d'instance  */

    support = gtk_handle_box_new();
    //gtk_widget_modify_bg(support, GTK_STATE_NORMAL, &support->style->bg[GTK_STATE_NORMAL]);
    gtk_widget_show(support);

    align = gtk_alignment_new(0.5f, 0.5f, 0.0f, 0.0f);
    gtk_widget_show(align);
    gtk_container_add(GTK_CONTAINER(support), align);

    filename = find_pixmap_file("welcome.png");
    image = qck_create_image(NULL, NULL, filename);
    gtk_container_add(GTK_CONTAINER(align), image);

    base = G_EDITOR_ITEM(panel);
    base->widget = support;

}


/******************************************************************************
*                                                                             *
*  Paramètres  : ref = espace de référencement global.                        *
*                                                                             *
*  Description : Crée un panneau d'accueil.                                   *
*                                                                             *
*  Retour      : Adresse de la structure mise en place.                       *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

GEditorItem *g_welcome_panel_new(GObject *ref)
{
    GEditorItem *result;                    /* Structure à retourner       */

    result = g_object_new(G_TYPE_WELCOME_PANEL, NULL);

    g_panel_item_init_ext(G_PANEL_ITEM(result), ref, PANEL_WELCOME_ID,
                          _("Welcome"), G_EDITOR_ITEM(result)->widget, "M");

    return result;

}


/******************************************************************************
*                                                                             *
*  Paramètres  : ref = espace de référencement global.                        *
*                                                                             *
*  Description : Construit et intègre un panneau d'accueil.                   *
*                                                                             *
*  Retour      : Adresse du panneau mis en place.                             *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

GPanelItem *create_welcome_panel(GObject *ref)
{
    GEditorItem *result;                    /* Elément réactif à renvoyer  */

    result = g_welcome_panel_new(ref);

    /* Enregistre correctement le tout */
    register_editor_item(result);

    return G_PANEL_ITEM(result);

}