Eliminated warnings about static functions declared with G_GNUC_INTERNAL
[projects/chimara/chimara.git] / src / window.c
index 2f3c6021ec4628d0b9f33af14b0cbea739a4dc20..5f2bd5b349673bb2b46a755e46c3da8906c93240 100644 (file)
@@ -211,15 +211,11 @@ glk_window_get_root()
  * 
  * So to create a text buffer window which takes the top 40% of the original
  * window's space, you would execute
- * <informalexample><programlisting>
- * newwin = #glk_window_open(win, #winmethod_Above | #winmethod_Proportional, 40, #wintype_TextBuffer, 0);
- * </programlisting></informalexample>
+ * |[ newwin = #glk_window_open(win, #winmethod_Above | #winmethod_Proportional, 40, #wintype_TextBuffer, 0); ]|
  *
  * To create a text grid which is always five lines high, at the bottom of the
  * original window, you would do
- * <informalexample><programlisting>
- * newwin = #glk_window_open(win, #winmethod_Below | #winmethod_Fixed, 5, #wintype_TextGrid, 0);
- * </programlisting></informalexample>
+ * |[ newwin = #glk_window_open(win, #winmethod_Below | #winmethod_Fixed, 5, #wintype_TextGrid, 0); ]|
  * 
  * Note that the meaning of the @size argument depends on the @method argument.
  * If the method is #winmethod_Fixed, it also depends on the @wintype argument.
@@ -417,7 +413,7 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype,
                {
                    GtkWidget *textview = gtk_text_view_new();
 
-                   gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(textview), GTK_WRAP_CHAR );
+                   gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(textview), GTK_WRAP_NONE );
                    gtk_text_view_set_editable( GTK_TEXT_VIEW(textview), FALSE );
                        gtk_widget_show(textview);
                                
@@ -490,6 +486,9 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype,
                        (for line input) */
                        gtk_text_buffer_create_tag(textbuffer, "uneditable", "editable", FALSE, "editable-set", TRUE, NULL);
 
+                       /* Create the default styles available to the window stream */
+                       style_init_textbuffer(textbuffer);
+
                        /* Mark the position where the user will input text */
                        GtkTextIter end;
                        gtk_text_buffer_get_end_iter(textbuffer, &end);
@@ -563,7 +562,7 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype,
        /* Set the window as a child of the Glk widget */
        gtk_widget_set_parent(win->frame, GTK_WIDGET(glk_data->self));
        gtk_widget_queue_resize(GTK_WIDGET(glk_data->self));
-
+       
        gdk_threads_leave();
        
        /* For blank or pair windows, this is almost a no-op. For text grid and
@@ -771,6 +770,7 @@ glk_window_close(winid_t win, stream_result_t *result)
        /* Schedule a redraw */
        gdk_threads_enter();
        gtk_widget_queue_resize( GTK_WIDGET(glk_data->self) );
+       gdk_window_process_all_updates();
        gdk_threads_leave();
 }
 
@@ -988,6 +988,7 @@ glk_window_get_size(winid_t win, glui32 *widthptr, glui32 *heightptr)
         case wintype_TextGrid:
                        gdk_threads_enter();
                        /* Wait for the window to be drawn, and then cache the width and height */
+                       gdk_window_process_all_updates();
                        while(win->widget->allocation.width == 1 && win->widget->allocation.height == 1)
                    {
                        /* Release the GDK lock momentarily */
@@ -996,7 +997,8 @@ glk_window_get_size(winid_t win, glui32 *widthptr, glui32 *heightptr)
                        while(gtk_events_pending())
                            gtk_main_iteration();
                    }
-                   win->width = (glui32)(win->widget->allocation.width / win->unit_width);
+                   
+                       win->width = (glui32)(win->widget->allocation.width / win->unit_width);
                    win->height = (glui32)(win->widget->allocation.height / win->unit_height);
             gdk_threads_leave();
                        
@@ -1017,7 +1019,8 @@ glk_window_get_size(winid_t win, glui32 *widthptr, glui32 *heightptr)
             } */
             
             /* Instead, we wait for GTK to draw the widget. This is probably very slow and should be fixed. */
-            while(win->widget->allocation.width == 1 && win->widget->allocation.height == 1)
+            gdk_window_process_all_updates();
+                       while(win->widget->allocation.width == 1 && win->widget->allocation.height == 1)
             {
                 /* Release the GDK lock momentarily */
                 gdk_threads_leave();