summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-09-01 21:36:22 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-09-01 21:36:22 (GMT)
commit29ddd755496589e7e1f9e38697e44d3cfe64df5e (patch)
tree3db093a9082276adb96a1ce67d175ade067c0788 /src/gui
parente07a541d1dea13a19a587f2b97d12ed3443f235b (diff)
Added a welcome panel as plugin using Python.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@573 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/project.c2
-rw-r--r--src/gui/panels/Makefile.am3
-rw-r--r--src/gui/panels/panel.c58
-rw-r--r--src/gui/panels/welcome.c173
-rw-r--r--src/gui/panels/welcome.h65
5 files changed, 2 insertions, 299 deletions
diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c
index caf3f64..a68b137 100644
--- a/src/gui/menus/project.c
+++ b/src/gui/menus/project.c
@@ -87,7 +87,7 @@ GtkWidget *build_menu_project(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b
G_CALLBACK(mcb_project_add_shellcode), bar);
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
- deepmenuitem = qck_create_menu_item(NULL, NULL, _("File"),
+ deepmenuitem = qck_create_menu_item(ref, "mnu_project_add_binary", _("File"),
G_CALLBACK(mcb_project_add_binary_file), bar);
gtk_container_add(GTK_CONTAINER(deepmenubar), deepmenuitem);
diff --git a/src/gui/panels/Makefile.am b/src/gui/panels/Makefile.am
index 70cf597..4746210 100644
--- a/src/gui/panels/Makefile.am
+++ b/src/gui/panels/Makefile.am
@@ -9,8 +9,7 @@ libguipanels_la_SOURCES = \
panel.h panel.c \
regedit.h regedit.c \
strings.h strings.c \
- symbols.h symbols.c \
- welcome.h welcome.c
+ symbols.h symbols.c
libguipanels_la_LDFLAGS =
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index 7f18fea..265fcca 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -38,7 +38,6 @@
#include "regedit.h"
#include "strings.h"
#include "symbols.h"
-#include "welcome.h"
#include "../../gtkext/easygtk.h"
#include "../../gtkext/gtkdockable-int.h"
#include "../../gtkext/gtkdockstation.h"
@@ -58,7 +57,6 @@ static GCallback _handler;
static gpointer _data;
/* Liste des panneaux en place. */
-static GPanelItem *_welcome = NULL;
static GPanelItem *_panels_list = NULL;
@@ -133,13 +131,6 @@ static void set_panel_node_size_request(const panel_node *, const GtkRequisition
-/* Surveille les ajouts dans la partie principale. */
-static void on_docking_to_main_panel(GtkDockStation *, GtkWidget *, gpointer);
-
-
-
-
-
/* Indique le type défini pour un élément destiné à un panneau. */
G_DEFINE_TYPE_WITH_CODE(GPanelItem, g_panel_item, G_TYPE_EDITOR_ITEM,
@@ -465,12 +456,6 @@ void load_main_panels(GObject *ref)
{
GPanelItem *item; /* Panneau de base à charger */
- _welcome = create_welcome_panel(ref);
- g_panel_item_dock(_welcome);
-
- g_signal_connect(_nodes->station, "dock-widget",
- G_CALLBACK(on_docking_to_main_panel), NULL);
-
item = create_regedit_panel(ref);
g_panel_item_dock(item);
@@ -1154,46 +1139,3 @@ static void set_panel_node_size_request(const panel_node *node, const GtkRequisi
set_panel_node_size_request(node->second, ALLOC_2_REQ(&allocation));
}
-
-
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MECANISMES DE PLACEMENT DES PANNEAUX */
-/* ---------------------------------------------------------------------------------- */
-
-
-
-
-
-/******************************************************************************
-* *
-* Paramètres : station = base d'accueil pour composants divers. *
-* widget = composant rajouté à l'ensemble. *
-* data = adresse non utilisée ici. *
-* *
-* Description : Surveille les ajouts dans la partie principale. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void on_docking_to_main_panel(GtkDockStation *station, GtkWidget *widget, gpointer data)
-{
-
-
-
-
- g_panel_item_undock(_welcome);
-
-
-
- g_signal_handlers_disconnect_by_func(station,
- G_CALLBACK(on_docking_to_main_panel), NULL);
-
-
-}
-
diff --git a/src/gui/panels/welcome.c b/src/gui/panels/welcome.c
deleted file mode 100644
index fa55fd7..0000000
--- a/src/gui/panels/welcome.c
+++ /dev/null
@@ -1,173 +0,0 @@
-
-/* 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'accueil (instance) */
-struct _GWelcomePanel
-{
- GPanelItem parent; /* A laisser en premier */
-
-};
-
-
-/* Panneau d'accueil (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 *align; /* Alignement centré */
- gchar *filename; /* Chemin d'accès au fichier */
- GtkWidget *image; /* Image chargée */
- GEditorItem *base; /* Version basique d'instance */
-
- align = gtk_alignment_new(0.5f, 0.5f, 0.0f, 0.0f);
- gtk_widget_show(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 = align;
-
-}
-
-
-/******************************************************************************
-* *
-* 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);
-
-}
diff --git a/src/gui/panels/welcome.h b/src/gui/panels/welcome.h
deleted file mode 100644
index 88c17bd..0000000
--- a/src/gui/panels/welcome.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * welcome.h - prototypes pour le panneau d'affichage d'accueil
- *
- * Copyright (C) 2012 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
- */
-
-
-#ifndef _GUI_PANELS_WELCOME_H
-#define _GUI_PANELS_WELCOME_H
-
-
-#include <i18n.h>
-
-
-#include "panel.h"
-
-
-
-#define PANEL_WELCOME_ID _("Welcome")
-
-
-#define G_TYPE_WELCOME_PANEL g_welcome_panel_get_type()
-#define G_WELCOME_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_welcome_panel_get_type(), GWelcomePanel))
-#define G_IS_WELCOME_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_welcome_panel_get_type()))
-#define G_WELCOME_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_WELCOME_PANEL, GWelcomePanelClass))
-#define G_IS_WELCOME_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_WELCOME_PANEL))
-#define G_WELCOME_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_WELCOME_PANEL, GWelcomePanelClass))
-
-
-/* Panneau d'accueil (instance) */
-typedef struct _GWelcomePanel GWelcomePanel;
-
-/* Panneau d'accueil (classe) */
-typedef struct _GWelcomePanelClass GWelcomePanelClass;
-
-
-/* Indique le type définit pour un panneau d'accueil. */
-GType g_welcome_panel_get_type(void);
-
-/* Crée un panneau d'accueil. */
-GEditorItem *g_welcome_panel_new(GObject *);
-
-/* Construit et intègre un panneau d'accueil. */
-GPanelItem *create_welcome_panel(GObject *);
-
-
-
-#endif /* _GUI_PANELS_WELCOME_H */