summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-label.c
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2000-09-04 15:05:39 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2000-09-04 15:05:39 +0000
commit93861b3494f85f749a1d3bcc2225720989ca61a5 (patch)
treeb3b6bc6c83c9767f4f94b3236b39d9abfe94e3aa /libnautilus-extensions/nautilus-label.c
parent31cb07f67aeff1c10fb4ebce4fb80b24f566b06c (diff)
downloadnautilus-93861b3494f85f749a1d3bcc2225720989ca61a5.tar.gz
Work on task 1588.
* libnautilus-extensions/nautilus-scalable-font.c: (nautilus_scalable_font_measure_text), (nautilus_scalable_font_draw_text), (nautilus_scalable_font_measure_text_lines), (nautilus_scalable_font_draw_text_lines), (nautilus_scalable_font_measure_text_lines), (nautilus_scalable_font_draw_text_lines), (nautilus_scalable_font_largest_fitting_font_size): * libnautilus-extensions/nautilus-scalable-font.h: Change api to accept a string with embedded new lines instead of an array of strings. This simplifies many things. * libnautilus-extensions/nautilus-label.c: (nautilus_label_initialize), (nautilus_label_destroy), (render_buffer_pixbuf), (label_recompute_line_geometries): Update for NautilusScalalbleFont api changes. No longer need to tokenize the text string. we can feed the string to the rendering api as is. * librsvg/rsvg-ft.c: (rsvg_ft_render_string): * librsvg/rsvg-ft.h: Change the string to glyph rendering api to accept the string length rather than computing it. This makes it possible to feed it arbitrary lengths. * librsvg/rsvg.c: (rsvg_text_handler_characters): * librsvg/test-ft-gtk.c: (draw_line): * librsvg/test-ft.c: (main): Update for api changes. * src/nautilus-about.c: (draw_aa_string): * src/nautilus-sidebar-tabs.c: (draw_one_tab_plain), (draw_one_tab_themed), (get_tab_width): * test/test-nautilus-font.c: (main): Update test to use text lines drawing api. * test/test-nautilus-label.c: (alpha_background_color_value_changed_callback), (main): Update test for 2 new lines in a row.
Diffstat (limited to 'libnautilus-extensions/nautilus-label.c')
-rw-r--r--libnautilus-extensions/nautilus-label.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/libnautilus-extensions/nautilus-label.c b/libnautilus-extensions/nautilus-label.c
index 4e89b14ad..5bfa5137c 100644
--- a/libnautilus-extensions/nautilus-label.c
+++ b/libnautilus-extensions/nautilus-label.c
@@ -61,7 +61,6 @@ struct _NautilusLabelDetail
guint font_size;
/* Text lines */
- char **text_lines;
guint *text_line_widths;
guint *text_line_heights;
guint num_text_lines;
@@ -159,7 +158,6 @@ nautilus_label_initialize (NautilusLabel *label)
label->detail->num_text_lines = 0;
label->detail->max_text_line_width = 0;
label->detail->total_text_line_height = 0;
- label->detail->text_lines = NULL;
label->detail->text_line_widths = NULL;
label->detail->text_line_heights = NULL;
@@ -180,7 +178,6 @@ nautilus_label_destroy (GtkObject *object)
g_free (label->detail->text);
- g_strfreev (label->detail->text_lines);
g_free (label->detail->text_line_widths);
g_free (label->detail->text_line_heights);
@@ -358,11 +355,11 @@ render_buffer_pixbuf (NautilusBufferedWidget *buffered_widget,
&area,
label->detail->font_size,
label->detail->font_size,
- (const char **) label->detail->text_lines,
+ label->detail->text,
+ label->detail->num_text_lines,
label->detail->text_line_widths,
label->detail->text_line_heights,
label->detail->text_justification,
- label->detail->num_text_lines,
label->detail->line_offset,
label->detail->drop_shadow_color,
label->detail->text_alpha);
@@ -379,11 +376,11 @@ render_buffer_pixbuf (NautilusBufferedWidget *buffered_widget,
&area,
label->detail->font_size,
label->detail->font_size,
- (const char **) label->detail->text_lines,
+ label->detail->text,
+ label->detail->num_text_lines,
label->detail->text_line_widths,
label->detail->text_line_heights,
label->detail->text_justification,
- label->detail->num_text_lines,
label->detail->line_offset,
label->detail->text_color,
label->detail->text_alpha);
@@ -396,10 +393,8 @@ label_recompute_line_geometries (NautilusLabel *label)
{
g_return_if_fail (NAUTILUS_IS_LABEL (label));
- g_strfreev (label->detail->text_lines);
g_free (label->detail->text_line_widths);
g_free (label->detail->text_line_heights);
- label->detail->text_lines = NULL;
label->detail->text_line_widths = NULL;
label->detail->text_line_heights = NULL;
@@ -408,20 +403,16 @@ label_recompute_line_geometries (NautilusLabel *label)
label->detail->max_text_line_width = 0;
label->detail->total_text_line_height = 0;
- label->detail->text_lines = NULL;
-
if (nautilus_strlen (label->detail->text) > 0) {
label->detail->num_text_lines = nautilus_str_count_characters (label->detail->text, '\n') + 1;
- label->detail->text_lines = g_strsplit (label->detail->text, "\n", -1);
-
label->detail->text_line_widths = g_new (guint, label->detail->num_text_lines);
label->detail->text_line_heights = g_new (guint, label->detail->num_text_lines);
nautilus_scalable_font_measure_text_lines (label->detail->font,
label->detail->font_size,
label->detail->font_size,
- (const char **) label->detail->text_lines,
+ label->detail->text,
label->detail->num_text_lines,
label->detail->text_line_widths,
label->detail->text_line_heights,