summaryrefslogtreecommitdiff
path: root/src/glibext/gcodebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r--src/glibext/gcodebuffer.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index 4ffc15a..4302f14 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -140,6 +140,8 @@ struct _GBufferView
vmpa_t start; /* Première ligne intégrée */
vmpa_t end; /* Dernière ligne intégrée */
+ GFontCache *fcache; /* Cache pour les polices */
+
gint line_height; /* Hauteur maximale des lignes */
gint max_widths[BLC_COUNT]; /* Taille cachée des colonnes */
gint left_margin; /* Marge gauche + espace */
@@ -709,6 +711,7 @@ static void g_buffer_view_class_init(GBufferViewClass *class)
static void g_buffer_view_init(GBufferView *buffer)
{
+ buffer->fcache = g_font_cache_new();
}
@@ -716,6 +719,7 @@ static void g_buffer_view_init(GBufferView *buffer)
/******************************************************************************
* *
* Paramètres : buffer = tampon à représenter à l'écran. *
+* widget = composant GTK de destination pour le rendu. *
* *
* Description : Crée une nouvelle vue d'un tampon pour code désassemblé. *
* *
@@ -1088,7 +1092,7 @@ void g_buffer_view_define_extra_drawing(GBufferView *view, buffer_line_draw_fc m
void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, GdkGC *gc, gint fake_x, gint fake_y, bool addr, bool code)
{
- GdkDrawable *drawable; /* Surface de dessin */
+ cairo_t *cairo; /* Gestionnaire de rendu */
gint real_x; /* Abscisse réelle pour tampon */
gint real_y; /* Ordonnée réelle pour tampon */
@@ -1102,8 +1106,9 @@ void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, Gd
size_t i; /* Boucle de parcours */
- drawable = GDK_DRAWABLE(event->window);
+ cairo = gdk_cairo_create(event->window);
+ gdk_cairo_region(cairo, event->region);
real_x = fake_x + view->left_text;
real_y = fake_y + event->area.y;
@@ -1127,16 +1132,20 @@ void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, Gd
for (i = first; i <= last; i++)
{
/* TODO : skip if... */
-
+ /*
if (view->drawing_extra != NULL)
view->drawing_extra(lines[i], drawable, gc, fake_x, y, view->drawing_data);
+ */
- g_buffer_line_draw(lines[i], drawable, gc, view->max_widths, real_x, y, addr, code);
+ g_buffer_line_draw(lines[i], cairo, view->fcache,
+ view->max_widths, real_x, y, addr, code);
y += view->line_height;
}
+ cairo_destroy(cairo);
+
}