comparison src/glyphs.c @ 800:a5954632b187

[xemacs-hg @ 2002-03-31 08:27:14 by ben] more fixes, first crack at finishing behavior implementation TODO.ben-mule-21-5: Update. configure.in: Fix for new error-checking types. make-mswin-unicode.pl: Don't be fucked up by CRLF. Output code to force errors when nonintercepted Windows calls issued. behavior.el, dumped-lisp.el, menubar-items.el: Add support for saving using custom. Load into a dumped XEmacs. Correct :title to :short-doc in accordance with behavior-defs.el. Add a submenu under Options for turning on/off behaviors. cl-macs.el: Properly document `loop'. Fix a minor bug in keymap iteration and add support for bit-vector iteration. lisp-mode.el: Rearrange and add items for macro expanding. menubar-items.el: Document connection between these two functions. window.el: Port stuff from GNU 21.1. config.inc.samp, xemacs.mak: Separate out and add new variable for controlling error-checking. s/windowsnt.h: Use new ERROR_CHECK_ALL; not related to DEBUG_XEMACS. alloc.c, backtrace.h, buffer.c, buffer.h, bytecode.c, callproc.c, casetab.c, charset.h, chartab.c, cmdloop.c, config.h.in, console-msw.c, console-stream.c, console-tty.c, console.c, console.h, data.c, device-msw.c, device.c, device.h, dired-msw.c, dired.c, dumper.c, editfns.c, eldap.c, elhash.c, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, file-coding.h, fileio.c, frame-msw.c, frame.c, frame.h, glyphs-gtk.c, glyphs-msw.c, glyphs-shared.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, insdel.c, intl-auto-encap-win32.c, intl-auto-encap-win32.h, intl-encap-win32.c, intl-win32.c, keymap.c, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-x.c, menubar.c, mule-coding.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, opaque.c, print.c, process-nt.c, process-unix.c, process.c, rangetab.c, redisplay-msw.c, redisplay-output.c, redisplay.c, regex.c, scrollbar-msw.c, select-msw.c, signal.c, specifier.c, specifier.h, symbols.c, sysdep.c, syswindows.h, text.c, text.h, toolbar-msw.c, tooltalk.c, ui-gtk.c, unicode.c, window.c: Redo error-checking macros: ERROR_CHECK_TYPECHECK -> ERROR_CHECK_TYPES, ERROR_CHECK_CHARBPOS -> ERROR_CHECK_TEXT, add ERROR_CHECK_DISPLAY, ERROR_CHECK_STRUCTURES. Document these in config.h.in. Fix code to follow docs. Fix *_checking_assert() in accordance with new names. Attempt to fix periodic redisplay crash freeing display line structures. Add first implementation of sledgehammer redisplay check. Redo print_*() to use write_fmt_string(), write_fmt_string_lisp(). Fix bug in md5 handling. Rename character-to-unicode to char-to-unicode; same for unicode-to-char{acter}. Move chartab documentation to `make-char-table'. Some header cleanup. Clean up remaining places where nonintercepted Windows calls are being used. automated/mule-tests.el: Fix for new Unicode support.
author ben
date Sun, 31 Mar 2002 08:30:17 +0000
parents e38acbeb1cae
children 2b676dc88c66
comparison
equal deleted inserted replaced
799:03d9f9084848 800:a5954632b187
36 #include "device.h" 36 #include "device.h"
37 #include "elhash.h" 37 #include "elhash.h"
38 #include "faces.h" 38 #include "faces.h"
39 #include "frame.h" 39 #include "frame.h"
40 #include "glyphs.h" 40 #include "glyphs.h"
41 #include "gui.h"
41 #include "insdel.h" 42 #include "insdel.h"
42 #include "objects.h" 43 #include "objects.h"
43 #include "opaque.h" 44 #include "opaque.h"
44 #include "rangetab.h" 45 #include "rangetab.h"
45 #include "redisplay.h" 46 #include "redisplay.h"
901 902
902 static void 903 static void
903 print_image_instance (Lisp_Object obj, Lisp_Object printcharfun, 904 print_image_instance (Lisp_Object obj, Lisp_Object printcharfun,
904 int escapeflag) 905 int escapeflag)
905 { 906 {
906 char buf[100];
907 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj); 907 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj);
908 908
909 if (print_readably) 909 if (print_readably)
910 printing_unreadable_object ("#<image-instance 0x%x>", 910 printing_unreadable_object ("#<image-instance 0x%x>",
911 ii->header.uid); 911 ii->header.uid);
912 write_c_string ("#<image-instance (", printcharfun); 912 write_fmt_string_lisp (printcharfun, "#<image-instance (%s) ", 1,
913 print_internal (Fimage_instance_type (obj), printcharfun, 0); 913 Fimage_instance_type (obj));
914 write_c_string (") ", printcharfun);
915 if (!NILP (ii->name)) 914 if (!NILP (ii->name))
916 { 915 write_fmt_string_lisp (printcharfun, "%S ", 1, ii->name);
917 print_internal (ii->name, printcharfun, 1); 916 write_fmt_string_lisp (printcharfun, "on %s ", 1, ii->domain);
918 write_c_string (" ", printcharfun);
919 }
920 write_c_string ("on ", printcharfun);
921 print_internal (ii->domain, printcharfun, 0);
922 write_c_string (" ", printcharfun);
923 switch (IMAGE_INSTANCE_TYPE (ii)) 917 switch (IMAGE_INSTANCE_TYPE (ii))
924 { 918 {
925 case IMAGE_NOTHING: 919 case IMAGE_NOTHING:
926 break; 920 break;
927 921
941 print_internal (build_intstring (s + 1), printcharfun, 1); 935 print_internal (build_intstring (s + 1), printcharfun, 1);
942 else 936 else
943 print_internal (filename, printcharfun, 1); 937 print_internal (filename, printcharfun, 1);
944 } 938 }
945 if (IMAGE_INSTANCE_PIXMAP_DEPTH (ii) > 1) 939 if (IMAGE_INSTANCE_PIXMAP_DEPTH (ii) > 1)
946 sprintf (buf, " %dx%dx%d", IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 940 write_fmt_string (printcharfun, " %dx%dx%d",
947 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), 941 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
948 IMAGE_INSTANCE_PIXMAP_DEPTH (ii)); 942 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
943 IMAGE_INSTANCE_PIXMAP_DEPTH (ii));
949 else 944 else
950 sprintf (buf, " %dx%d", IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 945 write_fmt_string (printcharfun, " %dx%d",
951 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii)); 946 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
952 write_c_string (buf, printcharfun); 947 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii));
953 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)) || 948 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)) ||
954 !NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))) 949 !NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)))
955 { 950 {
956 write_c_string (" @", printcharfun); 951 write_c_string (" @", printcharfun);
957 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii))) 952 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)))
958 { 953 write_fmt_string (printcharfun, "%ld",
959 long_to_string (buf, XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii))); 954 XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)));
960 write_c_string (buf, printcharfun);
961 }
962 else 955 else
963 write_c_string ("??", printcharfun); 956 write_c_string ("??", printcharfun);
964 write_c_string (",", printcharfun); 957 write_c_string (",", printcharfun);
965 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))) 958 if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)))
966 { 959 write_fmt_string (printcharfun, "%ld",
967 long_to_string (buf, XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))); 960 XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)));
968 write_c_string (buf, printcharfun);
969 }
970 else 961 else
971 write_c_string ("??", printcharfun); 962 write_c_string ("??", printcharfun);
972 } 963 }
973 if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii)) || 964 if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii)) ||
974 !NILP (IMAGE_INSTANCE_PIXMAP_BG (ii))) 965 !NILP (IMAGE_INSTANCE_PIXMAP_BG (ii)))
993 984
994 case IMAGE_WIDGET: 985 case IMAGE_WIDGET:
995 print_internal (IMAGE_INSTANCE_WIDGET_TYPE (ii), printcharfun, 0); 986 print_internal (IMAGE_INSTANCE_WIDGET_TYPE (ii), printcharfun, 0);
996 987
997 if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_ITEM (ii))) 988 if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_ITEM (ii)))
998 { 989 write_fmt_string_lisp (printcharfun, " %S", 1,
999 write_c_string (" ", printcharfun); 990 IMAGE_INSTANCE_WIDGET_TEXT (ii));
1000 print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 1);
1001 }
1002 991
1003 if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii))) 992 if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii)))
1004 { 993 write_fmt_string_lisp (printcharfun, " face=%s", 1,
1005 write_c_string (" face=", printcharfun); 994 IMAGE_INSTANCE_WIDGET_FACE (ii));
1006 print_internal
1007 (IMAGE_INSTANCE_WIDGET_FACE (ii), printcharfun, 0);
1008 }
1009 /* fallthrough */ 995 /* fallthrough */
1010 996
1011 case IMAGE_SUBWINDOW: 997 case IMAGE_SUBWINDOW:
1012 sprintf (buf, " %dx%d", IMAGE_INSTANCE_WIDTH (ii), 998 write_fmt_string (printcharfun, " %dx%d", IMAGE_INSTANCE_WIDTH (ii),
1013 IMAGE_INSTANCE_HEIGHT (ii)); 999 IMAGE_INSTANCE_HEIGHT (ii));
1014 write_c_string (buf, printcharfun);
1015 1000
1016 /* This is stolen from frame.c. Subwindows are strange in that they 1001 /* This is stolen from frame.c. Subwindows are strange in that they
1017 are specific to a particular frame so we want to print in their 1002 are specific to a particular frame so we want to print in their
1018 description what that frame is. */ 1003 description what that frame is. */
1019 1004
1026 else 1011 else
1027 write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))), 1012 write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))),
1028 printcharfun); 1013 printcharfun);
1029 } 1014 }
1030 write_c_string ("-frame>", printcharfun); 1015 write_c_string ("-frame>", printcharfun);
1031 sprintf (buf, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); 1016 write_fmt_string (printcharfun, " 0x%p",
1032 write_c_string (buf, printcharfun); 1017 IMAGE_INSTANCE_SUBWINDOW_ID (ii));
1033 1018
1034 break; 1019 break;
1035 1020
1036 default: 1021 default:
1037 abort (); 1022 abort ();
1038 } 1023 }
1039 1024
1040 MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), print_image_instance, 1025 MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), print_image_instance,
1041 (ii, printcharfun, escapeflag)); 1026 (ii, printcharfun, escapeflag));
1042 sprintf (buf, " 0x%x>", ii->header.uid); 1027 write_fmt_string (printcharfun, " 0x%x>", ii->header.uid);
1043 write_c_string (buf, printcharfun);
1044 } 1028 }
1045 1029
1046 static void 1030 static void
1047 finalize_image_instance (void *header, int for_disksave) 1031 finalize_image_instance (void *header, int for_disksave)
1048 { 1032 {
3574 3558
3575 static void 3559 static void
3576 print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 3560 print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
3577 { 3561 {
3578 Lisp_Glyph *glyph = XGLYPH (obj); 3562 Lisp_Glyph *glyph = XGLYPH (obj);
3579 char buf[20];
3580 3563
3581 if (print_readably) 3564 if (print_readably)
3582 printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid); 3565 printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid);
3583 3566
3584 write_c_string ("#<glyph (", printcharfun); 3567 write_fmt_string_lisp (printcharfun, "#<glyph (%s", 1, Fglyph_type (obj));
3585 print_internal (Fglyph_type (obj), printcharfun, 0); 3568 write_fmt_string_lisp (printcharfun, ") %S", 1, glyph->image);
3586 write_c_string (") ", printcharfun); 3569 write_fmt_string (printcharfun, "0x%x>", glyph->header.uid);
3587 print_internal (glyph->image, printcharfun, 1);
3588 sprintf (buf, "0x%x>", glyph->header.uid);
3589 write_c_string (buf, printcharfun);
3590 } 3570 }
3591 3571
3592 /* Glyphs are equal if all of their display attributes are equal. We 3572 /* Glyphs are equal if all of their display attributes are equal. We
3593 don't compare names or doc-strings, because that would make equal 3573 don't compare names or doc-strings, because that would make equal
3594 be eq. 3574 be eq.