aboutsummaryrefslogtreecommitdiffstats
path: root/src/fringe.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-07-30 09:56:18 +0400
committerDmitry Antipov2013-07-30 09:56:18 +0400
commitd7e6881a2ec341affe3a89b26cf2da6919772214 (patch)
treed11a0e72bf7e9efde22a622ee76e2666d7e92a9b /src/fringe.c
parentec3058af9654df71cce93629f3eab32dcbb6b946 (diff)
downloademacs-d7e6881a2ec341affe3a89b26cf2da6919772214.tar.gz
emacs-d7e6881a2ec341affe3a89b26cf2da6919772214.zip
* fringe.c (draw_window_fringes, update_window_fringes)
(compute_fringe_widths): * w32term.c (x_draw_glyph_string): * window.c (candidate_window_p, Frecenter): * xfaces.c (realize_basic_faces, realize_default_face) (Fbitmap_space_p, Finternal_set_lisp_face_attribute) (x_update_menu_appearance, face_attr_equal_p, lface_equal_p): * xfns.c (x_set_cursor_color, xic_free_xfontset): * xmenu.c (Fx_menu_bar_open_internal): * xselect.c (x_reply_selection_request, Fx_get_atom_name): * xsettings.c (xft_settings_event): * xterm.c (x_draw_glyph_string, x_had_errors_p): Use bool for booleans. Adjust style and comments where appropriate. * dispextern.h (draw_window_fringes, update_window_fringes) (compute_fringe_widths): * xterm.h (x_had_errors_p): Adjust prototype.
Diffstat (limited to 'src/fringe.c')
-rw-r--r--src/fringe.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/fringe.c b/src/fringe.c
index f728cd6d5ff..1d05244e64e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -890,31 +890,32 @@ draw_row_fringe_bitmaps (struct window *w, struct glyph_row *row)
890/* Draw the fringes of window W. Only fringes for rows marked for 890/* Draw the fringes of window W. Only fringes for rows marked for
891 update in redraw_fringe_bitmaps_p are drawn. 891 update in redraw_fringe_bitmaps_p are drawn.
892 892
893 Return >0 if left or right fringe was redrawn in any way. 893 Return nonzero if left or right fringe was redrawn in any way.
894 894
895 If NO_FRINGE is non-zero, also return >0 if either fringe has zero width. 895 If NO_FRINGE_P is non-zero, also return nonzero if either fringe
896 has zero width.
896 897
897 A return value >0 indicates that the vertical line between windows 898 A return nonzero value indicates that the vertical line between
898 needs update (as it may be drawn in the fringe). 899 windows needs update (as it may be drawn in the fringe).
899*/ 900*/
900 901
901int 902bool
902draw_window_fringes (struct window *w, int no_fringe) 903draw_window_fringes (struct window *w, bool no_fringe_p)
903{ 904{
904 struct glyph_row *row; 905 struct glyph_row *row;
905 int yb = window_text_bottom_y (w); 906 int yb = window_text_bottom_y (w);
906 int nrows = w->current_matrix->nrows; 907 int nrows = w->current_matrix->nrows;
907 int y, rn; 908 int y, rn;
908 int updated = 0; 909 bool updated_p = 0;
909 910
910 if (w->pseudo_window_p) 911 if (w->pseudo_window_p)
911 return 0; 912 return updated_p;
912 913
913 /* Must draw line if no fringe */ 914 /* Must draw line if no fringe */
914 if (no_fringe 915 if (no_fringe_p
915 && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 916 && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
916 || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0)) 917 || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
917 updated++; 918 updated_p = 1;
918 919
919 for (y = w->vscroll, rn = 0, row = w->current_matrix->rows; 920 for (y = w->vscroll, rn = 0, row = w->current_matrix->rows;
920 y < yb && rn < nrows; 921 y < yb && rn < nrows;
@@ -924,10 +925,10 @@ draw_window_fringes (struct window *w, int no_fringe)
924 continue; 925 continue;
925 draw_row_fringe_bitmaps (w, row); 926 draw_row_fringe_bitmaps (w, row);
926 row->redraw_fringe_bitmaps_p = 0; 927 row->redraw_fringe_bitmaps_p = 0;
927 updated++; 928 updated_p = 1;
928 } 929 }
929 930
930 return updated; 931 return updated_p;
931} 932}
932 933
933 934
@@ -936,14 +937,14 @@ draw_window_fringes (struct window *w, int no_fringe)
936 937
937 If KEEP_CURRENT_P is 0, update current_matrix too. */ 938 If KEEP_CURRENT_P is 0, update current_matrix too. */
938 939
939int 940bool
940update_window_fringes (struct window *w, int keep_current_p) 941update_window_fringes (struct window *w, bool keep_current_p)
941{ 942{
942 struct glyph_row *row, *cur = 0; 943 struct glyph_row *row, *cur = 0;
943 int yb = window_text_bottom_y (w); 944 int yb = window_text_bottom_y (w);
944 int rn, nrows = w->current_matrix->nrows; 945 int rn, nrows = w->current_matrix->nrows;
945 int y; 946 int y;
946 int redraw_p = 0; 947 bool redraw_p = 0;
947 Lisp_Object boundary_top = Qnil, boundary_bot = Qnil; 948 Lisp_Object boundary_top = Qnil, boundary_bot = Qnil;
948 Lisp_Object arrow_top = Qnil, arrow_bot = Qnil; 949 Lisp_Object arrow_top = Qnil, arrow_bot = Qnil;
949 Lisp_Object empty_pos; 950 Lisp_Object empty_pos;
@@ -1169,7 +1170,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1169 int left, right; 1170 int left, right;
1170 unsigned left_face_id, right_face_id; 1171 unsigned left_face_id, right_face_id;
1171 int left_offset, right_offset; 1172 int left_offset, right_offset;
1172 int periodic_p; 1173 bool periodic_p;
1173 1174
1174 row = w->desired_matrix->rows + rn; 1175 row = w->desired_matrix->rows + rn;
1175 cur = w->current_matrix->rows + rn; 1176 cur = w->current_matrix->rows + rn;
@@ -1285,7 +1286,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1285 || periodic_p != cur->fringe_bitmap_periodic_p 1286 || periodic_p != cur->fringe_bitmap_periodic_p
1286 || cur->redraw_fringe_bitmaps_p) 1287 || cur->redraw_fringe_bitmaps_p)
1287 { 1288 {
1288 redraw_p = row->redraw_fringe_bitmaps_p = 1; 1289 redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
1289 if (!keep_current_p) 1290 if (!keep_current_p)
1290 { 1291 {
1291 cur->redraw_fringe_bitmaps_p = 1; 1292 cur->redraw_fringe_bitmaps_p = 1;
@@ -1304,7 +1305,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1304 1305
1305 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap) 1306 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap)
1306 { 1307 {
1307 redraw_p = row->redraw_fringe_bitmaps_p = 1; 1308 redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
1308 if (!keep_current_p) 1309 if (!keep_current_p)
1309 { 1310 {
1310 cur->redraw_fringe_bitmaps_p = 1; 1311 cur->redraw_fringe_bitmaps_p = 1;
@@ -1339,7 +1340,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1339*/ 1340*/
1340 1341
1341void 1342void
1342compute_fringe_widths (struct frame *f, int redraw) 1343compute_fringe_widths (struct frame *f, bool redraw_p)
1343{ 1344{
1344 int o_left = FRAME_LEFT_FRINGE_WIDTH (f); 1345 int o_left = FRAME_LEFT_FRINGE_WIDTH (f);
1345 int o_right = FRAME_RIGHT_FRINGE_WIDTH (f); 1346 int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
@@ -1410,7 +1411,7 @@ compute_fringe_widths (struct frame *f, int redraw)
1410 FRAME_FRINGE_COLS (f) = 0; 1411 FRAME_FRINGE_COLS (f) = 0;
1411 } 1412 }
1412 1413
1413 if (redraw && FRAME_VISIBLE_P (f)) 1414 if (redraw_p && FRAME_VISIBLE_P (f))
1414 if (o_left != FRAME_LEFT_FRINGE_WIDTH (f) || 1415 if (o_left != FRAME_LEFT_FRINGE_WIDTH (f) ||
1415 o_right != FRAME_RIGHT_FRINGE_WIDTH (f) || 1416 o_right != FRAME_RIGHT_FRINGE_WIDTH (f) ||
1416 o_cols != FRAME_FRINGE_COLS (f)) 1417 o_cols != FRAME_FRINGE_COLS (f))