summaryrefslogtreecommitdiff
path: root/src/gui/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-11-12 20:03:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-11-12 20:03:12 (GMT)
commit771f21b9d5dd2b394359304a660418bbc84befda (patch)
tree60d6a9350d388f2db7ad571e6edddf46a99444f2 /src/gui/core
parentde62d34d2dc6135b42af7f8a103c8c7af09fd54f (diff)
Defined a new interface for displaying loaded contents.
Diffstat (limited to 'src/gui/core')
-rw-r--r--src/gui/core/global.c8
-rw-r--r--src/gui/core/global.h6
-rw-r--r--src/gui/core/items.c67
-rw-r--r--src/gui/core/items.h6
4 files changed, 43 insertions, 44 deletions
diff --git a/src/gui/core/global.c b/src/gui/core/global.c
index b4001c6..0d0ec92 100644
--- a/src/gui/core/global.c
+++ b/src/gui/core/global.c
@@ -37,7 +37,7 @@ static GLoadedBinary *_current_binary = NULL;
G_LOCK_DEFINE_STATIC(_cb_mutex);
/* Suivi du panneau d'affichage courant ou NULL */
-static GtkDisplayPanel *_current_view = NULL;
+static GLoadedPanel *_current_view = NULL;
G_LOCK_DEFINE_STATIC(_cv_mutex);
@@ -192,7 +192,7 @@ GLoadedBinary *get_current_binary(void)
* *
******************************************************************************/
-void set_current_view(GtkDisplayPanel *view)
+void set_current_view(GLoadedPanel *view)
{
G_LOCK(_cv_mutex);
@@ -218,9 +218,9 @@ void set_current_view(GtkDisplayPanel *view)
* *
******************************************************************************/
-GtkDisplayPanel *get_current_view(void)
+GLoadedPanel *get_current_view(void)
{
- GtkDisplayPanel *result; /* Instance à retourner */
+ GLoadedPanel *result; /* Instance à retourner */
G_LOCK(_cv_mutex);
diff --git a/src/gui/core/global.h b/src/gui/core/global.h
index e69f743..68aeb8a 100644
--- a/src/gui/core/global.h
+++ b/src/gui/core/global.h
@@ -26,7 +26,7 @@
#include "../../analysis/binary.h"
-#include "../../gtkext/gtkdisplaypanel.h"
+#include "../../glibext/gloadedpanel.h"
#include "../../gtkext/gtkstatusstack.h"
@@ -50,10 +50,10 @@ void set_current_binary(GLoadedBinary *);
GLoadedBinary *get_current_binary(void);
/* Définit l'affichage de binaire courant. */
-void set_current_view(GtkDisplayPanel *);
+void set_current_view(GLoadedPanel *);
/* Fournit l'affichage de binaire courant. */
-GtkDisplayPanel *get_current_view(void);
+GLoadedPanel *get_current_view(void);
/* Définit le support contenant la position active. */
void set_caret_instance(GObject *);
diff --git a/src/gui/core/items.c b/src/gui/core/items.c
index 923a565..ce60bcb 100644
--- a/src/gui/core/items.c
+++ b/src/gui/core/items.c
@@ -35,7 +35,7 @@ static GEditorItem *_editem_list = NULL;
/* Suit les changements de focus des panneaux d'affichage. */
-static gboolean notify_view_panel_focus_change(GtkDisplayPanel *, GdkEventFocus *, gpointer);
+static gboolean notify_view_panel_focus_change(GLoadedPanel *, GdkEventFocus *, gpointer);
/* Lance une procédure de déplacement de la position courante. */
static void start_moving_to_address_in_view_panel(GtkDisplayPanel *, const vmpa2t *, gpointer);
@@ -109,18 +109,13 @@ void change_editor_items_current_binary(GLoadedBinary *binary)
* *
******************************************************************************/
-static gboolean notify_view_panel_focus_change(GtkDisplayPanel *panel, GdkEventFocus *event, gpointer unused)
+static gboolean notify_view_panel_focus_change(GLoadedPanel *panel, GdkEventFocus *event, gpointer unused)
{
GEditorItem *iter; /* Boucle de parcours */
- GEditorItemClass *klass; /* Classe correspondante */
editem_list_for_each(iter, _editem_list)
{
- klass = G_EDITOR_ITEM_GET_CLASS(iter);
-
- if (klass->notify_focus != NULL)
- klass->notify_focus(iter, event->in ? panel : NULL);
-
+ notify_focus_change_for_editor_item(iter, event->in ? panel : NULL);
}
return FALSE;
@@ -210,9 +205,9 @@ static void track_caret_address_on_view_panel(GtkDisplayPanel *panel, const vmpa
* *
******************************************************************************/
-void change_editor_items_current_view(GtkDisplayPanel *panel)
+void change_editor_items_current_view(GLoadedPanel *panel)
{
- GtkDisplayPanel *view; /* Affichage actif */
+ GLoadedPanel *view; /* Affichage actif */
GEditorItem *iter; /* Boucle de parcours */
GEditorItemClass *klass; /* Classe correspondante */
GObject *caret; /* Support du curseur actif */
@@ -249,36 +244,40 @@ void change_editor_items_current_view(GtkDisplayPanel *panel)
/* Suivi du curseur */
- caret = get_caret_instance();
-
- if (caret != NULL)
+ if (GTK_IS_DISPLAY_PANEL(panel))
{
- g_signal_handlers_disconnect_by_func(caret,
- G_CALLBACK(start_moving_to_address_in_view_panel),
- NULL);
- g_signal_handlers_disconnect_by_func(caret,
- G_CALLBACK(track_caret_address_on_view_panel),
- NULL);
+ caret = get_caret_instance();
- set_caret_instance(NULL);
- g_object_unref(caret);
+ if (caret != NULL)
+ {
+ g_signal_handlers_disconnect_by_func(caret,
+ G_CALLBACK(start_moving_to_address_in_view_panel),
+ NULL);
+ g_signal_handlers_disconnect_by_func(caret,
+ G_CALLBACK(track_caret_address_on_view_panel),
+ NULL);
- }
+ set_caret_instance(NULL);
+ g_object_unref(caret);
- if (panel != NULL)
- {
- g_signal_connect(panel, "move-request",
- G_CALLBACK(start_moving_to_address_in_view_panel),
- NULL);
+ }
+
+ if (panel != NULL)
+ {
+ g_signal_connect(panel, "move-request",
+ G_CALLBACK(start_moving_to_address_in_view_panel),
+ NULL);
+
+ g_signal_connect(panel, "caret-moved",
+ G_CALLBACK(track_caret_address_on_view_panel),
+ NULL);
- g_signal_connect(panel, "caret-moved",
- G_CALLBACK(track_caret_address_on_view_panel),
- NULL);
+ caret = G_OBJECT(panel);
- caret = G_OBJECT(panel);
+ g_object_ref(caret);
+ set_caret_instance(caret);
- g_object_ref(caret);
- set_caret_instance(caret);
+ }
}
@@ -297,7 +296,7 @@ void change_editor_items_current_view(GtkDisplayPanel *panel)
* *
******************************************************************************/
-void change_editor_items_current_view_content(GtkDisplayPanel *panel)
+void change_editor_items_current_view_content(GLoadedPanel *panel)
{
GEditorItem *iter; /* Boucle de parcours */
GEditorItemClass *klass; /* Classe correspondante */
diff --git a/src/gui/core/items.h b/src/gui/core/items.h
index fc73b5e..13c3d9c 100644
--- a/src/gui/core/items.h
+++ b/src/gui/core/items.h
@@ -28,7 +28,7 @@
#include "../editem.h"
#include "../../analysis/binary.h"
#include "../../analysis/project.h"
-#include "../../gtkext/gtkdisplaypanel.h"
+#include "../../glibext/gloadedpanel.h"
@@ -39,10 +39,10 @@ void register_editor_item(GEditorItem *);
void change_editor_items_current_binary(GLoadedBinary *);
/* Lance une actualisation du fait d'un changement de vue. */
-void change_editor_items_current_view(GtkDisplayPanel *);
+void change_editor_items_current_view(GLoadedPanel *);
/* Lance une actualisation du fait d'un changement de contenu. */
-void change_editor_items_current_view_content(GtkDisplayPanel *);
+void change_editor_items_current_view_content(GLoadedPanel *);
/* Concentre l'attention de l'ensemble sur une adresse donnée. */
void focus_address_in_editor_items(GLoadedBinary *, const vmpa2t *, GEditorItem *);