comparison src/fringe.c @ 91041:bdb3fe0ba9fa

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 866-879) - Merge multi-tty branch - Update from CVS - Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
author Miles Bader <miles@gnu.org>
date Thu, 11 Oct 2007 16:22:07 +0000
parents f55f9811f5d7 acac15277b75
children 606f2d163a64
comparison
equal deleted inserted replaced
91040:14c4a6aac623 91041:bdb3fe0ba9fa
27 #include "frame.h" 27 #include "frame.h"
28 #include "window.h" 28 #include "window.h"
29 #include "dispextern.h" 29 #include "dispextern.h"
30 #include "buffer.h" 30 #include "buffer.h"
31 #include "blockinput.h" 31 #include "blockinput.h"
32 #include "termhooks.h"
32 33
33 #ifdef HAVE_WINDOW_SYSTEM 34 #ifdef HAVE_WINDOW_SYSTEM
34 35
35 extern Lisp_Object Qfringe; 36 extern Lisp_Object Qfringe;
36 extern Lisp_Object Qtop, Qbottom, Qcenter; 37 extern Lisp_Object Qtop, Qbottom, Qcenter;
684 break; 685 break;
685 case ALIGN_BITMAP_TOP: 686 case ALIGN_BITMAP_TOP:
686 break; 687 break;
687 } 688 }
688 689
689 rif->draw_fringe_bitmap (w, row, &p); 690 FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
690 } 691 }
691 692
692 static int 693 static int
693 get_logical_cursor_bitmap (w, cursor) 694 get_logical_cursor_bitmap (w, cursor)
694 struct window *w; 695 struct window *w;
1276 fringe_faces[n] = Qnil; 1277 fringe_faces[n] = Qnil;
1277 1278
1278 fbp = &fringe_bitmaps[n]; 1279 fbp = &fringe_bitmaps[n];
1279 if (*fbp && (*fbp)->dynamic) 1280 if (*fbp && (*fbp)->dynamic)
1280 { 1281 {
1282 /* XXX Is SELECTED_FRAME OK here? */
1283 struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
1281 if (rif && rif->destroy_fringe_bitmap) 1284 if (rif && rif->destroy_fringe_bitmap)
1282 rif->destroy_fringe_bitmap (n); 1285 rif->destroy_fringe_bitmap (n);
1283 xfree (*fbp); 1286 xfree (*fbp);
1284 *fbp = NULL; 1287 *fbp = NULL;
1285 } 1288 }
1325 On MAC with big-endian CPU, we need to byte-swap each short. 1328 On MAC with big-endian CPU, we need to byte-swap each short.
1326 1329
1327 On W32 and MAC (little endian), there's no need to do this. 1330 On W32 and MAC (little endian), there's no need to do this.
1328 */ 1331 */
1329 1332
1333 #if defined (HAVE_X_WINDOWS)
1334 static unsigned char swap_nibble[16] = {
1335 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
1336 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
1337 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
1338 0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */
1339 #endif /* HAVE_X_WINDOWS */
1340
1330 void 1341 void
1331 init_fringe_bitmap (which, fb, once_p) 1342 init_fringe_bitmap (which, fb, once_p)
1332 int which; 1343 int which;
1333 struct fringe_bitmap *fb; 1344 struct fringe_bitmap *fb;
1334 int once_p; 1345 int once_p;
1335 { 1346 {
1336 if (once_p || fb->dynamic) 1347 if (once_p || fb->dynamic)
1337 { 1348 {
1338 #if defined (HAVE_X_WINDOWS) 1349 #if defined (HAVE_X_WINDOWS)
1339 static unsigned char swap_nibble[16]
1340 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
1341 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
1342 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
1343 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */
1344 unsigned short *bits = fb->bits; 1350 unsigned short *bits = fb->bits;
1345 int j; 1351 int j;
1346 1352
1347 if (fb->width <= 8) 1353 if (fb->width <= 8)
1348 { 1354 {
1381 #endif /* MAC_OS && WORDS_BIG_ENDIAN */ 1387 #endif /* MAC_OS && WORDS_BIG_ENDIAN */
1382 } 1388 }
1383 1389
1384 if (!once_p) 1390 if (!once_p)
1385 { 1391 {
1392 /* XXX Is SELECTED_FRAME OK here? */
1393 struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
1394
1386 destroy_fringe_bitmap (which); 1395 destroy_fringe_bitmap (which);
1387 1396
1388 if (rif && rif->define_fringe_bitmap) 1397 if (rif && rif->define_fringe_bitmap)
1389 rif->define_fringe_bitmap (which, fb->bits, fb->height, fb->width); 1398 rif->define_fringe_bitmap (which, fb->bits, fb->height, fb->width);
1390 1399
1691 1700
1692 #if defined (HAVE_NTGUI) || defined (MAC_OS) 1701 #if defined (HAVE_NTGUI) || defined (MAC_OS)
1693 1702
1694 void 1703 void
1695 #ifdef HAVE_NTGUI 1704 #ifdef HAVE_NTGUI
1696 w32_init_fringe () 1705 w32_init_fringe (rif)
1697 #else /* MAC_OS */ 1706 #else /* MAC_OS */
1698 mac_init_fringe () 1707 mac_init_fringe (rif)
1699 #endif 1708 #endif
1709 struct redisplay_interface *rif;
1700 { 1710 {
1701 int bt; 1711 int bt;
1702 1712
1703 if (!rif) 1713 if (!rif)
1704 return; 1714 return;
1715 void 1725 void
1716 w32_reset_fringes () 1726 w32_reset_fringes ()
1717 { 1727 {
1718 /* Destroy row bitmaps. */ 1728 /* Destroy row bitmaps. */
1719 int bt; 1729 int bt;
1730 struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
1720 1731
1721 if (!rif) 1732 if (!rif)
1722 return; 1733 return;
1723 1734
1724 for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++) 1735 for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++)