#include <config.h>
#include <stdio.h>
+#include <byteswap.h>
+
#include "lisp.h"
#include "frame.h"
#include "window.h"
#include "blockinput.h"
#include "termhooks.h"
-#ifdef HAVE_WINDOW_SYSTEM
-
/* Fringe bitmaps are represented in three different ways:
Logical bitmaps are used internally to denote things like
{
/* If W has a vertical border to its left, don't draw over it. */
wd -= ((!WINDOW_LEFTMOST_P (w)
+ /* This could be wrong when we allow window local
+ right dividers - but the window on the left is hard
+ to get. */
+ && !FRAME_RIGHT_DIVIDER_WIDTH (f)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
/* But don't reduce the fringe width if the window
has a left margin, because that means we are not
and OTOH leaving out that one pixel leaves behind
traces of the cursor, if it was in column zero
before drawing non-empty margin area. */
- && NILP (w->left_margin_cols))
+ && w->left_margin_cols == 0)
? 1 : 0);
p.bx = x - wd;
p.nx = wd;
{
Lisp_Object cmap, bm = Qnil;
- if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
+ if ((cmap = BVAR (XBUFFER (w->contents), fringe_cursor_alist)), !NILP (cmap))
{
bm = Fassq (cursor, cmap);
if (CONSP (bm))
If partial, lookup partial bitmap in default value if not found here.
If not partial, or no partial spec is present, use non-partial bitmap. */
- if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
+ if ((cmap = BVAR (XBUFFER (w->contents), fringe_indicator_alist)), !NILP (cmap))
{
bm1 = Fassq (bitmap, cmap);
if (CONSP (bm1))
/* Draw the fringes of window W. Only fringes for rows marked for
update in redraw_fringe_bitmaps_p are drawn.
- Return >0 if left or right fringe was redrawn in any way.
+ Return nonzero if left or right fringe was redrawn in any way.
- If NO_FRINGE is non-zero, also return >0 if either fringe has zero width.
+ If NO_FRINGE_P is non-zero, also return nonzero if either fringe
+ has zero width.
- A return value >0 indicates that the vertical line between windows
- needs update (as it may be drawn in the fringe).
+ A return nonzero value indicates that the vertical line between
+ windows needs update (as it may be drawn in the fringe).
*/
-int
-draw_window_fringes (struct window *w, int no_fringe)
+bool
+draw_window_fringes (struct window *w, bool no_fringe_p)
{
struct glyph_row *row;
int yb = window_text_bottom_y (w);
int nrows = w->current_matrix->nrows;
int y, rn;
- int updated = 0;
+ bool updated_p = 0;
if (w->pseudo_window_p)
- return 0;
+ return updated_p;
/* Must draw line if no fringe */
- if (no_fringe
+ if (no_fringe_p
&& (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
|| WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
- updated++;
+ updated_p = 1;
for (y = w->vscroll, rn = 0, row = w->current_matrix->rows;
y < yb && rn < nrows;
continue;
draw_row_fringe_bitmaps (w, row);
row->redraw_fringe_bitmaps_p = 0;
- updated++;
+ updated_p = 1;
}
- return updated;
+ return updated_p;
}
If KEEP_CURRENT_P is 0, update current_matrix too. */
-int
-update_window_fringes (struct window *w, int keep_current_p)
+bool
+update_window_fringes (struct window *w, bool keep_current_p)
{
struct glyph_row *row, *cur = 0;
int yb = window_text_bottom_y (w);
int rn, nrows = w->current_matrix->nrows;
int y;
- int redraw_p = 0;
+ bool redraw_p = 0;
Lisp_Object boundary_top = Qnil, boundary_bot = Qnil;
Lisp_Object arrow_top = Qnil, arrow_bot = Qnil;
Lisp_Object empty_pos;
return 0;
if (!MINI_WINDOW_P (w)
- && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
+ && (ind = BVAR (XBUFFER (w->contents), indicate_buffer_boundaries), !NILP (ind)))
{
if (EQ (ind, Qleft) || EQ (ind, Qright))
boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
{
if (top_ind_rn < 0 && row->visible_height > 0)
{
- if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
+ if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->contents))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
row->indicate_bob_p = !NILP (boundary_top);
else
if (bot_ind_rn < 0)
{
- if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
+ if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->contents))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
else if (y + row->height >= yb)
}
}
- empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines);
+ empty_pos = BVAR (XBUFFER (w->contents), indicate_empty_lines);
if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
int left, right;
unsigned left_face_id, right_face_id;
int left_offset, right_offset;
- int periodic_p;
+ bool periodic_p;
row = w->desired_matrix->rows + rn;
cur = w->current_matrix->rows + rn;
|| periodic_p != cur->fringe_bitmap_periodic_p
|| cur->redraw_fringe_bitmaps_p)
{
- redraw_p = row->redraw_fringe_bitmaps_p = 1;
+ redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
if (!keep_current_p)
{
cur->redraw_fringe_bitmaps_p = 1;
if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap)
{
- redraw_p = row->redraw_fringe_bitmaps_p = 1;
+ redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
if (!keep_current_p)
{
cur->redraw_fringe_bitmaps_p = 1;
*/
void
-compute_fringe_widths (struct frame *f, int redraw)
+compute_fringe_widths (struct frame *f, bool redraw_p)
{
int o_left = FRAME_LEFT_FRINGE_WIDTH (f);
int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
FRAME_FRINGE_COLS (f) = 0;
}
- if (redraw && FRAME_VISIBLE_P (f))
+ if (redraw_p && FRAME_VISIBLE_P (f))
if (o_left != FRAME_LEFT_FRINGE_WIDTH (f) ||
o_right != FRAME_RIGHT_FRINGE_WIDTH (f) ||
o_cols != FRAME_FRINGE_COLS (f))
| (swap_nibble[(b>>12) & 0xf]));
b >>= (16 - fb->width);
#ifdef WORDS_BIGENDIAN
- b = ((b >> 8) | (b << 8));
+ b = bswap_16 (b);
#endif
*bits++ = b;
}
DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_face,
1, 2, 0,
doc: /* Set face for fringe bitmap BITMAP to FACE.
+FACE is merged with the `fringe' face, so normally FACE should specify
+only the foreground color.
If FACE is nil, reset face to default fringe face. */)
(Lisp_Object bitmap, Lisp_Object face)
{
}
#endif /* HAVE_NTGUI */
-
-#endif /* HAVE_WINDOW_SYSTEM */