summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbufferdisplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkbufferdisplay.c')
-rw-r--r--src/gtkext/gtkbufferdisplay.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c
index 3548b3e..d941ff2 100644
--- a/src/gtkext/gtkbufferdisplay.c
+++ b/src/gtkext/gtkbufferdisplay.c
@@ -73,6 +73,9 @@ static const vmpa2t *gtk_buffer_display_get_caret_location(const GtkBufferDispla
/* Indique la position d'affichage d'une adresse donnée. */
static bool gtk_buffer_display_get_address_coordinates(const GtkBufferDisplay *, const vmpa2t *, gint *, gint *, ScrollPositionTweak);
+/* Fournit l'élément actif lié à la position courante. */
+GObject *gtk_buffer_display_get_active_object(const GtkBufferDisplay *);
+
/* Place en cache un rendu destiné à l'aperçu graphique rapide. */
static void gtk_buffer_display_cache_glance(GtkBufferDisplay *, cairo_t *, const GtkAllocation *, double);
@@ -142,6 +145,7 @@ static void gtk_buffer_display_class_init(GtkBufferDisplayClass *class)
panel_class->adjust = (adjust_scroll_value_fc)gtk_buffer_display_adjust_scroll_value;
panel_class->get_caret_loc = (get_caret_location_fc)gtk_buffer_display_get_caret_location;
panel_class->get_coordinates = (get_addr_coordinates_fc)gtk_buffer_display_get_address_coordinates;
+ panel_class->get_active = (get_active_object_fc)gtk_buffer_display_get_active_object;
panel_class->move_caret_to = (move_caret_to_fc)_gtk_buffer_display_move_caret_to;
panel_class->cache_glance = (cache_glance_fc)gtk_buffer_display_cache_glance;
@@ -706,6 +710,36 @@ static bool gtk_buffer_display_get_address_coordinates(const GtkBufferDisplay *d
/******************************************************************************
* *
+* Paramètres : display = composant GTK à consulter. *
+* *
+* Description : Fournit l'élément actif lié à la position courante. *
+* *
+* Retour : Objet actif courant ou NULL si aucun. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GObject *gtk_buffer_display_get_active_object(const GtkBufferDisplay *display)
+{
+ GObject *result; /* Trouvaille à retourner */
+
+ /* Si aucune position n'est définie... */
+ if (is_invalid_vmpa(&display->caret_addr))
+ result = NULL;
+
+ else
+ result = g_buffer_view_find_creator(display->view,
+ display->caret.x, display->caret.y,
+ GTK_DISPLAY_PANEL(display)->display_options);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : display = composant GTK à manipuler. *
* cairo = assistant pour la création de rendus. *
* area = taille de la surface réduite à disposition. *