Lines 1-64
Link Here
|
1 |
--- libgcpcanvas/gcp-canvas-rich-text.c.orig Thu Aug 28 08:12:13 2003 |
|
|
2 |
+++ libgcpcanvas/gcp-canvas-rich-text.c Thu Aug 28 18:07:40 2003 |
3 |
@@ -2101,6 +2101,11 @@ |
4 |
double ax, ay; |
5 |
double x1, y1, x2, y2; |
6 |
ArtPoint ip, cp; |
7 |
+ GdkPixbuf *pxb; |
8 |
+ GdkPixmap* pb; |
9 |
+ GdkGC* gc; |
10 |
+ GdkPixbuf* pixbuf; |
11 |
+ GdkColormap* map; |
12 |
|
13 |
gnome_canvas_buf_ensure_buf (buf); |
14 |
|
15 |
@@ -2149,11 +2154,11 @@ |
16 |
if (y0 + h >= buf->rect.y1 + 1) |
17 |
h = buf->rect.y1 - y0 + 1; |
18 |
if (((int) w == 0) || ((int) h == 0)) return; |
19 |
- GdkPixbuf *pxb = gdk_pixbuf_new_from_data (buf->buf + y * buf->buf_rowstride + x * 3, |
20 |
+ pxb = gdk_pixbuf_new_from_data (buf->buf + y * buf->buf_rowstride + x * 3, |
21 |
GDK_COLORSPACE_RGB, FALSE, 8, (int) w, (int) h, |
22 |
buf->buf_rowstride, NULL, NULL); |
23 |
- GdkPixmap* pb = gdk_pixmap_new (item->canvas->layout.bin_window, (int) w, (int) h, gtk_widget_get_visual ((GtkWidget*) item->canvas)->depth); |
24 |
- GdkGC* gc = gdk_gc_new (pb); |
25 |
+ pb = gdk_pixmap_new (item->canvas->layout.bin_window, (int) w, (int) h, gtk_widget_get_visual ((GtkWidget*) item->canvas)->depth); |
26 |
+ gc = gdk_gc_new (pb); |
27 |
gdk_pixbuf_render_to_drawable (pxb, pb, gc, 0, 0, 0, 0, w, h, GDK_RGB_DITHER_NONE, 0, 0); |
28 |
gtk_text_layout_set_screen_width(text->_priv->layout, x2 - x1); |
29 |
/* FIXME: should last arg be NULL? */ |
30 |
@@ -2166,8 +2171,8 @@ |
31 |
0, 0, x2 - x0, y2 - y0, |
32 |
NULL); |
33 |
|
34 |
- GdkPixbuf* pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, (int) w, (int) h); |
35 |
- GdkColormap* map = gdk_colormap_new (gtk_widget_get_visual ((GtkWidget*) item->canvas), FALSE); |
36 |
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, (int) w, (int) h); |
37 |
+ map = gdk_colormap_new (gtk_widget_get_visual ((GtkWidget*) item->canvas), FALSE); |
38 |
gdk_pixbuf_get_from_drawable (pixbuf, pb, map, 0, 0, 0, 0, (int) w, (int) h); |
39 |
data = gdk_pixbuf_get_pixels (pixbuf); |
40 |
r = gdk_pixbuf_get_rowstride (pixbuf); |
41 |
@@ -2220,18 +2225,20 @@ |
42 |
|
43 |
PangoLayout* gnome_canvas_rich_text_ext_get_pango_layout (GnomeCanvasRichTextExt *text, gint line) |
44 |
{ |
45 |
- g_return_val_if_fail (GNOME_IS_CANVAS_RICH_TEXT_EXT (text), NULL); |
46 |
gint top = 0, bottom, firsty; |
47 |
+ GSList* lines; |
48 |
+ GtkTextLine* text_line; |
49 |
+ g_return_val_if_fail (GNOME_IS_CANVAS_RICH_TEXT_EXT (text), NULL); |
50 |
gtk_text_layout_get_size (text->_priv->layout, NULL, &bottom); |
51 |
if (bottom <= top) return NULL; |
52 |
- GSList* lines = gtk_text_layout_get_lines (text->_priv->layout, top, bottom, &firsty); |
53 |
+ lines = gtk_text_layout_get_lines (text->_priv->layout, top, bottom, &firsty); |
54 |
firsty = 0; |
55 |
while ((firsty < line) && lines) |
56 |
{ |
57 |
lines = lines->next; |
58 |
firsty++; |
59 |
} |
60 |
- GtkTextLine* text_line = (lines)? lines->data: NULL; |
61 |
+ text_line = (lines)? lines->data: NULL; |
62 |
if (text_line) |
63 |
{ |
64 |
GtkTextLineDisplay* display = gtk_text_layout_get_line_display(text->_priv->layout, text_line, TRUE); |