Commit c72cec38 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington
Browse files

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.
parent 98e453dc
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
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.
Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk> Wed Nov 15 02:18:01 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
......
...@@ -557,7 +557,7 @@ static gboolean ...@@ -557,7 +557,7 @@ static gboolean
possibly_not_text (gunichar ch, possibly_not_text (gunichar ch,
gpointer user_data) gpointer user_data)
{ {
return ch == 0xFFFD; return ch == GTK_TEXT_UNKNOWN_CHAR;
} }
static void static void
...@@ -684,7 +684,7 @@ insert_range_untagged (GtkTextBuffer *buffer, ...@@ -684,7 +684,7 @@ insert_range_untagged (GtkTextBuffer *buffer,
/* nothing left to do */ /* nothing left to do */
break; 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; GdkPixbuf *pixbuf = NULL;
GtkTextChildAnchor *anchor = NULL; GtkTextChildAnchor *anchor = NULL;
...@@ -717,7 +717,7 @@ insert_range_untagged (GtkTextBuffer *buffer, ...@@ -717,7 +717,7 @@ insert_range_untagged (GtkTextBuffer *buffer,
} }
else else
{ {
/* The 0xFFFD was in a text segment, so /* The GTK_TEXT_UNKNOWN_CHAR was in a text segment, so
* keep going. * keep going.
*/ */
gtk_text_iter_forward_find_char (&range_end, gtk_text_iter_forward_find_char (&range_end,
...@@ -1287,11 +1287,11 @@ gtk_text_buffer_get_text (GtkTextBuffer *buffer, ...@@ -1287,11 +1287,11 @@ gtk_text_buffer_get_text (GtkTextBuffer *buffer,
* Returns the text in the range [@start,@end). Excludes undisplayed * Returns the text in the range [@start,@end). Excludes undisplayed
* text (text marked with tags that set the invisibility attribute) if * text (text marked with tags that set the invisibility attribute) if
* @include_hidden_chars is FALSE. The returned string includes a * @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 * embedded images, so byte and character indexes into
* the returned string <emphasis>do</emphasis> correspond to byte * the returned string <emphasis>do</emphasis> correspond to byte
* and character indexes into the buffer. Contrast with * 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 * text as well, so it is not a reliable indicator that a pixbuf or
* widget is in the buffer. * widget is in the buffer.
* *
......
...@@ -112,8 +112,9 @@ _gtk_pixbuf_segment_new (GdkPixbuf *pixbuf) ...@@ -112,8 +112,9 @@ _gtk_pixbuf_segment_new (GdkPixbuf *pixbuf)
seg->next = NULL; 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 */ * a 3-byte sequence in UTF-8
*/
seg->char_count = 1; seg->char_count = 1;
seg->body.pixbuf.pixbuf = pixbuf; seg->body.pixbuf.pixbuf = pixbuf;
...@@ -208,7 +209,7 @@ _gtk_widget_segment_new (void) ...@@ -208,7 +209,7 @@ _gtk_widget_segment_new (void)
seg->next = NULL; 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 * a 3-byte sequence in UTF-8
*/ */
seg->char_count = 1; seg->char_count = 1;
......
...@@ -699,7 +699,7 @@ gtk_text_iter_get_line_index (const GtkTextIter *iter) ...@@ -699,7 +699,7 @@ gtk_text_iter_get_line_index (const GtkTextIter *iter)
* Returns the Unicode character at this iterator. (Equivalent to * Returns the Unicode character at this iterator. (Equivalent to
* operator* on a C++ iterator.) If the iterator points at a * operator* on a C++ iterator.) If the iterator points at a
* non-character element, such as an image embedded in the buffer, the * 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. * 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 () * So you can write a loop which ends when gtk_text_iter_get_char ()
* returns 0. * returns 0.
...@@ -731,8 +731,8 @@ gtk_text_iter_get_char (const GtkTextIter *iter) ...@@ -731,8 +731,8 @@ gtk_text_iter_get_char (const GtkTextIter *iter)
} }
else else
{ {
/* Unicode "unknown character" 0xFFFD */ /* Unicode "unknown character" 0xFFFC */
return gtk_text_unknown_char; return GTK_TEXT_UNKNOWN_CHAR;
} }
} }
...@@ -743,10 +743,10 @@ gtk_text_iter_get_char (const GtkTextIter *iter) ...@@ -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 * Returns the text in the given range. A "slice" is an array of
* characters encoded in UTF-8 format, including the Unicode "unknown" * 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 * such as images. Because images are encoded in the slice, byte and
* character offsets in the returned array will correspond to byte * 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 * text as well, so it is not a reliable indicator that a pixbuf or
* widget is in the buffer. * widget is in the buffer.
* *
...@@ -2975,7 +2975,7 @@ forward_chars_with_skipping (GtkTextIter *iter, ...@@ -2975,7 +2975,7 @@ forward_chars_with_skipping (GtkTextIter *iter,
gboolean ignored = FALSE; gboolean ignored = FALSE;
if (skip_nontext && 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; ignored = TRUE;
if (!ignored && if (!ignored &&
...@@ -3152,7 +3152,7 @@ strbreakup (const char *string, ...@@ -3152,7 +3152,7 @@ strbreakup (const char *string,
* @iter: start of search * @iter: start of search
* @str: a search string * @str: a search string
* @visible_only: if %TRUE, search only visible text * @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_start: return location for start of match, or %NULL
* @match_end: return location for end 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 * @limit: bound for the search, or %NULL for the end of the buffer
...@@ -3470,7 +3470,7 @@ my_strrstr (const gchar *haystack, ...@@ -3470,7 +3470,7 @@ my_strrstr (const gchar *haystack,
* @iter: a #GtkTextIter where the search begins * @iter: a #GtkTextIter where the search begins
* @str: search string * @str: search string
* @visible_only: if %TRUE search only visible text * @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_start: return location for start of match, or %NULL
* @match_end: return location for end 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 * @limit: location of last possible @match_start, or %NULL for start of buffer
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
/* These are used to represent embedded non-character objects /* These are used to represent embedded non-character objects
* if you return a string representation of a text buffer * 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, 0xBC, '\0' };
const gchar gtk_text_unknown_char_utf8[] = { 0xEF, 0xBF, 0xBD, '\0' };
static inline gboolean static inline gboolean
inline_byte_begins_utf8_char (const gchar *byte) inline_byte_begins_utf8_char (const gchar *byte)
......
...@@ -38,7 +38,7 @@ extern GtkTextLineSegmentClass gtk_text_child_type; ...@@ -38,7 +38,7 @@ extern GtkTextLineSegmentClass gtk_text_child_type;
* UTF 8 Stubs * UTF 8 Stubs
*/ */
extern const gunichar gtk_text_unknown_char; #define GTK_TEXT_UNKNOWN_CHAR 0xFFFC
extern const gchar gtk_text_unknown_char_utf8[]; extern const gchar gtk_text_unknown_char_utf8[];
gboolean gtk_text_byte_begins_utf8_char (const gchar *byte); gboolean gtk_text_byte_begins_utf8_char (const gchar *byte);
......
...@@ -22,7 +22,7 @@ main (int argc, char** argv) ...@@ -22,7 +22,7 @@ main (int argc, char** argv)
/* Check UTF8 unknown char thing */ /* Check UTF8 unknown char thing */
g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1); g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1);
ch = g_utf8_get_char (gtk_text_unknown_char_utf8); 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. */ /* First, we turn on btree debugging. */
gtk_debug_flags |= GTK_DEBUG_TEXT; gtk_debug_flags |= GTK_DEBUG_TEXT;
...@@ -603,7 +603,7 @@ fill_buffer (GtkTextBuffer *buffer) ...@@ -603,7 +603,7 @@ fill_buffer (GtkTextBuffer *buffer)
color.blue = color.green = 0; color.blue = color.green = 0;
color.red = 0xffff; color.red = 0xffff;
gtk_object_set (GTK_OBJECT (tag), gtk_object_set (GTK_OBJECT (tag),
"offset", -4, "rise", -4,
"foreground_gdk", &color, "foreground_gdk", &color,
NULL); NULL);
......
...@@ -22,7 +22,7 @@ main (int argc, char** argv) ...@@ -22,7 +22,7 @@ main (int argc, char** argv)
/* Check UTF8 unknown char thing */ /* Check UTF8 unknown char thing */
g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1); g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1);
ch = g_utf8_get_char (gtk_text_unknown_char_utf8); 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. */ /* First, we turn on btree debugging. */
gtk_debug_flags |= GTK_DEBUG_TEXT; gtk_debug_flags |= GTK_DEBUG_TEXT;
...@@ -603,7 +603,7 @@ fill_buffer (GtkTextBuffer *buffer) ...@@ -603,7 +603,7 @@ fill_buffer (GtkTextBuffer *buffer)
color.blue = color.green = 0; color.blue = color.green = 0;
color.red = 0xffff; color.red = 0xffff;
gtk_object_set (GTK_OBJECT (tag), gtk_object_set (GTK_OBJECT (tag),
"offset", -4, "rise", -4,
"foreground_gdk", &color, "foreground_gdk", &color,
NULL); NULL);
......
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