summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-03-25 12:36:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-03-25 12:36:16 (GMT)
commita174ee784f5d9e554ed09181b8e6d8c0205f8ef5 (patch)
treef5ccfb4c41fcb1f237bc285e8e71bc188b7c8b57 /src/gui
parentbbad297e902022ecac9fab21c01dc109560db8eb (diff)
Scrolled to the selected symbol.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@241 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/panels/panel-int.h2
-rw-r--r--src/gui/panels/panel.c13
-rw-r--r--src/gui/panels/panel.h2
-rw-r--r--src/gui/panels/symbols.c33
-rw-r--r--src/gui/panels/symbols.h4
5 files changed, 33 insertions, 21 deletions
diff --git a/src/gui/panels/panel-int.h b/src/gui/panels/panel-int.h
index 186092d..133f1a3 100644
--- a/src/gui/panels/panel-int.h
+++ b/src/gui/panels/panel-int.h
@@ -66,7 +66,7 @@ struct _GPanelItemClass
/* Initialise dynamique les propriétés de l'instance. */
-void g_panel_item_init_ext(GPanelItem *, const char *, const char *, GtkWidget *, const char *);
+void g_panel_item_init_ext(GPanelItem *, GObject *, const char *, const char *, GtkWidget *, const char *);
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index 584ec09..a12c675 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -129,12 +129,15 @@ static void g_panel_item_init(GPanelItem *item)
* *
******************************************************************************/
-void g_panel_item_init_ext(GPanelItem *item, const char *name, const char *lname, GtkWidget *widget, const char *path)
+void g_panel_item_init_ext(GPanelItem *item, GObject *ref, const char *name, const char *lname, GtkWidget *widget, const char *path)
{
GEditorItem *parent; /* Autre version de l'élément */
parent = G_EDITOR_ITEM(item);
+ g_object_ref(ref);
+ parent->ref = ref;
+
parent->name = name;
item->lname = lname;
@@ -171,7 +174,7 @@ GEditorItem *g_panel_item_new(const char *name, const char *lname, GtkWidget *wi
result = g_object_new(G_TYPE_PANEL_ITEM, NULL);
- g_panel_item_init_ext(result, name, lname, widget, path);
+ g_panel_item_init_ext(result, NULL/* FIXME */, name, lname, widget, path);
return G_EDITOR_ITEM(result);
@@ -647,7 +650,7 @@ GtkWidget *init_panels2(GCallback handler, gpointer data)
/******************************************************************************
* *
-* Paramètres : - *
+* Paramètres : ref = espace de référencement global. *
* *
* Description : Charge les principaux panneaux de l'éditeur. *
* *
@@ -657,14 +660,14 @@ GtkWidget *init_panels2(GCallback handler, gpointer data)
* *
******************************************************************************/
-void load_main_panels(void)
+void load_main_panels(GObject *ref)
{
GPanelItem *item; /* Panneau de base à charger */
item = create_log_panel();
g_panel_item_dock(item);
- item = create_symbols_panel();
+ item = create_symbols_panel(ref);
g_panel_item_dock(item);
}
diff --git a/src/gui/panels/panel.h b/src/gui/panels/panel.h
index dd9ae5e..9c6fa89 100644
--- a/src/gui/panels/panel.h
+++ b/src/gui/panels/panel.h
@@ -66,7 +66,7 @@ void g_panel_item_dock(GPanelItem *);
GtkWidget *init_panels2(GCallback, gpointer);
/* Charge les principaux panneaux de l'éditeur. */
-void load_main_panels(void);
+void load_main_panels(GObject *);
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index c0d34a7..aea90fe 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -280,7 +280,7 @@ static void g_symbols_panel_init(GSymbolsPanel *panel)
/******************************************************************************
* *
-* Paramètres : - *
+* Paramètres : ref = espace de référencement global. *
* *
* Description : Crée un panneau d'affichage des symboles. *
* *
@@ -290,14 +290,14 @@ static void g_symbols_panel_init(GSymbolsPanel *panel)
* *
******************************************************************************/
-GEditorItem *g_symbols_panel_new(void)
+GEditorItem *g_symbols_panel_new(GObject *ref)
{
GEditorItem *result; /* Structure à retourner */
result = g_object_new(G_TYPE_SYMBOLS_PANEL, NULL);
- g_panel_item_init_ext(G_PANEL_ITEM(result), PANEL_SYMBOL_ID, _("Binary symbols"),
- G_EDITOR_ITEM(result)->widget, "e");
+ g_panel_item_init_ext(G_PANEL_ITEM(result), ref, PANEL_SYMBOL_ID,
+ _("Binary symbols"), G_EDITOR_ITEM(result)->widget, "e");
return result;
@@ -306,7 +306,7 @@ GEditorItem *g_symbols_panel_new(void)
/******************************************************************************
* *
-* Paramètres : - *
+* Paramètres : ref = espace de référencement global. *
* *
* Description : Construit et intègre un panneau d'affichage des symboles. *
* *
@@ -316,11 +316,11 @@ GEditorItem *g_symbols_panel_new(void)
* *
******************************************************************************/
-GPanelItem *create_symbols_panel(void)
+GPanelItem *create_symbols_panel(GObject *ref)
{
GEditorItem *result; /* Elément réactif à renvoyer */
- result = g_symbols_panel_new();
+ result = g_symbols_panel_new(ref);
/* Enregistre correctement le tout */
result->update_binary = (update_item_binary_fc)change_symbols_panel_current_binary;
@@ -350,15 +350,20 @@ static void on_symbols_selection_change(GtkTreeSelection *selection, GSymbolsPan
GtkTreeModel *model; /* Modèle de gestion */
gchar *string; /* Chaîne sélectionnée */
vmpa_t address; /* Adresse à rejoindre */
- return;
+
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{
gtk_tree_model_get(model, &iter, SBC_ADDRESS, &string, -1);
- address = strtoll(string, NULL, 16); /* FIXME */
- g_free(string);
- /* FIXME */
- //gtk_bin_view_scroll_to_address(panel->binview, address);
+ if (string != NULL)
+ {
+ address = strtoll(string, NULL, 16);
+ g_free(string);
+
+ gtk_view_panel_scroll_to_address(g_editor_item_get_current_view(G_EDITOR_ITEM(panel)),
+ address);
+
+ }
}
@@ -395,7 +400,10 @@ void change_symbols_panel_current_binary(GSymbolsPanel *panel, GOpenidaBinary *b
if (gtk_toggle_tool_button_get_active(button))
reload_symbols_for_new_list_view(panel);
else
+ {
reload_symbols_for_new_tree_view(panel);
+ reorganize_symbols_tree_view(NULL, G_OBJECT(G_EDITOR_ITEM(panel)->widget));
+ }
}
@@ -622,6 +630,7 @@ static void reload_symbols_for_new_tree_view(GSymbolsPanel *panel)
gtk_tree_store_set(panel->store, &iter,
SBC_ICON, pixbuf,
+ SBC_ADDRESS, tmp,
SBC_NAME, _g_binary_routine_to_string(routines[i], options),
-1);
diff --git a/src/gui/panels/symbols.h b/src/gui/panels/symbols.h
index 72801d8..f18a2ea 100644
--- a/src/gui/panels/symbols.h
+++ b/src/gui/panels/symbols.h
@@ -55,10 +55,10 @@ typedef struct _GSymbolsPanelClass GSymbolsPanelClass;
GType g_symbols_panel_get_type(void);
/* Crée un panneau d'affichage des symboles. */
-GEditorItem *g_symbols_panel_new(void);
+GEditorItem *g_symbols_panel_new(GObject *);
/* Construit et intègre un panneau d'affichage des symboles. */
-GPanelItem *create_symbols_panel(void);
+GPanelItem *create_symbols_panel(GObject *);