diff options
author | Havoc Pennington <hp@pobox.com> | 2000-11-15 03:41:45 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-11-15 03:41:45 +0000 |
commit | c72cec38f1c74bf75dfc2d41e8f37b4673d40d27 (patch) | |
tree | 0ffc5c10b3882f96607c1dbdff1e93b475636bb0 /gtk | |
parent | 98e453dc0457c00220a82468c1a140bb68bb455d (diff) | |
download | gtk+-c72cec38f1c74bf75dfc2d41e8f37b4673d40d27.tar.gz |
change "offset" to "rise"
2000-11-14 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c (fill_buffer): change "offset" to "rise"
* gtk/gtktexttypes.h (GTK_TEXT_UNKNOWN_CHAR): Add macro for
unknown char, no real reason we were using a variable.
Remove gtk_text_unknown_char variable. Fix all the text widget
files accordingly.
* gtk/gtktexttypes.c: Change "unknown character" to 0xFFFC,
since the Unicode spec seems to prefer that character for our
purposes.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktextbuffer.c | 10 | ||||
-rw-r--r-- | gtk/gtktextchild.c | 7 | ||||
-rw-r--r-- | gtk/gtktextiter.c | 16 | ||||
-rw-r--r-- | gtk/gtktexttypes.c | 3 | ||||
-rw-r--r-- | gtk/gtktexttypes.h | 2 | ||||
-rw-r--r-- | gtk/testtextbuffer.c | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index e5444c2788..9cd8dbba9f 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -557,7 +557,7 @@ static gboolean possibly_not_text (gunichar ch, gpointer user_data) { - return ch == 0xFFFD; + return ch == GTK_TEXT_UNKNOWN_CHAR; } static void @@ -684,7 +684,7 @@ insert_range_untagged (GtkTextBuffer *buffer, /* nothing left to do */ break; } - else if (gtk_text_iter_get_char (&range_end) == 0xFFFD) + else if (gtk_text_iter_get_char (&range_end) == GTK_TEXT_UNKNOWN_CHAR) { GdkPixbuf *pixbuf = NULL; GtkTextChildAnchor *anchor = NULL; @@ -717,7 +717,7 @@ insert_range_untagged (GtkTextBuffer *buffer, } else { - /* The 0xFFFD was in a text segment, so + /* The GTK_TEXT_UNKNOWN_CHAR was in a text segment, so * keep going. */ gtk_text_iter_forward_find_char (&range_end, @@ -1287,11 +1287,11 @@ gtk_text_buffer_get_text (GtkTextBuffer *buffer, * Returns the text in the range [@start,@end). Excludes undisplayed * text (text marked with tags that set the invisibility attribute) if * @include_hidden_chars is FALSE. The returned string includes a - * 0xFFFD character whenever the buffer contains + * 0xFFFC character whenever the buffer contains * embedded images, so byte and character indexes into * the returned string <emphasis>do</emphasis> correspond to byte * and character indexes into the buffer. Contrast with - * gtk_text_buffer_get_text (). Note that 0xFFFD can occur in normal + * gtk_text_buffer_get_text (). Note that 0xFFFC can occur in normal * text as well, so it is not a reliable indicator that a pixbuf or * widget is in the buffer. * diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index 88c81267e8..3b1dabfaa8 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -112,8 +112,9 @@ _gtk_pixbuf_segment_new (GdkPixbuf *pixbuf) seg->next = NULL; - seg->byte_count = 3; /* We convert to the 0xFFFD "unknown character", - a 3-byte sequence in UTF-8 */ + seg->byte_count = 3; /* We convert to the 0xFFFC "unknown character", + * a 3-byte sequence in UTF-8 + */ seg->char_count = 1; seg->body.pixbuf.pixbuf = pixbuf; @@ -208,7 +209,7 @@ _gtk_widget_segment_new (void) seg->next = NULL; - seg->byte_count = 3; /* We convert to the 0xFFFD "unknown character", + seg->byte_count = 3; /* We convert to the 0xFFFC "unknown character", * a 3-byte sequence in UTF-8 */ seg->char_count = 1; diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index f7713d3099..1d90ceb433 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -699,7 +699,7 @@ gtk_text_iter_get_line_index (const GtkTextIter *iter) * Returns the Unicode character at this iterator. (Equivalent to * operator* on a C++ iterator.) If the iterator points at a * non-character element, such as an image embedded in the buffer, the - * Unicode "unknown" character 0xFFFD is returned. If invoked on + * Unicode "unknown" character 0xFFFC is returned. If invoked on * the end iterator, zero is returned; zero is not a valid Unicode character. * So you can write a loop which ends when gtk_text_iter_get_char () * returns 0. @@ -731,8 +731,8 @@ gtk_text_iter_get_char (const GtkTextIter *iter) } else { - /* Unicode "unknown character" 0xFFFD */ - return gtk_text_unknown_char; + /* Unicode "unknown character" 0xFFFC */ + return GTK_TEXT_UNKNOWN_CHAR; } } @@ -743,10 +743,10 @@ gtk_text_iter_get_char (const GtkTextIter *iter) * * Returns the text in the given range. A "slice" is an array of * characters encoded in UTF-8 format, including the Unicode "unknown" - * character 0xFFFD for iterable non-character elements in the buffer, + * character 0xFFFC for iterable non-character elements in the buffer, * such as images. Because images are encoded in the slice, byte and * character offsets in the returned array will correspond to byte - * offsets in the text buffer. Note that 0xFFFD can occur in normal + * offsets in the text buffer. Note that 0xFFFC can occur in normal * text as well, so it is not a reliable indicator that a pixbuf or * widget is in the buffer. * @@ -2975,7 +2975,7 @@ forward_chars_with_skipping (GtkTextIter *iter, gboolean ignored = FALSE; if (skip_nontext && - gtk_text_iter_get_char (iter) == gtk_text_unknown_char) + gtk_text_iter_get_char (iter) == GTK_TEXT_UNKNOWN_CHAR) ignored = TRUE; if (!ignored && @@ -3152,7 +3152,7 @@ strbreakup (const char *string, * @iter: start of search * @str: a search string * @visible_only: if %TRUE, search only visible text - * @slice: if %TRUE, @str contains 0xFFFD when we want to match widgets, pixbufs + * @slice: if %TRUE, @str contains 0xFFFC when we want to match widgets, pixbufs * @match_start: return location for start of match, or %NULL * @match_end: return location for end of match, or %NULL * @limit: bound for the search, or %NULL for the end of the buffer @@ -3470,7 +3470,7 @@ my_strrstr (const gchar *haystack, * @iter: a #GtkTextIter where the search begins * @str: search string * @visible_only: if %TRUE search only visible text - * @slice: if %TRUE the search string contains 0xFFFD to match pixbufs, widgets + * @slice: if %TRUE the search string contains 0xFFFC to match pixbufs, widgets * @match_start: return location for start of match, or %NULL * @match_end: return location for end of match, or %NULL * @limit: location of last possible @match_start, or %NULL for start of buffer diff --git a/gtk/gtktexttypes.c b/gtk/gtktexttypes.c index a0c9a98a23..d6f964abfc 100644 --- a/gtk/gtktexttypes.c +++ b/gtk/gtktexttypes.c @@ -3,8 +3,7 @@ /* These are used to represent embedded non-character objects * if you return a string representation of a text buffer */ -const gunichar gtk_text_unknown_char = 0xFFFD; -const gchar gtk_text_unknown_char_utf8[] = { 0xEF, 0xBF, 0xBD, '\0' }; +const gchar gtk_text_unknown_char_utf8[] = { 0xEF, 0xBF, 0xBC, '\0' }; static inline gboolean inline_byte_begins_utf8_char (const gchar *byte) diff --git a/gtk/gtktexttypes.h b/gtk/gtktexttypes.h index 16321afdfc..f58fd45e3c 100644 --- a/gtk/gtktexttypes.h +++ b/gtk/gtktexttypes.h @@ -38,7 +38,7 @@ extern GtkTextLineSegmentClass gtk_text_child_type; * UTF 8 Stubs */ -extern const gunichar gtk_text_unknown_char; +#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC extern const gchar gtk_text_unknown_char_utf8[]; gboolean gtk_text_byte_begins_utf8_char (const gchar *byte); diff --git a/gtk/testtextbuffer.c b/gtk/testtextbuffer.c index 18df1a2f1b..e2b3072578 100644 --- a/gtk/testtextbuffer.c +++ b/gtk/testtextbuffer.c @@ -22,7 +22,7 @@ main (int argc, char** argv) /* Check UTF8 unknown char thing */ g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1); ch = g_utf8_get_char (gtk_text_unknown_char_utf8); - g_assert (ch == gtk_text_unknown_char); + g_assert (ch == GTK_TEXT_UNKNOWN_CHAR); /* First, we turn on btree debugging. */ gtk_debug_flags |= GTK_DEBUG_TEXT; @@ -603,7 +603,7 @@ fill_buffer (GtkTextBuffer *buffer) color.blue = color.green = 0; color.red = 0xffff; gtk_object_set (GTK_OBJECT (tag), - "offset", -4, + "rise", -4, "foreground_gdk", &color, NULL); |