diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-12-24 05:29:25 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-12-24 05:29:25 +0000 |
commit | d698e3eaf25357bd6edd7c685dee06787853400e (patch) | |
tree | 2bb73f9f2950884232b3cb3de2e65549385c5611 | |
parent | 106ddae86d5ffd3409901c5f9772b1a01f84ad04 (diff) | |
download | gtk+-d698e3eaf25357bd6edd7c685dee06787853400e.tar.gz |
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
-rw-r--r-- | ChangeLog | 29 | ||||
-rw-r--r-- | gdk/gdkpango.c | 4 | ||||
-rw-r--r-- | gtk/gtkcalendar.c | 2 | ||||
-rw-r--r-- | gtk/gtkentry.c | 8 | ||||
-rw-r--r-- | gtk/gtkiconview.c | 8 | ||||
-rw-r--r-- | gtk/gtklabel.c | 2 | ||||
-rw-r--r-- | gtk/gtkmain.c | 23 | ||||
-rw-r--r-- | gtk/gtkstyle.c | 2 | ||||
-rw-r--r-- | gtk/gtktextdisplay.c | 2 | ||||
-rw-r--r-- | gtk/gtktextlayout.c | 18 | ||||
-rw-r--r-- | gtk/gtktextutil.c | 2 |
11 files changed, 58 insertions, 42 deletions
@@ -1,3 +1,32 @@ +2006-12-24 Behdad Esfahbod <behdad@gnome.org> + + Bug 340141 – Update to Pango 1.16 API + + * gdk/gdkpango.c (layout_iter_get_line_clip_region), + (gdk_pango_layout_line_get_clip_region): + * gtk/gtkcalendar.c (gtk_calendar_size_request): + * gtk/gtkentry.c (gtk_entry_get_pixel_ranges), + (get_layout_position), (gtk_entry_find_position), + (gtk_entry_adjust_scroll): + * gtk/gtkiconview.c (get_pango_text_offsets): + * gtk/gtklabel.c (get_cursor_direction): + * gtk/gtkstyle.c (get_insensitive_layout): + * gtk/gtktextdisplay.c (render_para): + * gtk/gtktextlayout.c (allocate_child_widgets), + (find_display_line_below), (find_display_line_above), + (gtk_text_layout_move_iter_to_previous_line), + (gtk_text_layout_move_iter_to_next_line), + (gtk_text_layout_move_iter_to_line_end), + (gtk_text_layout_iter_starts_line), + (gtk_text_layout_move_iter_to_x): + * gtk/gtktextutil.c (limit_layout_lines): + Use the _readonly version of pango_layout_iter_get_line(), + pango_layout_iter_get_run(), pango_layout_get_line(), and + pango_layout_get_lines(). + + * gtk/gtkmain.c (gtk_get_default_language): Use + pango_get_default_language(). + 2006-12-24 Matthias Clasen <mclasen@redhat.com> * gtk/gtkentry.c (gtk_entry_set_text): Emit changed diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index b282dfb5ad..d04aa9963e 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -1246,7 +1246,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter, gint baseline; gint i; - line = pango_layout_iter_get_line (iter); + line = pango_layout_iter_get_line_readonly (iter); clip_region = gdk_region_new (); @@ -1330,7 +1330,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, g_return_val_if_fail (index_ranges != NULL, NULL); iter = pango_layout_get_iter (line->layout); - while (pango_layout_iter_get_line (iter) != line) + while (pango_layout_iter_get_line_readonly (iter) != line) pango_layout_iter_next_line (iter); clip_region = layout_iter_get_line_clip_region(iter, x_origin, y_origin, index_ranges, n_ranges); diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 5e9f6cada8..91014f081c 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -1643,7 +1643,7 @@ gtk_calendar_size_request (GtkWidget *widget, for (i = 0; i < 7; i++) { pango_layout_set_text (layout, default_abbreviated_dayname[i], -1); - pango_layout_line_get_pixel_extents (pango_layout_get_lines (layout)->data, NULL, &logical_rect); + pango_layout_line_get_pixel_extents (pango_layout_get_lines_readonly (layout)->data, NULL, &logical_rect); priv->min_day_width = MAX (priv->min_day_width, logical_rect.width); priv->max_label_char_ascent = MAX (priv->max_label_char_ascent, diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index b81d3e335d..30d388e389 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1568,7 +1568,7 @@ gtk_entry_get_pixel_ranges (GtkEntry *entry, if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_char, &end_char)) { PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE); - PangoLayoutLine *line = pango_layout_get_lines (layout)->data; + PangoLayoutLine *line = pango_layout_get_lines_readonly (layout)->data; const char *text = pango_layout_get_text (layout); gint start_index = g_utf8_offset_to_pointer (text, start_char) - text; gint end_index = g_utf8_offset_to_pointer (text, end_char) - text; @@ -3394,7 +3394,7 @@ get_layout_position (GtkEntry *entry, area_height = PANGO_SCALE * (area_height - inner_border.top - inner_border.bottom); - line = pango_layout_get_lines (layout)->data; + line = pango_layout_get_lines_readonly (layout)->data; pango_layout_line_get_extents (line, NULL, &logical_rect); /* Align primarily for locale's ascent/descent */ @@ -3616,7 +3616,7 @@ gtk_entry_find_position (GtkEntry *entry, text = pango_layout_get_text (layout); cursor_index = g_utf8_offset_to_pointer (text, entry->current_pos) - text; - line = pango_layout_get_lines (layout)->data; + line = pango_layout_get_lines_readonly (layout)->data; pango_layout_line_x_to_index (line, x * PANGO_SCALE, &index, &trailing); if (index >= cursor_index && entry->preedit_length) @@ -3712,7 +3712,7 @@ gtk_entry_adjust_scroll (GtkEntry *entry) text_area_width = 0; layout = gtk_entry_ensure_layout (entry, TRUE); - line = pango_layout_get_lines (layout)->data; + line = pango_layout_get_lines_readonly (layout)->data; pango_layout_line_get_extents (line, NULL, &logical_rect); diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 45280f63c4..4b028fc4e0 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -7216,7 +7216,7 @@ get_pango_text_offsets (PangoLayout *layout, iter = pango_layout_get_iter (layout); do { - line = pango_layout_iter_get_line (iter); + line = pango_layout_iter_get_line_readonly (iter); start_index = line->start_index; end_index = start_index + line->length; @@ -7257,7 +7257,7 @@ get_pango_text_offsets (PangoLayout *layout, { case ATK_TEXT_BOUNDARY_LINE_START: if (pango_layout_iter_next_line (iter)) - end_index = pango_layout_iter_get_line (iter)->start_index; + end_index = pango_layout_iter_get_line_readonly (iter)->start_index; break; case ATK_TEXT_BOUNDARY_LINE_END: if (prev_line) @@ -7274,13 +7274,13 @@ get_pango_text_offsets (PangoLayout *layout, */ if (pango_layout_iter_next_line (iter)) { - line = pango_layout_iter_get_line (iter); + line = pango_layout_iter_get_line_readonly (iter); switch (boundary_type) { case ATK_TEXT_BOUNDARY_LINE_START: start_index = line->start_index; if (pango_layout_iter_next_line (iter)) - end_index = pango_layout_iter_get_line (iter)->start_index; + end_index = pango_layout_iter_get_line_readonly (iter)->start_index; else end_index = start_index + line->length; break; diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index cfe21cef71..af75a9dff0 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -2327,7 +2327,7 @@ get_cursor_direction (GtkLabel *label) gtk_label_ensure_layout (label); - for (l = pango_layout_get_lines (label->layout); l; l = l->next) + for (l = pango_layout_get_lines_readonly (label->layout); l; l = l->next) { PangoLayoutLine *line = l->data; diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index cddc1e3fde..cbf393bf40 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1089,8 +1089,10 @@ _gtk_get_lc_ctype (void) * effect. (Note that this can change over the life of an * application.) The default language is derived from the current * locale. It determines, for example, whether GTK+ uses the - * right-to-left or left-to-right text direction. See - * _gtk_get_lc_ctype() for notes on behaviour on Windows. + * right-to-left or left-to-right text direction. + * + * This function is equivalent to pango_language_get_default(). See + * that function for details. * * Return value: the default language as a #PangoLanguage, must not be * freed @@ -1098,22 +1100,7 @@ _gtk_get_lc_ctype (void) PangoLanguage * gtk_get_default_language (void) { - gchar *lang; - PangoLanguage *result; - gchar *p; - - lang = _gtk_get_lc_ctype (); - p = strchr (lang, '.'); - if (p) - *p = '\0'; - p = strchr (lang, '@'); - if (p) - *p = '\0'; - - result = pango_language_from_string (lang); - g_free (lang); - - return result; + return pango_language_get_default (); } void diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index ed177917b5..e10f743bd3 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -4938,7 +4938,7 @@ get_insensitive_layout (GdkDrawable *drawable, gboolean need_stipple = FALSE; ByteRange *br; - run = pango_layout_iter_get_run (iter); + run = pango_layout_iter_get_run_readonly (iter); if (run) { diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 1a25f64a2b..d782efdc5c 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -481,7 +481,7 @@ render_para (GtkTextRenderer *text_renderer, do { - PangoLayoutLine *line = pango_layout_iter_get_line (iter); + PangoLayoutLine *line = pango_layout_iter_get_line_readonly (iter); int selection_y, selection_height; int first_y, last_y; PangoRectangle line_rect; diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 5f62e70304..37696fa498 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -1651,7 +1651,7 @@ allocate_child_widgets (GtkTextLayout *text_layout, do { - PangoLayoutRun *run = pango_layout_iter_get_run (iter); + PangoLayoutRun *run = pango_layout_iter_get_run_readonly (iter); if (run && is_shape (run)) { @@ -2565,7 +2565,7 @@ find_display_line_below (GtkTextLayout *layout, do { gint first_y, last_y; - PangoLayoutLine *layout_line = pango_layout_iter_get_line (layout_iter); + PangoLayoutLine *layout_line = pango_layout_iter_get_line_readonly (layout_iter); found_byte = layout_line->start_index; @@ -2636,7 +2636,7 @@ find_display_line_above (GtkTextLayout *layout, do { gint first_y, last_y; - PangoLayoutLine *layout_line = pango_layout_iter_get_line (layout_iter); + PangoLayoutLine *layout_line = pango_layout_iter_get_line_readonly (layout_iter); found_byte = layout_line->start_index; @@ -2767,7 +2767,7 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout, update_byte = TRUE; } - tmp_list = pango_layout_get_lines (display->layout); + tmp_list = pango_layout_get_lines_readonly (display->layout); layout_line = tmp_list->data; if (update_byte) @@ -2793,7 +2793,7 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout, if (display->height > 0) { - tmp_list = g_slist_last (pango_layout_get_lines (display->layout)); + tmp_list = g_slist_last (pango_layout_get_lines_readonly (display->layout)); layout_line = tmp_list->data; line_display_index_to_iter (layout, display, iter, @@ -2879,7 +2879,7 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout, else line_byte = 0; - tmp_list = pango_layout_get_lines (display->layout); + tmp_list = pango_layout_get_lines_readonly (display->layout); while (tmp_list && !found_after) { PangoLayoutLine *layout_line = tmp_list->data; @@ -2939,7 +2939,7 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout, display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); - tmp_list = pango_layout_get_lines (display->layout); + tmp_list = pango_layout_get_lines_readonly (display->layout); while (tmp_list) { PangoLayoutLine *layout_line = tmp_list->data; @@ -2995,7 +2995,7 @@ gtk_text_layout_iter_starts_line (GtkTextLayout *layout, display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); - tmp_list = pango_layout_get_lines (display->layout); + tmp_list = pango_layout_get_lines_readonly (display->layout); while (tmp_list) { PangoLayoutLine *layout_line = tmp_list->data; @@ -3064,7 +3064,7 @@ gtk_text_layout_move_iter_to_x (GtkTextLayout *layout, do { - PangoLayoutLine *layout_line = pango_layout_iter_get_line (layout_iter); + PangoLayoutLine *layout_line = pango_layout_iter_get_line_readonly (layout_iter); if (line_byte < layout_line->start_index + layout_line->length || pango_layout_iter_at_last_line (layout_iter)) diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 11758778d7..1f7b93128b 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -157,7 +157,7 @@ limit_layout_lines (PangoLayout *layout) { text = pango_layout_get_text (layout); str = g_string_new (NULL); - lines = pango_layout_get_lines (layout); + lines = pango_layout_get_lines_readonly (layout); /* get first lines */ elem = lines; |