diff src/device.c @ 563:183866b06e0b

[xemacs-hg @ 2001-05-24 07:50:48 by ben] Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c: -- defsymbol -> DEFSYMBOL. -- add an error type to all errors. -- eliminate the error functions in eval.c that let you just use Qerror as the type. -- redo the error API to be more consistent, sensibly named, and easier to use. -- redo the error hierarchy somewhat. create new errors: structure-formation-error, gui-error, invalid-constant, stack-overflow, out-of-memory, process-error, network-error, sound-error, printing-unreadable-object, base64-conversion- error; coding-system-error renamed to text-conversion error; some others. -- fix Mule problems in error strings in emodules.c, tooltalk.c. -- fix error handling in mswin open-network-stream. -- Mule-ize all sound files and clean up the headers. -- nativesound.h -> sound.h and used for all sound files. -- move some shared stuff into glyphs-shared.c: first attempt at eliminating some of the massive GTK code duplication. xemacs.mak: add glyphs-shared.c. xemacs-faq.texi: document how to debug X errors subr.el: fix doc string to reflect reality
author ben
date Thu, 24 May 2001 07:51:33 +0000
parents 9a775fb11bb7
children 190b164ddcac
line wrap: on
line diff
--- a/src/device.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/device.c	Thu May 24 07:51:33 2001 +0000
@@ -119,8 +119,8 @@
   char buf[256];
 
   if (print_readably)
-    error ("printing unreadable object #<device %s 0x%x>",
-	   XSTRING_DATA (d->name), d->header.uid);
+    printing_unreadable_object ("#<device %s 0x%x>",
+				XSTRING_DATA (d->name), d->header.uid);
 
   sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" :
 	   DEVICE_TYPE_NAME (d));
@@ -279,7 +279,7 @@
 		    (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device)))),
                     Qnil);
   else
-    error ("Can't select a device with no frames");
+    invalid_operation ("Can't select a device with no frames", Qunbound);
   return Qnil;
 }
 
@@ -302,7 +302,7 @@
   CHECK_LIVE_FRAME (frame);
 
   if (! EQ (device, FRAME_DEVICE (XFRAME (frame))))
-    error ("In `set-device-selected-frame', FRAME is not on DEVICE");
+    invalid_argument ("In `set-device-selected-frame', FRAME is not on DEVICE", Qunbound);
 
   if (EQ (device, Fselected_device (Qnil)))
     return Fselect_frame (frame);
@@ -487,9 +487,9 @@
   if (NILP (device))
     {
       if (NILP (type))
-	signal_simple_error ("No such device", connection);
+	invalid_argument ("No such device", connection);
       else
-	signal_simple_error_2 ("No such device", type, connection);
+	invalid_argument_2 ("No such device", type, connection);
     }
   return device;
 }
@@ -557,7 +557,7 @@
 
   conmeths = decode_console_type (type, ERROR_ME_NOT);
   if (!conmeths)
-    signal_simple_error ("Invalid device type", type);
+    invalid_constant ("Invalid device type", type);
 
   device = Ffind_device (connection, type);
   if (!NILP (device))
@@ -883,9 +883,9 @@
   struct device *d = decode_device (device);
   XSETDEVICE (device, d);
   if (!DEVICE_TTY_P (d))
-    signal_simple_error ("Cannot change the class of this device", device);
+    gui_error ("Cannot change the class of this device", device);
   if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale))
-    signal_simple_error ("Must be color, mono, or grayscale", class);
+    invalid_constant ("Must be color, mono, or grayscale", class);
   if (! EQ (DEVICE_CLASS (d), class))
     {
       Lisp_Object frmcons;
@@ -1067,7 +1067,7 @@
   FROB (slow_device);
   FROB (security);
   else
-    signal_simple_error ("Invalid device metric symbol", metric);
+    invalid_constant ("Invalid device metric symbol", metric);
 
   res = DEVMETH_OR_GIVEN (d, device_system_metrics, (d, m), Qunbound);
   return UNBOUNDP(res) ? default_ : res;
@@ -1186,7 +1186,7 @@
 {
   if (!WINDOWP (domain) && !FRAMEP (domain)
       && !DEVICEP (domain) && !CONSOLEP (domain))
-    signal_simple_error
+    invalid_argument
       ("Domain must be either a window, frame, device or console", domain);
 
   return domain_device_type (domain);
@@ -1280,54 +1280,54 @@
   DEFSUBR (Fdomain_device_type);
   DEFSUBR (Fdevice_printer_p);
 
-  defsymbol (&Qdevicep, "devicep");
-  defsymbol (&Qdevice_live_p, "device-live-p");
+  DEFSYMBOL (Qdevicep);
+  DEFSYMBOL (Qdevice_live_p);
 
-  defsymbol (&Qcreate_device_hook, "create-device-hook");
-  defsymbol (&Qdelete_device_hook, "delete-device-hook");
+  DEFSYMBOL (Qcreate_device_hook);
+  DEFSYMBOL (Qdelete_device_hook);
 
   /* Qcolor defined in general.c */
-  defsymbol (&Qgrayscale, "grayscale");
-  defsymbol (&Qmono, "mono");
+  DEFSYMBOL (Qgrayscale);
+  DEFSYMBOL (Qmono);
 
   /* Device metrics symbols */
-  defsymbol (&Qcolor_default, "color-default");
-  defsymbol (&Qcolor_select, "color-select");
-  defsymbol (&Qcolor_balloon, "color-balloon");
-  defsymbol (&Qcolor_3d_face, "color-3d-face");
-  defsymbol (&Qcolor_3d_light, "color-3d-light");
-  defsymbol (&Qcolor_3d_dark, "color-3d-dark");
-  defsymbol (&Qcolor_menu, "color-menu");
-  defsymbol (&Qcolor_menu_highlight, "color-menu-highlight");
-  defsymbol (&Qcolor_menu_button, "color-menu-button");
-  defsymbol (&Qcolor_menu_disabled, "color-menu-disabled");
-  defsymbol (&Qcolor_toolbar, "color-toolbar");
-  defsymbol (&Qcolor_scrollbar, "color-scrollbar");
-  defsymbol (&Qcolor_desktop, "color-desktop");
-  defsymbol (&Qcolor_workspace, "color-workspace");
-  defsymbol (&Qfont_default, "font-default");
-  defsymbol (&Qfont_menubar, "font-menubar");
-  defsymbol (&Qfont_dialog, "font-dialog");
-  defsymbol (&Qsize_cursor, "size-cursor");
-  defsymbol (&Qsize_scrollbar, "size-scrollbar");
-  defsymbol (&Qsize_menu, "size-menu");
-  defsymbol (&Qsize_toolbar, "size-toolbar");
-  defsymbol (&Qsize_toolbar_button, "size-toolbar-button");
-  defsymbol (&Qsize_toolbar_border, "size-toolbar-border");
-  defsymbol (&Qsize_icon, "size-icon");
-  defsymbol (&Qsize_icon_small, "size-icon-small");
-  defsymbol (&Qsize_device, "size-device");
-  defsymbol (&Qsize_workspace, "size-workspace");
-  defsymbol (&Qoffset_workspace, "offset-workspace");
-  defsymbol (&Qsize_device_mm, "size-device-mm");
-  defsymbol (&Qnum_bit_planes, "num-bit-planes");
-  defsymbol (&Qnum_color_cells, "num-color-cells");
-  defsymbol (&Qdevice_dpi, "device-dpi");
-  defsymbol (&Qmouse_buttons, "mouse-buttons");
-  defsymbol (&Qswap_buttons, "swap-buttons");
-  defsymbol (&Qshow_sounds, "show-sounds");
-  defsymbol (&Qslow_device, "slow-device");
-  defsymbol (&Qsecurity, "security");
+  DEFSYMBOL (Qcolor_default);
+  DEFSYMBOL (Qcolor_select);
+  DEFSYMBOL (Qcolor_balloon);
+  DEFSYMBOL (Qcolor_3d_face);
+  DEFSYMBOL (Qcolor_3d_light);
+  DEFSYMBOL (Qcolor_3d_dark);
+  DEFSYMBOL (Qcolor_menu);
+  DEFSYMBOL (Qcolor_menu_highlight);
+  DEFSYMBOL (Qcolor_menu_button);
+  DEFSYMBOL (Qcolor_menu_disabled);
+  DEFSYMBOL (Qcolor_toolbar);
+  DEFSYMBOL (Qcolor_scrollbar);
+  DEFSYMBOL (Qcolor_desktop);
+  DEFSYMBOL (Qcolor_workspace);
+  DEFSYMBOL (Qfont_default);
+  DEFSYMBOL (Qfont_menubar);
+  DEFSYMBOL (Qfont_dialog);
+  DEFSYMBOL (Qsize_cursor);
+  DEFSYMBOL (Qsize_scrollbar);
+  DEFSYMBOL (Qsize_menu);
+  DEFSYMBOL (Qsize_toolbar);
+  DEFSYMBOL (Qsize_toolbar_button);
+  DEFSYMBOL (Qsize_toolbar_border);
+  DEFSYMBOL (Qsize_icon);
+  DEFSYMBOL (Qsize_icon_small);
+  DEFSYMBOL (Qsize_device);
+  DEFSYMBOL (Qsize_workspace);
+  DEFSYMBOL (Qoffset_workspace);
+  DEFSYMBOL (Qsize_device_mm);
+  DEFSYMBOL (Qnum_bit_planes);
+  DEFSYMBOL (Qnum_color_cells);
+  DEFSYMBOL (Qdevice_dpi);
+  DEFSYMBOL (Qmouse_buttons);
+  DEFSYMBOL (Qswap_buttons);
+  DEFSYMBOL (Qshow_sounds);
+  DEFSYMBOL (Qslow_device);
+  DEFSYMBOL (Qsecurity);
 }
 
 void