gtk_text_buffer_insert(buffer, &end, win->buffer->str, -1);
gtk_text_buffer_get_iter_at_offset(buffer, &start, start_offset);
gtk_text_buffer_insert(buffer, &end, win->buffer->str, -1);
gtk_text_buffer_get_iter_at_offset(buffer, &start, start_offset);
// Player's style overrides
gtk_text_buffer_apply_tag(buffer, style_tag, &start, &end);
// GLK Program's style overrides
gtk_text_buffer_apply_tag(buffer, glk_style_tag, &start, &end);
// Player's style overrides
gtk_text_buffer_apply_tag(buffer, style_tag, &start, &end);
// GLK Program's style overrides
gtk_text_buffer_apply_tag(buffer, glk_style_tag, &start, &end);
// Link style overrides
if(win->window_stream->hyperlink_mode) {
GtkTextTag *link_style_tag = gtk_text_tag_table_lookup(tags, "hyperlink");
// Link style overrides
if(win->window_stream->hyperlink_mode) {
GtkTextTag *link_style_tag = gtk_text_tag_table_lookup(tags, "hyperlink");
gint available_space = win->width - gtk_text_iter_get_line_offset(&insert);
GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer);
gint available_space = win->width - gtk_text_iter_get_line_offset(&insert);
GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer);
GtkTextTag *default_tag = gtk_text_tag_table_lookup(tags, "default");
GtkTextTag *style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->style);
GtkTextTag *glk_style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->glk_style);
GtkTextTag *default_tag = gtk_text_tag_table_lookup(tags, "default");
GtkTextTag *style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->style);
GtkTextTag *glk_style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->glk_style);
- * Reads one character from the stream @str. The result will be between 0 and
- * 0x7FFFFFFF. If the end of the stream has been reached, the result will be -1.
+ * Reads one character from the stream @str. If the end of the stream has been
+ * reached, the result will be -1.
* <mathphrase>@len - 1</mathphrase>
* </inlineequation>
* characters have been read or a newline has been read. It then puts a
* <mathphrase>@len - 1</mathphrase>
* </inlineequation>
* characters have been read or a newline has been read. It then puts a
* the end. It returns the number of characters actually read, including the
* newline (if there is one) but not including the terminal null.
*
* the end. It returns the number of characters actually read, including the
* newline (if there is one) but not including the terminal null.
*
+ * glk_stream_get_position() on a window stream will always return zero.
+ *
+ * <note><para>
+ * It might make more sense to return the number of characters written to the
+ * window, but existing libraries do not support this and it's not really
+ * worth adding the feature.
+ * </para></note>
+ *
*
* Again, in Latin-1 streams, characters are bytes. In Unicode streams,
* characters are 32-bit words, or four bytes each.
*
* Again, in Latin-1 streams, characters are bytes. In Unicode streams,
* characters are 32-bit words, or four bytes each.