summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkblockview.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkblockview.c')
-rw-r--r--src/gtkext/gtkblockview.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/gtkext/gtkblockview.c b/src/gtkext/gtkblockview.c
index 2584405..1c7ba43 100644
--- a/src/gtkext/gtkblockview.c
+++ b/src/gtkext/gtkblockview.c
@@ -52,6 +52,9 @@ static void gtk_block_view_class_init(GtkBlockViewClass *);
/* Procède à l'initialisation de l'afficheur de bloc assembleur. */
static void gtk_block_view_init(GtkBlockView *);
+/* Réagit à un déplacement de curseur. */
+static bool gtk_block_view_notify_caret_relocation(GtkBlockView *, const GdkRectangle *, const vmpa2t *);
+
/* Assure la gestion des clics de souris sur le composant. */
static gboolean gtk_block_view_button_press_event(GtkBlockView *, GdkEventButton *, gpointer);
@@ -87,11 +90,15 @@ G_DEFINE_TYPE(GtkBlockView, gtk_block_view, GTK_TYPE_BUFFER_VIEW)
static void gtk_block_view_class_init(GtkBlockViewClass *class)
{
GtkViewPanelClass *panel_class; /* Classe parente */
+ GtkBufferViewClass *buffer_class; /* Classe supérieure */
panel_class = GTK_VIEW_PANEL_CLASS(class);
+ buffer_class = GTK_BUFFER_VIEW_CLASS(class);
panel_class->attach = (attach_binary_fc)gtk_block_view_attach_binary;
+ buffer_class->notify_caret = (notify_caret_relocation_fc)gtk_block_view_notify_caret_relocation;
+
}
@@ -109,8 +116,35 @@ static void gtk_block_view_class_init(GtkBlockViewClass *class)
static void gtk_block_view_init(GtkBlockView *view)
{
+
+
+ /*
g_signal_connect(G_OBJECT(view), "button_press_event",
G_CALLBACK(gtk_block_view_button_press_event), NULL);
+ */
+
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : view = composant GTK à manipuler. *
+* area = emplacement pour le dessin d'un curseur. *
+* addr = position dans la mémoire représentée du curseur. *
+* *
+* Description : Réagit à un déplacement de curseur. *
+* *
+* Retour : true si un changement a été opéré. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static bool gtk_block_view_notify_caret_relocation(GtkBlockView *view, const GdkRectangle *area, const vmpa2t *addr)
+{
+ return g_buffer_view_highlight_segments(GTK_BUFFER_VIEW(view)->buffer_view, area->x, area->y,
+ GTK_VIEW_PANEL(view)->display);
}
@@ -174,7 +208,7 @@ static gboolean gtk_block_view_button_press_event(GtkBlockView *view, GdkEventBu
gtk_buffer_view_compute_real_coord(bview, &real_x, &real_y);
- g_buffer_view_highlight_segments(gtk_buffer_view_get_buffer(bview), real_x, real_y);
+ g_buffer_view_highlight_segments(gtk_buffer_view_get_buffer(bview), real_x, real_y, NULL);