Commit d698e3ea authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod

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().
parent 106ddae8
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
......
......@@ -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);
......
......@@ -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,
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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))
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment