fix fallout from struct GtkEntry API change

This commit is contained in:
tnn 2009-11-01 16:41:34 +00:00
parent 20b9e93940
commit e6c21728b2
3 changed files with 120 additions and 3 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.17 2009/08/26 19:57:13 sno Exp $
# $NetBSD: Makefile,v 1.18 2009/11/01 16:41:34 tnn Exp $
DISTNAME= geda-gattrib-${PKGVERSION}
PKGNAME= gattrib-${PKGVERSION}
PKGREVISION= 2
PKGREVISION= 3
CATEGORIES= cad
MAINTAINER= dmcmahill@NetBSD.org
@ -21,5 +21,6 @@ GNU_CONFIGURE= YES
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
.include "../../sysutils/desktop-file-utils/desktopdb.mk"
BUILDLINK_API_DEPENDS.gtk+= gtk2+>=2.18.3
.include "../../x11/gtk2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.17 2009/02/01 05:20:00 dmcmahill Exp $
$NetBSD: distinfo,v 1.18 2009/11/01 16:41:34 tnn Exp $
SHA1 (geda/geda-gattrib-1.4.3.tar.gz) = f3886a41abaddd444eea21e4000b5c495accb85c
RMD160 (geda/geda-gattrib-1.4.3.tar.gz) = 9063e498824bebe57bad18ca99bdf4b02aae1060
Size (geda/geda-gattrib-1.4.3.tar.gz) = 326641 bytes
SHA1 (patch-aa) = 54bb3f5648b671a7abbee8d6e9bc30d13133f725

View file

@ -0,0 +1,115 @@
$NetBSD: patch-aa,v 1.7 2009/11/01 16:41:34 tnn Exp $
--- src/gtkitementry_2_2.c.orig 2009-01-01 00:15:58.000000000 +0100
+++ src/gtkitementry_2_2.c
@@ -1,3 +1,4 @@
+
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
@@ -811,23 +812,23 @@ gtk_entry_real_insert_text (GtkEditable
new_text_length = g_utf8_offset_to_pointer (new_text, n_chars) - new_text;
}
- if (new_text_length + entry->n_bytes + 1 > entry->text_size)
+ if (new_text_length + entry->x_n_bytes + 1 > entry->x_text_size)
{
- while (new_text_length + entry->n_bytes + 1 > entry->text_size)
+ while (new_text_length + entry->x_n_bytes + 1 > entry->x_text_size)
{
- if (entry->text_size == 0)
- entry->text_size = MIN_SIZE;
+ if (entry->x_text_size == 0)
+ entry->x_text_size = MIN_SIZE;
else
{
- if (2 * (guint)entry->text_size < MAX_SIZE &&
- 2 * (guint)entry->text_size > entry->text_size)
- entry->text_size *= 2;
+ if (2 * (guint)entry->x_text_size < MAX_SIZE &&
+ 2 * (guint)entry->x_text_size > entry->x_text_size)
+ entry->x_text_size *= 2;
else
{
- entry->text_size = MAX_SIZE;
- if (new_text_length > (gint)entry->text_size - (gint)entry->n_bytes - 1)
+ entry->x_text_size = MAX_SIZE;
+ if (new_text_length > (gint)entry->x_text_size - (gint)entry->x_n_bytes - 1)
{
- new_text_length = (gint)entry->text_size - (gint)entry->n_bytes - 1;
+ new_text_length = (gint)entry->x_text_size - (gint)entry->x_n_bytes - 1;
new_text_length = g_utf8_find_prev_char (new_text, new_text + new_text_length + 1) - new_text;
n_chars = g_utf8_strlen (new_text, new_text_length);
}
@@ -836,19 +837,19 @@ gtk_entry_real_insert_text (GtkEditable
}
}
- entry->text = g_realloc (entry->text, entry->text_size);
+ entry->text = g_realloc (entry->text, entry->x_text_size);
}
index = g_utf8_offset_to_pointer (entry->text, *position) - entry->text;
- g_memmove (entry->text + index + new_text_length, entry->text + index, entry->n_bytes - index);
+ g_memmove (entry->text + index + new_text_length, entry->text + index, entry->x_n_bytes - index);
memcpy (entry->text + index, new_text, new_text_length);
- entry->n_bytes += new_text_length;
+ entry->x_n_bytes += new_text_length;
entry->text_length += n_chars;
/* NUL terminate for safety and convenience */
- entry->text[entry->n_bytes] = '\0';
+ entry->text[entry->x_n_bytes] = '\0';
if (entry->current_pos > *position)
entry->current_pos += n_chars;
@@ -881,9 +882,9 @@ gtk_entry_real_delete_text (GtkEditable
gint start_index = g_utf8_offset_to_pointer (entry->text, start_pos) - entry->text;
gint end_index = g_utf8_offset_to_pointer (entry->text, end_pos) - entry->text;
- g_memmove (entry->text + start_index, entry->text + end_index, entry->n_bytes + 1 - end_index);
+ g_memmove (entry->text + start_index, entry->text + end_index, entry->x_n_bytes + 1 - end_index);
entry->text_length -= (end_pos - start_pos);
- entry->n_bytes -= (end_index - start_index);
+ entry->x_n_bytes -= (end_index - start_index);
if (entry->current_pos > start_pos)
entry->current_pos -= MIN (entry->current_pos, end_pos) - start_pos;
@@ -1157,7 +1158,7 @@ gtk_entry_retrieve_surrounding_cb (GtkIM
{
gtk_im_context_set_surrounding (context,
entry->text,
- entry->n_bytes,
+ entry->x_n_bytes,
g_utf8_offset_to_pointer (entry->text, entry->current_pos) - entry->text);
return TRUE;
@@ -1364,7 +1365,7 @@ gtk_entry_create_layout (GtkEntry *entry
if (entry->visible)
{
- g_string_prepend_len (tmp_string, entry->text, entry->n_bytes);
+ g_string_prepend_len (tmp_string, entry->text, entry->x_n_bytes);
g_string_insert (tmp_string, cursor_index, preedit_string);
}
else
@@ -1373,7 +1374,7 @@ gtk_entry_create_layout (GtkEntry *entry
gint preedit_len_chars;
gunichar invisible_char;
- ch_len = g_utf8_strlen (entry->text, entry->n_bytes);
+ ch_len = g_utf8_strlen (entry->text, entry->x_n_bytes);
preedit_len_chars = g_utf8_strlen (preedit_string, -1);
ch_len += preedit_len_chars;
@@ -1407,7 +1408,7 @@ gtk_entry_create_layout (GtkEntry *entry
{
if (entry->visible)
{
- pango_layout_set_text (layout, entry->text, entry->n_bytes);
+ pango_layout_set_text (layout, entry->text, entry->x_n_bytes);
}
else
{