XEmacs 21.4.5 "Civil Service".
[chise/xemacs-chise.git.1] / src / redisplay.c
index 6604dd2..dc7048e 100644 (file)
@@ -300,7 +300,7 @@ static Bytecount_dynarr *formatted_string_extent_end_dynarr;
 
 
 /* #### probably temporary */
-int cache_adjustment;
+Fixnum cache_adjustment;
 
 /* This holds a string representing the text corresponding to a single
    modeline % spec. */
@@ -315,10 +315,10 @@ int disable_preemption;   /* Used for debugging redisplay and for
 static int preemption_count;
 
 /* Minimum pixel height of clipped bottom display line. */
-int vertical_clip;
+Fixnum vertical_clip;
 
 /* Minimum visible pixel width of clipped glyphs at right margin. */
-int horizontal_clip;
+Fixnum horizontal_clip;
 
 /* Nonzero means reading single-character input with prompt
    so put cursor on minibuffer after the prompt.  */
@@ -425,10 +425,10 @@ Lisp_Object Vglobal_mode_string;
 
 /* The number of lines scroll a window by when point leaves the window; if
   it is <=0 then point is centered in the window */
-int scroll_step;
+Fixnum scroll_step;
 
 /* Scroll up to this many lines, to bring point back on screen. */
-int scroll_conservatively;
+Fixnum scroll_conservatively;
 
 /* Marker for where to display an arrow on top of the buffer text.  */
 Lisp_Object Voverlay_arrow_position;
@@ -451,7 +451,8 @@ Lisp_Object Vpre_redisplay_hook, Vpost_redisplay_hook;
 Lisp_Object Qpre_redisplay_hook, Qpost_redisplay_hook;
 #endif /* INHIBIT_REDISPLAY_HOOKS */
 
-static int last_display_warning_tick, display_warning_tick;
+static Fixnum last_display_warning_tick;
+static Fixnum display_warning_tick;
 Lisp_Object Qdisplay_warning_buffer;
 int inhibit_warning_display;
 
@@ -464,8 +465,7 @@ int column_number_start_at_one;
 
 Lisp_Object Qtop_bottom;
 
-#define WINDOW_SCROLLED(w) \
-(w->hscroll > 0 || w->left_xoffset)
+#define WINDOW_SCROLLED(w) ((w)->hscroll > 0 || (w)->left_xoffset)
 
 \f
 /***************************************************************************/
@@ -972,6 +972,8 @@ add_bufbyte_string_runes (pos_data *data, Bufbyte *c_string,
 
   for (pos = c_string; pos < end;)
     {
+      Bufbyte *old_pos = pos;
+
       data->ch = charptr_emchar (pos);
 
       prop = add_emchar_rune (data);
@@ -997,6 +999,9 @@ add_bufbyte_string_runes (pos_data *data, Bufbyte *c_string,
        }
       INC_CHARPTR (pos);
       assert (pos <= end);
+      /* #### Duplicate code from add_string_to_fstring_db_runes
+        should we do more?*/
+      data->bytepos += pos - old_pos;
     }
 
   return NULL;
@@ -4510,7 +4515,7 @@ create_string_text_block (struct window *w, Lisp_Object disp_string,
                goto done;
            }
 
-         /* #### What if we we're dealing with a display table? */
+         /* #### What if we're dealing with a display table? */
          if (data.start_col)
            data.start_col--;
 
@@ -6271,7 +6276,8 @@ redisplay_frame (struct frame *f, int preemption_check)
 {
   struct device *d = XDEVICE (f->device);
 
-  if (preemption_check)
+  if (preemption_check
+      && !DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY))
     {
       /* The preemption check itself takes a lot of time,
         so normally don't do it here.  We do it if called
@@ -6431,27 +6437,29 @@ static int
 redisplay_device (struct device *d, int automatic)
 {
   Lisp_Object frame, frmcons;
-  int preempted = 0;
   int size_change_failed = 0;
   struct frame *f;
 
-  if (automatic
-      && (MAYBE_INT_DEVMETH (d, device_implementation_flags, ())
-         & XDEVIMPF_NO_AUTO_REDISPLAY))
+  if (automatic && DEVICE_IMPL_FLAG (d, XDEVIMPF_NO_AUTO_REDISPLAY))
     return 0;
 
   if (DEVICE_STREAM_P (d)) /* nothing to do */
     return 0;
 
   /* It is possible that redisplay has been called before the
-     device is fully initialized.  If so then continue with the
-     next device. */
+     device is fully initialized, or that the console implementation
+     allows frameless devices.  If so then continue with the next
+     device. */
   if (NILP (DEVICE_SELECTED_FRAME (d)))
     return 0;
 
-  REDISPLAY_PREEMPTION_CHECK;
-  if (preempted)
-    return 1;
+  if (!DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY))
+    {
+      int preempted;
+      REDISPLAY_PREEMPTION_CHECK;
+      if (preempted)
+       return 1;
+    }
 
   /* Always do the selected frame first. */
   frame = DEVICE_SELECTED_FRAME (d);
@@ -6465,12 +6473,11 @@ redisplay_device (struct device *d, int automatic)
     {
       if (CLASS_REDISPLAY_FLAGS_CHANGEDP(f))
        {
-         preempted = redisplay_frame (f, 0);
+         int preempted = redisplay_frame (f, 0);
+         if (preempted)
+           return 1;
        }
 
-      if (preempted)
-       return 1;
-
       /* If the frame redisplay did not get preempted, then this flag
          should have gotten set to 0.  It might be possible for that
          not to happen if a size change event were to occur at an odd
@@ -6495,12 +6502,11 @@ redisplay_device (struct device *d, int automatic)
        {
          if (CLASS_REDISPLAY_FLAGS_CHANGEDP (f))
            {
-             preempted = redisplay_frame (f, 0);
+             int preempted = redisplay_frame (f, 0);
+             if (preempted)
+               return 1;
            }
 
-         if (preempted)
-           return 1;
-
          if (f->size_change_pending)
            size_change_failed = 1;
        }
@@ -7094,6 +7100,10 @@ mark_redisplay (void)
   FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
     {
       struct frame *f = XFRAME (XCAR (frmcons));
+      /* #### urk!  this does tons o' crap, such as creating lots of
+        structs, doing window system actions, etc.  we DO NOT want to
+        be doing this -- marking should never change any state.
+        i think we can just delete this. --ben */
       update_frame_window_mirror (f);
       mark_window_mirror (f->root_mirror);
       mark_gutters (f);
@@ -9178,6 +9188,15 @@ init_redisplay (void)
     }
 #endif /* HAVE_X_WINDOWS */
 
+#ifdef HAVE_GTK
+  if (!strcmp (display_use, "gtk"))
+    {
+      Vwindow_system = Qgtk;
+      Vinitial_window_system = Qgtk;
+      return;
+    }
+#endif
+
 #ifdef HAVE_MS_WINDOWS
   if (!strcmp (display_use, "mswindows"))
     {
@@ -9286,7 +9305,7 @@ See also `overlay-arrow-string'.
 
   DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /*
 String or glyph to display as an arrow.  See also `overlay-arrow-position'.
-(Note that despite the name of this variable, it can be set to a glyph as
+\(Note that despite the name of this variable, it can be set to a glyph as
 well as a string.)
 */ ,
                     redisplay_variable_changed);
@@ -9367,7 +9386,7 @@ Non-nil means put cursor in minibuffer, at end of any message there.
      maybe a caret cursor, etc. */
 
   DEFVAR_LISP ("bar-cursor", &Vbar_cursor /*
-Use vertical bar cursor if non-nil.  If t width is 1 pixel, otherwise 2.
+*Use vertical bar cursor if non-nil.  If t width is 1 pixel, otherwise 2.
 */ );
   Vbar_cursor = Qnil;
 
@@ -9451,7 +9470,7 @@ This is a specifier; use `set-specifier' to change it.
                         offsetof (struct window, left_margin_width),
                         some_window_value_changed,
                         offsetof (struct frame, left_margin_width),
-                        margin_width_changed_in_frame);
+                        margin_width_changed_in_frame, 0);
 
   DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /*
 *Width of right margin.
@@ -9463,7 +9482,7 @@ This is a specifier; use `set-specifier' to change it.
                         offsetof (struct window, right_margin_width),
                         some_window_value_changed,
                         offsetof (struct frame, right_margin_width),
-                        margin_width_changed_in_frame);
+                        margin_width_changed_in_frame, 0);
 
   DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /*
 *Minimum ascent height of lines.
@@ -9474,7 +9493,7 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_caching (Vminimum_line_ascent,
                         offsetof (struct window, minimum_line_ascent),
                         some_window_value_changed,
-                        0, 0);
+                        0, 0, 0);
 
   DEFVAR_SPECIFIER ("minimum-line-descent", &Vminimum_line_descent /*
 *Minimum descent height of lines.
@@ -9485,7 +9504,7 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_caching (Vminimum_line_descent,
                         offsetof (struct window, minimum_line_descent),
                         some_window_value_changed,
-                        0, 0);
+                        0, 0, 0);
 
   DEFVAR_SPECIFIER ("use-left-overflow", &Vuse_left_overflow /*
 *Non-nil means use the left outside margin as extra whitespace when
@@ -9497,7 +9516,7 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_caching (Vuse_left_overflow,
                         offsetof (struct window, use_left_overflow),
                         some_window_value_changed,
-                        0, 0);
+                        0, 0, 0);
 
   DEFVAR_SPECIFIER ("use-right-overflow", &Vuse_right_overflow /*
 *Non-nil means use the right outside margin as extra whitespace when
@@ -9509,7 +9528,7 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_caching (Vuse_right_overflow,
                         offsetof (struct window, use_right_overflow),
                         some_window_value_changed,
-                        0, 0);
+                        0, 0, 0);
 
   DEFVAR_SPECIFIER ("text-cursor-visible-p", &Vtext_cursor_visible_p /*
 *Non-nil means the text cursor is visible (this is usually the case).
@@ -9520,6 +9539,6 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_caching (Vtext_cursor_visible_p,
                         offsetof (struct window, text_cursor_visible_p),
                         text_cursor_visible_p_changed,
-                        0, 0);
+                        0, 0, 0);
 
 }