Mercurial > hg > xemacs-beta
comparison src/toolbar.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 | 0784d089fdc9 |
children | 190b164ddcac |
comparison
equal
deleted
inserted
replaced
562:c775bd016b32 | 563:183866b06e0b |
---|---|
218 { | 218 { |
219 if (EQ (position, Qtop)) return TOP_TOOLBAR; | 219 if (EQ (position, Qtop)) return TOP_TOOLBAR; |
220 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; | 220 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; |
221 if (EQ (position, Qleft)) return LEFT_TOOLBAR; | 221 if (EQ (position, Qleft)) return LEFT_TOOLBAR; |
222 if (EQ (position, Qright)) return RIGHT_TOOLBAR; | 222 if (EQ (position, Qright)) return RIGHT_TOOLBAR; |
223 signal_simple_error ("Invalid toolbar position", position); | 223 invalid_constant ("Invalid toolbar position", position); |
224 | 224 |
225 return TOP_TOOLBAR; /* not reached */ | 225 return TOP_TOOLBAR; /* not reached */ |
226 } | 226 } |
227 | 227 |
228 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* | 228 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* |
606 UNGCPRO; | 606 UNGCPRO; |
607 return Qnil; | 607 return Qnil; |
608 } | 608 } |
609 | 609 |
610 if (!CONSP (toolbar)) | 610 if (!CONSP (toolbar)) |
611 signal_simple_error ("toolbar description must be a list", toolbar); | 611 sferror ("toolbar description must be a list", toolbar); |
612 | 612 |
613 /* First synchronize any existing buttons. */ | 613 /* First synchronize any existing buttons. */ |
614 while (!NILP (toolbar) && !NILP (buttons)) | 614 while (!NILP (toolbar) && !NILP (buttons)) |
615 { | 615 { |
616 struct toolbar_button *tb; | 616 struct toolbar_button *tb; |
617 | 617 |
618 if (NILP (XCAR (toolbar))) | 618 if (NILP (XCAR (toolbar))) |
619 { | 619 { |
620 if (pushright_seen) | 620 if (pushright_seen) |
621 signal_simple_error | 621 sferror |
622 ("more than one partition (nil) in toolbar description", | 622 ("more than one partition (nil) in toolbar description", |
623 orig_toolbar); | 623 orig_toolbar); |
624 else | 624 else |
625 pushright_seen = 1; | 625 pushright_seen = 1; |
626 } | 626 } |
662 Lisp_Object new_button; | 662 Lisp_Object new_button; |
663 | 663 |
664 if (NILP (XCAR (toolbar))) | 664 if (NILP (XCAR (toolbar))) |
665 { | 665 { |
666 if (pushright_seen) | 666 if (pushright_seen) |
667 signal_simple_error | 667 sferror |
668 ("more than one partition (nil) in toolbar description", | 668 ("more than one partition (nil) in toolbar description", |
669 orig_toolbar); | 669 orig_toolbar); |
670 else | 670 else |
671 pushright_seen = 1; | 671 pushright_seen = 1; |
672 } | 672 } |
940 /* Toolbar specifier type */ | 940 /* Toolbar specifier type */ |
941 /************************************************************************/ | 941 /************************************************************************/ |
942 | 942 |
943 DEFINE_SPECIFIER_TYPE (toolbar); | 943 DEFINE_SPECIFIER_TYPE (toolbar); |
944 | 944 |
945 #define CTB_ERROR(msg) do { \ | 945 #define CTB_ERROR(msg) do { \ |
946 maybe_signal_simple_error (msg, button, Qtoolbar, errb); \ | 946 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ |
947 RETURN_SANS_WARNINGS Qnil; \ | 947 RETURN_SANS_WARNINGS Qnil; \ |
948 } while (0) | 948 } while (0) |
949 | 949 |
950 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ | 950 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ |
951 static Lisp_Object | 951 static Lisp_Object |
952 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, | 952 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, |
953 Lisp_Object val, Error_behavior errb) | 953 Lisp_Object val, Error_behavior errb) |
954 { | 954 { |
955 if (!KEYWORDP (key)) | 955 if (!KEYWORDP (key)) |
956 { | 956 { |
957 maybe_signal_simple_error_2 ("Not a keyword", key, button, Qtoolbar, | 957 maybe_signal_error_2 (Qinvalid_argument, "Not a keyword", key, button, |
958 errb); | 958 Qtoolbar, errb); |
959 return Qnil; | 959 return Qnil; |
960 } | 960 } |
961 | 961 |
962 if (EQ (key, Q_style)) | 962 if (EQ (key, Q_style)) |
963 { | 963 { |
1112 | 1112 |
1113 if (NILP (instantiator)) | 1113 if (NILP (instantiator)) |
1114 return; | 1114 return; |
1115 | 1115 |
1116 if (!CONSP (instantiator)) | 1116 if (!CONSP (instantiator)) |
1117 signal_simple_error ("Toolbar spec must be list or nil", instantiator); | 1117 sferror ("Toolbar spec must be list or nil", instantiator); |
1118 | 1118 |
1119 for (rest = instantiator; !NILP (rest); rest = XCDR (rest)) | 1119 for (rest = instantiator; !NILP (rest); rest = XCDR (rest)) |
1120 { | 1120 { |
1121 if (!CONSP (rest)) | 1121 if (!CONSP (rest)) |
1122 signal_simple_error ("Bad list in toolbar spec", instantiator); | 1122 sferror ("Bad list in toolbar spec", instantiator); |
1123 | 1123 |
1124 if (NILP (XCAR (rest))) | 1124 if (NILP (XCAR (rest))) |
1125 { | 1125 { |
1126 if (pushright_seen) | 1126 if (pushright_seen) |
1127 error | 1127 sferror |
1128 ("More than one partition (nil) in instantiator description"); | 1128 ("More than one partition (nil) in instantiator description", |
1129 instantiator); | |
1129 else | 1130 else |
1130 pushright_seen = 1; | 1131 pushright_seen = 1; |
1131 } | 1132 } |
1132 else | 1133 else |
1133 Fcheck_toolbar_button_syntax (XCAR (rest), Qnil); | 1134 Fcheck_toolbar_button_syntax (XCAR (rest), Qnil); |
1251 void | 1252 void |
1252 syms_of_toolbar (void) | 1253 syms_of_toolbar (void) |
1253 { | 1254 { |
1254 INIT_LRECORD_IMPLEMENTATION (toolbar_button); | 1255 INIT_LRECORD_IMPLEMENTATION (toolbar_button); |
1255 | 1256 |
1256 defsymbol (&Qtoolbar_buttonp, "toolbar-button-p"); | 1257 DEFSYMBOL_MULTIWORD_PREDICATE (Qtoolbar_buttonp); |
1257 defsymbol (&Q2D, "2D"); | 1258 DEFSYMBOL (Q2D); |
1258 defsymbol (&Q3D, "3D"); | 1259 DEFSYMBOL (Q3D); |
1259 defsymbol (&Q2d, "2d"); | 1260 DEFSYMBOL (Q2d); |
1260 defsymbol (&Q3d, "3d"); | 1261 DEFSYMBOL (Q3d); |
1261 defsymbol (&Q_size, ":size"); Fset (Q_size, Q_size); | 1262 DEFKEYWORD (Q_size); |
1262 | 1263 |
1263 defsymbol (&Qinit_toolbar_from_resources, "init-toolbar-from-resources"); | 1264 DEFSYMBOL (Qinit_toolbar_from_resources); |
1264 DEFSUBR (Ftoolbar_button_p); | 1265 DEFSUBR (Ftoolbar_button_p); |
1265 DEFSUBR (Ftoolbar_button_callback); | 1266 DEFSUBR (Ftoolbar_button_callback); |
1266 DEFSUBR (Ftoolbar_button_help_string); | 1267 DEFSUBR (Ftoolbar_button_help_string); |
1267 DEFSUBR (Ftoolbar_button_enabled_p); | 1268 DEFSUBR (Ftoolbar_button_enabled_p); |
1268 DEFSUBR (Fset_toolbar_button_down_flag); | 1269 DEFSUBR (Fset_toolbar_button_down_flag); |