diff options
Diffstat (limited to 'src/gtkext/gtkbufferdisplay.c')
-rw-r--r-- | src/gtkext/gtkbufferdisplay.c | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c index a748cf2..1b452f1 100644 --- a/src/gtkext/gtkbufferdisplay.c +++ b/src/gtkext/gtkbufferdisplay.c @@ -71,9 +71,6 @@ static void gtk_buffer_display_compute_scroll_inc(GtkBufferDisplay *, gint, GtkO /* Réagit à un défilement chez une barre associée au composant. */ static void gtk_buffer_display_adjust_scroll_value(GtkBufferDisplay *, GtkAdjustment *, GtkOrientation); -/* Indique la position courante du curseur. */ -static const vmpa2t *gtk_buffer_display_get_caret_location(const GtkBufferDisplay *); - /* Indique la position d'affichage d'un emplacement donné. */ static bool gtk_buffer_display_get_cursor_coordinates(const GtkBufferDisplay *, const GLineCursor *, gint *, gint *, ScrollPositionTweak); @@ -83,6 +80,9 @@ 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); +/* Fournit le position courante dans un panneau de chargement. */ +static GLineCursor *gtk_buffer_display_get_cursor(const GtkBufferDisplay *); + /* ------------------------------ ANIMATION DU CURSEUR ------------------------------ */ @@ -153,12 +153,13 @@ static void gtk_buffer_display_class_init(GtkBufferDisplayClass *class) panel_class->compute_size = (compute_requested_size_fc)gtk_buffer_display_compute_requested_size; panel_class->compute_inc = (compute_scroll_inc_fc)gtk_buffer_display_compute_scroll_inc; 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_coordinates_fc)gtk_buffer_display_get_cursor_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; + panel_class->get_cursor = (get_cursor_fc)gtk_buffer_display_get_cursor; + /* Signaux */ g_signal_new("reach-limit", @@ -649,25 +650,6 @@ static void gtk_buffer_display_adjust_scroll_value(GtkBufferDisplay *display, Gt /****************************************************************************** * * -* Paramètres : display = composant GTK à manipuler. * -* * -* Description : Indique la position courante du curseur. * -* * -* Retour : Emplacement courant du curseur ou NULL si aucun. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static const vmpa2t *gtk_buffer_display_get_caret_location(const GtkBufferDisplay *display) -{ - return &display->caret_addr; - -} - - -/****************************************************************************** -* * * Paramètres : display = composant GTK à consulter. * * cursor = emplacement à présenter à l'écran. * * x = position horizontale au sein du composant. [OUT] * @@ -791,6 +773,35 @@ static void gtk_buffer_display_cache_glance(GtkBufferDisplay *display, cairo_t * * * * Paramètres : display = composant GTK à consulter. * * * +* Description : Fournit le position courante dans un panneau de chargement. * +* * +* Retour : Informations relatives à la position du curseur. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static GLineCursor *gtk_buffer_display_get_cursor(const GtkBufferDisplay *display) +{ + GLineCursor *result; /* Contenu à retourner */ + + if (display->cursor != NULL) + { + result = display->cursor; + g_object_ref(G_OBJECT(result)); + } + else + result = g_binary_cursor_new(); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : display = composant GTK à consulter. * +* * * Description : Fournit la vue associée au tampon de lignes courant. * * * * Retour : Vue mise en place. * @@ -989,12 +1000,6 @@ static void gtk_buffer_display_relocate_caret(GtkBufferDisplay *display, const c display->caret = *area; display->cursor = cursor; - ///////////////// - if (cursor != NULL) - g_binary_cursor_get_info(G_BINARY_CURSOR(cursor), &display->caret_addr); - ///////////////// - - if (GTK_BUFFER_DISPLAY_GET_CLASS(display)->notify_caret != NULL) need_redraw = GTK_BUFFER_DISPLAY_GET_CLASS(display)->notify_caret(display, area); else |