XEmacs 21.2.40 "Persephone".
[chise/xemacs-chise.git.1] / src / redisplay-x.c
index 1abe97a..c1b7fca 100644 (file)
@@ -165,9 +165,9 @@ separate_textual_runs (unsigned char *text_storage,
 #ifdef MULE
          {
            Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
-           need_ccl_conversion = !NILP (ccl_prog);
-           if (need_ccl_conversion)
-             setup_ccl_program (&char_converter, ccl_prog);
+           if ((!NILP (ccl_prog))
+                 && (setup_ccl_program (&char_converter, ccl_prog) >= 0))
+             need_ccl_conversion = 1;
          }
 #endif
        }
@@ -286,24 +286,24 @@ x_eol_cursor_width (void)
 }
 
 /*****************************************************************************
- x_output_begin
+ x_window_output_begin
 
  Perform any necessary initialization prior to an update.
  ****************************************************************************/
 static void
-x_output_begin (struct device *d)
+x_window_output_begin (struct window *w)
 {
 }
 
 /*****************************************************************************
- x_output_end
+ x_window_output_end
 
  Perform any necessary flushing of queues when an update has completed.
  ****************************************************************************/
 static void
-x_output_end (struct device *d)
+x_window_output_end (struct window *w)
 {
-  XFlush (DEVICE_X_DISPLAY (d));
+  XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w)));
 }
 
 /*****************************************************************************
@@ -452,54 +452,38 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                {
                  switch (XIMAGE_INSTANCE_TYPE (instance))
                    {
-                   case IMAGE_TEXT:
-                     {
-                       /* #### This is way losing.  See the comment in
-                          add_glyph_rune(). */
-                       Lisp_Object string =
-                         XIMAGE_INSTANCE_TEXT_STRING (instance);
-                       convert_bufbyte_string_into_emchar_dynarr
-                         (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
-                       
-                       x_output_string (w, dl, buf, xpos,
-                                        rb->object.dglyph.xoffset,
-                                        start_pixpos, -1, findex,
-                                        (rb->cursor_type == CURSOR_ON),
-                                        cursor_start, cursor_width,
-                                        cursor_height);
-                       Dynarr_reset (buf);
-                     }
-                     break;
-                     
                    case IMAGE_MONO_PIXMAP:
                    case IMAGE_COLOR_PIXMAP:
                      redisplay_output_pixmap (w, instance, &dbox, &dga, findex,
                                               cursor_start, cursor_width,
                                               cursor_height, 0);
                      break;
-                     
+
                    case IMAGE_WIDGET:
+                     if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
+                             Qlayout))
+                       {
+                         redisplay_output_layout (window, instance, &dbox, &dga, findex,
+                                                  cursor_start, cursor_width,
+                                                  cursor_height);
+                         break;
+                       }
                    case IMAGE_SUBWINDOW:
                      redisplay_output_subwindow (w, instance, &dbox, &dga, findex,
                                                  cursor_start, cursor_width,
                                                  cursor_height);
                      break;
-                     
-                   case IMAGE_LAYOUT:
-                     redisplay_output_layout (w, instance, &dbox, &dga, findex,
-                                              cursor_start, cursor_width,
-                                              cursor_height);
-                     break;
-                     
+
                    case IMAGE_NOTHING:
                      /* nothing is as nothing does */
                      break;
-                     
+
+                   case IMAGE_TEXT:
                    case IMAGE_POINTER:
                    default:
                      abort ();
                    }
-                 IMAGE_INSTANCE_OPTIMIZE_OUTPUT 
+                 IMAGE_INSTANCE_OPTIMIZE_OUTPUT
                    (XIMAGE_INSTANCE (instance)) = 0;
                }
 
@@ -530,7 +514,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
 /*****************************************************************************
  x_bevel_area
 
- Draw a shadows for the given area in the given face.
+ Draw shadows for the given area in the given face.
  ****************************************************************************/
 static void
 x_bevel_area (struct window *w, face_index findex,
@@ -1722,6 +1706,7 @@ x_redraw_exposed_window (struct window *w, int x, int y, int width, int height)
       f->windows_structure_changed = 1;
     }
 
+  redisplay_clear_top_of_window (w);
   if (window_needs_vertical_divider (w))
     {
       x_output_vertical_divider (w, 0);
@@ -2016,7 +2001,7 @@ x_flash (struct device *d)
                      w->pixel_width, flash_height);
     }
   else
-    /* If it is short, flash it all.  */ 
+    /* If it is short, flash it all.  */
     XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
                    w->pixel_width, w->pixel_height);
 
@@ -2049,7 +2034,7 @@ x_flash (struct device *d)
                      w->pixel_width, flash_height);
     }
   else
-    /* If it is short, flash it all.  */ 
+    /* If it is short, flash it all.  */
     XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
                    w->pixel_width, w->pixel_height);
 
@@ -2111,8 +2096,8 @@ console_type_create_redisplay_x (void)
   CONSOLE_HAS_METHOD (x, output_vertical_divider);
   CONSOLE_HAS_METHOD (x, clear_region);
   CONSOLE_HAS_METHOD (x, clear_frame);
-  CONSOLE_HAS_METHOD (x, output_begin);
-  CONSOLE_HAS_METHOD (x, output_end);
+  CONSOLE_HAS_METHOD (x, window_output_begin);
+  CONSOLE_HAS_METHOD (x, window_output_end);
   CONSOLE_HAS_METHOD (x, flash);
   CONSOLE_HAS_METHOD (x, ring_bell);
   CONSOLE_HAS_METHOD (x, bevel_area);