comparison src/redisplay-xlike-inc.c @ 5198:bc3ede8f29a8

fix spacing in some files -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-04-09 Ben Wing <ben@xemacs.org> * fileio.c (check_writable): * fileio.c (Fdo_auto_save): * redisplay-xlike-inc.c (separate_textual_runs_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_mule): * redisplay-xlike-inc.c (separate_textual_runs_mule): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay-xlike-inc.c (XLIKE_output_vertical_divider): * redisplay.c (create_text_block): * redisplay.c (regenerate_window): * redisplay.c (redisplay_window): * redisplay.c (redisplay_device): * redisplay.c (window_line_number): * redisplay.c (point_would_be_visible): * redisplay.c (compute_display_line_dynarr_usage): * specifier.c (prune_specifiers): * specifier.c (finalize_specifier): * specifier.c (make_magic_specifier): * specifier.c (charset_matches_specifier_tag_set_p): * specifier.c (Fdefine_specifier_tag): * specifier.c (setup_device_initial_specifier_tags): * specifier.c (bodily_specifier): * specifier.c (add_spec_to_ghost_specifier): * specifier.c (remove_ghost_specifier): * specifier.c (set_specifier_fallback): * specifier.c (specifier_instance_from_inst_list): * specifier.c (set_specifier_caching): Fix coding style to correspond to GNU standard.
author Ben Wing <ben@xemacs.org>
date Fri, 09 Apr 2010 23:38:02 -0500
parents 0ca81354c4c7
children 6466bc9ebf15
comparison
equal deleted inserted replaced
5197:ce8ffb95bbe3 5198:bc3ede8f29a8
180 #if !defined(USE_XFT) && !defined(MULE) 180 #if !defined(USE_XFT) && !defined(MULE)
181 static int 181 static int
182 separate_textual_runs_nomule (unsigned char *text_storage, 182 separate_textual_runs_nomule (unsigned char *text_storage,
183 struct textual_run *run_storage, 183 struct textual_run *run_storage,
184 const Ichar *str, Charcount len, 184 const Ichar *str, Charcount len,
185 struct face_cachel *UNUSED(cachel)) 185 struct face_cachel *UNUSED (cachel))
186 { 186 {
187 if (!len) 187 if (!len)
188 return 0; 188 return 0;
189 189
190 run_storage[0].ptr = text_storage; 190 run_storage[0].ptr = text_storage;
210 */ 210 */
211 static int 211 static int
212 separate_textual_runs_xft_nomule (unsigned char *text_storage, 212 separate_textual_runs_xft_nomule (unsigned char *text_storage,
213 struct textual_run *run_storage, 213 struct textual_run *run_storage,
214 const Ichar *str, Charcount len, 214 const Ichar *str, Charcount len,
215 struct face_cachel *UNUSED(cachel)) 215 struct face_cachel *UNUSED (cachel))
216 { 216 {
217 int i; 217 int i;
218 if (!len) 218 if (!len)
219 return 0; 219 return 0;
220 220
224 run_storage[0].charset = Qnil; 224 run_storage[0].charset = Qnil;
225 225
226 for (i = 0; i < len; i++) 226 for (i = 0; i < len; i++)
227 { 227 {
228 *(XftChar16 *)text_storage = str[i]; 228 *(XftChar16 *)text_storage = str[i];
229 text_storage += sizeof(XftChar16); 229 text_storage += sizeof (XftChar16);
230 } 230 }
231 return 1; 231 return 1;
232 } 232 }
233 #endif 233 #endif
234 234
235 #if defined(USE_XFT) && defined(MULE) 235 #if defined(USE_XFT) && defined(MULE)
236 static int 236 static int
237 separate_textual_runs_xft_mule (unsigned char *text_storage, 237 separate_textual_runs_xft_mule (unsigned char *text_storage,
238 struct textual_run *run_storage, 238 struct textual_run *run_storage,
239 const Ichar *str, Charcount len, 239 const Ichar *str, Charcount len,
240 struct face_cachel *UNUSED(cachel)) 240 struct face_cachel *UNUSED (cachel))
241 { 241 {
242 Lisp_Object prev_charset = Qunbound; 242 Lisp_Object prev_charset = Qunbound;
243 int runs_so_far = 0, i; 243 int runs_so_far = 0, i;
244 244
245 run_storage[0].ptr = text_storage; 245 run_storage[0].ptr = text_storage;
248 run_storage[0].charset = Qnil; 248 run_storage[0].charset = Qnil;
249 249
250 for (i = 0; i < len; i++) 250 for (i = 0; i < len; i++)
251 { 251 {
252 Ichar ch = str[i]; 252 Ichar ch = str[i];
253 Lisp_Object charset = ichar_charset(ch); 253 Lisp_Object charset = ichar_charset (ch);
254 int ucs = ichar_to_unicode(ch); 254 int ucs = ichar_to_unicode (ch);
255 255
256 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to 256 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
257 REPLACMENT CHARACTER. */ 257 REPLACMENT CHARACTER. */
258 /* That means we can't handle characters outside of the BMP for now */ 258 /* That means we can't handle characters outside of the BMP for now */
259 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs; 259 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
268 prev_charset = charset; 268 prev_charset = charset;
269 runs_so_far++; 269 runs_so_far++;
270 } 270 }
271 271
272 *(XftChar16 *)text_storage = ucs; 272 *(XftChar16 *)text_storage = ucs;
273 text_storage += sizeof(XftChar16); 273 text_storage += sizeof (XftChar16);
274 } 274 }
275 275
276 if (runs_so_far) 276 if (runs_so_far)
277 run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1; 277 run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
278 return runs_so_far; 278 return runs_so_far;
333 Else if the font is indexed by an ISO 2022 "graphic register", 333 Else if the font is indexed by an ISO 2022 "graphic register",
334 set `graphic'. 334 set `graphic'.
335 These flags are almost mutually exclusive, but we're sloppy 335 These flags are almost mutually exclusive, but we're sloppy
336 about resetting "shadowed" flags. So the flags must be checked 336 about resetting "shadowed" flags. So the flags must be checked
337 in the proper order in computing byte1 and byte2, below. */ 337 in the proper order in computing byte1 and byte2, below. */
338 charset_leading_byte = XCHARSET_LEADING_BYTE(charset); 338 charset_leading_byte = XCHARSET_LEADING_BYTE (charset);
339 translate_to_ucs_2 = 339 translate_to_ucs_2 =
340 bit_vector_bit (FACE_CACHEL_FONT_FINAL_STAGE (cachel), 340 bit_vector_bit (FACE_CACHEL_FONT_FINAL_STAGE (cachel),
341 charset_leading_byte - MIN_LEADING_BYTE); 341 charset_leading_byte - MIN_LEADING_BYTE);
342 if (translate_to_ucs_2) 342 if (translate_to_ucs_2)
343 { 343 {
382 } 382 }
383 383
384 /* Must check flags in this order. See comment above. */ 384 /* Must check flags in this order. See comment above. */
385 if (translate_to_ucs_2) 385 if (translate_to_ucs_2)
386 { 386 {
387 int ucs = ichar_to_unicode(ch); 387 int ucs = ichar_to_unicode (ch);
388 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to 388 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
389 REPLACMENT CHARACTER. */ 389 REPLACMENT CHARACTER. */
390 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs; 390 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
391 391
392 byte1 = ucs >> 8; 392 byte1 = ucs >> 8;
1223 Region clip_reg = XCreateRegion(); 1223 Region clip_reg = XCreateRegion();
1224 XRectangle clip_box = { clip_start, ypos, 1224 XRectangle clip_box = { clip_start, ypos,
1225 clip_end - clip_start, height }; 1225 clip_end - clip_start, height };
1226 1226
1227 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 1227 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
1228 XftDrawSetClip(xftDraw, clip_reg); 1228 XftDrawSetClip (xftDraw, clip_reg);
1229 XDestroyRegion(clip_reg); 1229 XDestroyRegion (clip_reg);
1230 } 1230 }
1231 1231
1232 if (!bgc) 1232 if (!bgc)
1233 { 1233 {
1234 /* #### Neither rect_height nor XftTextExtents as computed 1234 /* #### Neither rect_height nor XftTextExtents as computed
1246 OK, unconditionally redraw the bevel, and increment 1246 OK, unconditionally redraw the bevel, and increment
1247 rect_height by 1. See x_output_display_block. -- sjt */ 1247 rect_height by 1. See x_output_display_block. -- sjt */
1248 struct textual_run *run = &runs[i]; 1248 struct textual_run *run = &runs[i];
1249 int rect_width = x_text_width_single_run (f, cachel, run); 1249 int rect_width = x_text_width_single_run (f, cachel, run);
1250 #ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS 1250 #ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS
1251 int rect_height = FONT_INSTANCE_ASCENT(fi) 1251 int rect_height = FONT_INSTANCE_ASCENT (fi)
1252 + FONT_INSTANCE_DESCENT(fi) + 1; 1252 + FONT_INSTANCE_DESCENT (fi) + 1;
1253 #else 1253 #else
1254 int rect_height = FONT_INSTANCE_ASCENT(fi) 1254 int rect_height = FONT_INSTANCE_ASCENT (fi)
1255 + FONT_INSTANCE_DESCENT(fi); 1255 + FONT_INSTANCE_DESCENT (fi);
1256 XGlyphInfo gi; 1256 XGlyphInfo gi;
1257 if (run->dimension == 2) { 1257 if (run->dimension == 2) {
1258 XftTextExtents16 (dpy, 1258 XftTextExtents16 (dpy,
1259 FONT_INSTANCE_X_XFTFONT(fi), 1259 FONT_INSTANCE_X_XFTFONT (fi),
1260 (XftChar16 *) run->ptr, run->len, &gi); 1260 (XftChar16 *) run->ptr, run->len, &gi);
1261 } else { 1261 } else {
1262 XftTextExtents8 (dpy, 1262 XftTextExtents8 (dpy,
1263 FONT_INSTANCE_X_XFTFONT(fi), 1263 FONT_INSTANCE_X_XFTFONT (fi),
1264 run->ptr, run->len, &gi); 1264 run->ptr, run->len, &gi);
1265 } 1265 }
1266 rect_height = rect_height > gi.height 1266 rect_height = rect_height > gi.height
1267 ? rect_height : gi.height; 1267 ? rect_height : gi.height;
1268 #endif 1268 #endif
1451 Region clip_reg = XCreateRegion(); 1451 Region clip_reg = XCreateRegion();
1452 XRectangle clip_box = { cursor_start, ypos, 1452 XRectangle clip_box = { cursor_start, ypos,
1453 cursor_width, height }; 1453 cursor_width, height };
1454 1454
1455 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 1455 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
1456 XftDrawSetClip(xftDraw, clip_reg); 1456 XftDrawSetClip (xftDraw, clip_reg);
1457 XDestroyRegion(clip_reg); 1457 XDestroyRegion (clip_reg);
1458 } 1458 }
1459 { /* draw background rectangle & draw text */ 1459 { /* draw background rectangle & draw text */
1460 int rect_height = FONT_INSTANCE_ASCENT(fi) 1460 int rect_height = FONT_INSTANCE_ASCENT (fi)
1461 + FONT_INSTANCE_DESCENT(fi); 1461 + FONT_INSTANCE_DESCENT (fi);
1462 int rect_width = x_text_width_single_run(f, cachel, &runs[i]); 1462 int rect_width = x_text_width_single_run (f, cachel, &runs[i]);
1463 XftColor xft_color; 1463 XftColor xft_color;
1464 1464
1465 xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0); 1465 xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
1466 XftDrawRect (xftDraw, &xft_color, 1466 XftDrawRect (xftDraw, &xft_color,
1467 xpos, ypos, rect_width, rect_height); 1467 xpos, ypos, rect_width, rect_height);
1473 else 1473 else
1474 XftDrawString16 (xftDraw, &xft_color, rf, xpos, dl->ypos, 1474 XftDrawString16 (xftDraw, &xft_color, rf, xpos, dl->ypos,
1475 (XftChar16 *) runs[i].ptr, runs[i].len); 1475 (XftChar16 *) runs[i].ptr, runs[i].len);
1476 } 1476 }
1477 1477
1478 XftDrawSetClip(xftDraw, 0); 1478 XftDrawSetClip (xftDraw, 0);
1479 } 1479 }
1480 else /* core font, not Xft */ 1480 else /* core font, not Xft */
1481 #endif /* USE_XFT */ 1481 #endif /* USE_XFT */
1482 { 1482 {
1483 XLIKE_RECTANGLE clip_box; 1483 XLIKE_RECTANGLE clip_box;
1770 XLIKE_output_vertical_divider 1770 XLIKE_output_vertical_divider
1771 1771
1772 Draw a vertical divider down the right side of the given window. 1772 Draw a vertical divider down the right side of the given window.
1773 ****************************************************************************/ 1773 ****************************************************************************/
1774 static void 1774 static void
1775 XLIKE_output_vertical_divider (struct window *w, int USED_IF_X(clear)) 1775 XLIKE_output_vertical_divider (struct window *w, int USED_IF_X (clear))
1776 { 1776 {
1777 struct frame *f = XFRAME (w->frame); 1777 struct frame *f = XFRAME (w->frame);
1778 struct device *d = XDEVICE (f->device); 1778 struct device *d = XDEVICE (f->device);
1779 1779
1780 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); 1780 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);