Mercurial > hg > xemacs-beta
comparison src/ui-gtk.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 | 2923009caf47 |
comparison
equal
deleted
inserted
replaced
562:c775bd016b32 | 563:183866b06e0b |
---|---|
83 { | 83 { |
84 g_hash_table_insert (dll_cache, g_strdup (XSTRING_DATA (dll)), h); | 84 g_hash_table_insert (dll_cache, g_strdup (XSTRING_DATA (dll)), h); |
85 } | 85 } |
86 else | 86 else |
87 { | 87 { |
88 signal_simple_error ("dll_open error", build_string (dll_error (NULL))); | 88 signal_error (Qfile_error, |
89 "dll_open error", build_string (dll_error (NULL))); | |
89 } | 90 } |
90 } | 91 } |
91 return (h ? Qt : Qnil); | 92 return (h ? Qt : Qnil); |
92 } | 93 } |
93 | 94 |
307 ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 308 ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
308 { | 309 { |
309 char buf[200]; | 310 char buf[200]; |
310 | 311 |
311 if (print_readably) | 312 if (print_readably) |
312 error ("printing unreadable object #<ffi %p", XFFI (obj)->function_ptr); | 313 printing_unreadable_object ("#<ffi %p>", XFFI (obj)->function_ptr); |
313 | 314 |
314 write_c_string ("#<ffi ", printcharfun); | 315 write_c_string ("#<ffi ", printcharfun); |
315 print_internal (XFFI (obj)->function_name, printcharfun, 1); | 316 print_internal (XFFI (obj)->function_name, printcharfun, 1); |
316 if (XFFI (obj)->n_args) | 317 if (XFFI (obj)->n_args) |
317 { | 318 { |
517 | 518 |
518 arg.type = gtk_type_from_name ((char *) XSTRING_DATA (type)); | 519 arg.type = gtk_type_from_name ((char *) XSTRING_DATA (type)); |
519 | 520 |
520 if (arg.type == GTK_TYPE_INVALID) | 521 if (arg.type == GTK_TYPE_INVALID) |
521 { | 522 { |
522 signal_simple_error ("Unknown type", type); | 523 sferror ("Unknown type", type); |
523 } | 524 } |
524 | 525 |
525 /* Need to look thru the already-loaded dlls */ | 526 /* Need to look thru the already-loaded dlls */ |
526 { | 527 { |
527 struct __dll_mapper_closure closure; | 528 struct __dll_mapper_closure closure; |
533 g_hash_table_foreach (dll_cache, __dll_mapper, &closure); | 534 g_hash_table_foreach (dll_cache, __dll_mapper, &closure); |
534 } | 535 } |
535 | 536 |
536 if (!var) | 537 if (!var) |
537 { | 538 { |
538 signal_simple_error ("Could not locate variable", name); | 539 gui_error ("Could not locate variable", name); |
539 } | 540 } |
540 | 541 |
541 GTK_VALUE_POINTER(arg) = var; | 542 GTK_VALUE_POINTER(arg) = var; |
542 CONVERT_RETVAL (arg, 0); | 543 CONVERT_RETVAL (arg, 0); |
543 return (gtk_type_to_lisp (&arg)); | 544 return (gtk_type_to_lisp (&arg)); |
576 g_hash_table_foreach (dll_cache, __dll_mapper, &closure); | 577 g_hash_table_foreach (dll_cache, __dll_mapper, &closure); |
577 } | 578 } |
578 | 579 |
579 if (!name_func) | 580 if (!name_func) |
580 { | 581 { |
581 signal_simple_error ("Could not locate function", name); | 582 gui_error ("Could not locate function", name); |
582 } | 583 } |
583 | 584 |
584 data = allocate_ffi_data (); | 585 data = allocate_ffi_data (); |
585 | 586 |
586 if (NILP (rettype)) | 587 if (NILP (rettype)) |
605 | 606 |
606 the_type = gtk_type_from_name ((char *) XSTRING_DATA (type)); | 607 the_type = gtk_type_from_name ((char *) XSTRING_DATA (type)); |
607 | 608 |
608 if (the_type == GTK_TYPE_INVALID) | 609 if (the_type == GTK_TYPE_INVALID) |
609 { | 610 { |
610 signal_simple_error ("Unknown argument type", type); | 611 invalid_argument ("Unknown argument type", type); |
611 } | 612 } |
612 | 613 |
613 /* All things must be reduced to their basest form... */ | 614 /* All things must be reduced to their basest form... */ |
614 import_gtk_type (the_type); | 615 import_gtk_type (the_type); |
615 data->args[n_args] = the_type; /* GTK_FUNDAMENTAL_TYPE (the_type); */ | 616 data->args[n_args] = the_type; /* GTK_FUNDAMENTAL_TYPE (the_type); */ |
617 /* Now lets build up another chunk of our marshaller function name */ | 618 /* Now lets build up another chunk of our marshaller function name */ |
618 marshaller_type = type_to_marshaller_type (data->args[n_args]); | 619 marshaller_type = type_to_marshaller_type (data->args[n_args]); |
619 | 620 |
620 if (NILP (marshaller_type)) | 621 if (NILP (marshaller_type)) |
621 { | 622 { |
622 signal_simple_error ("Do not know how to marshal", type); | 623 invalid_argument ("Do not know how to marshal", type); |
623 } | 624 } |
624 marshaller = concat3 (marshaller, build_string ("_"), marshaller_type); | 625 marshaller = concat3 (marshaller, build_string ("_"), marshaller_type); |
625 n_args++; | 626 n_args++; |
626 } | 627 } |
627 } | 628 } |
633 rettype = Fsymbol_name (rettype); | 634 rettype = Fsymbol_name (rettype); |
634 data->return_type = gtk_type_from_name ((char *) XSTRING_DATA (rettype)); | 635 data->return_type = gtk_type_from_name ((char *) XSTRING_DATA (rettype)); |
635 | 636 |
636 if (data->return_type == GTK_TYPE_INVALID) | 637 if (data->return_type == GTK_TYPE_INVALID) |
637 { | 638 { |
638 signal_simple_error ("Unknown return type", rettype); | 639 invalid_argument ("Unknown return type", rettype); |
639 } | 640 } |
640 | 641 |
641 import_gtk_type (data->return_type); | 642 import_gtk_type (data->return_type); |
642 | 643 |
643 marshaller = concat3 (type_to_marshaller_type (data->return_type), build_string ("_"), marshaller); | 644 marshaller = concat3 (type_to_marshaller_type (data->return_type), build_string ("_"), marshaller); |
645 | 646 |
646 marshaller_func = (ffi_marshalling_function) find_marshaller ((char *) XSTRING_DATA (marshaller)); | 647 marshaller_func = (ffi_marshalling_function) find_marshaller ((char *) XSTRING_DATA (marshaller)); |
647 | 648 |
648 if (!marshaller_func) | 649 if (!marshaller_func) |
649 { | 650 { |
650 signal_simple_error ("Could not locate marshaller function", marshaller); | 651 gui_error ("Could not locate marshaller function", marshaller); |
651 } | 652 } |
652 | 653 |
653 data->n_args = n_args; | 654 data->n_args = n_args; |
654 data->function_name = name; | 655 data->function_name = name; |
655 data->function_ptr = name_func; | 656 data->function_ptr = name_func; |
721 the_args[n_args].type = XFFI (func)->args[n_args]; | 722 the_args[n_args].type = XFFI (func)->args[n_args]; |
722 | 723 |
723 if (lisp_to_gtk_type (XCAR (tail), &the_args[n_args])) | 724 if (lisp_to_gtk_type (XCAR (tail), &the_args[n_args])) |
724 { | 725 { |
725 /* There was some sort of an error */ | 726 /* There was some sort of an error */ |
726 signal_simple_error ("Error converting arguments", args); | 727 gui_error ("Error converting arguments", args); |
727 } | 728 } |
728 n_args++; | 729 n_args++; |
729 } | 730 } |
730 } | 731 } |
731 | 732 |
772 emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 773 emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
773 { | 774 { |
774 char buf[200]; | 775 char buf[200]; |
775 | 776 |
776 if (print_readably) | 777 if (print_readably) |
777 error ("printing unreadable object #<GtkObject %p>", XGTK_OBJECT (obj)->object); | 778 printing_unreadable_object ("#<GtkObject %p>", XGTK_OBJECT (obj)->object); |
778 | 779 |
779 write_c_string ("#<GtkObject (", printcharfun); | 780 write_c_string ("#<GtkObject (", printcharfun); |
780 if (XGTK_OBJECT (obj)->alive_p) | 781 if (XGTK_OBJECT (obj)->alive_p) |
781 write_c_string (gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)), printcharfun); | 782 write_c_string (gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)), printcharfun); |
782 else | 783 else |
812 return (Fplist_get (XGTK_OBJECT (obj)->plist, prop, Qunbound)); | 813 return (Fplist_get (XGTK_OBJECT (obj)->plist, prop, Qunbound)); |
813 } | 814 } |
814 | 815 |
815 if (!(info->arg_flags & GTK_ARG_READABLE)) | 816 if (!(info->arg_flags & GTK_ARG_READABLE)) |
816 { | 817 { |
817 signal_simple_error ("Attempt to get write-only property", prop); | 818 invalid_operation ("Attempt to get write-only property", prop); |
818 } | 819 } |
819 | 820 |
820 gtk_object_getv (XGTK_OBJECT (obj)->object, 1, args); | 821 gtk_object_getv (XGTK_OBJECT (obj)->object, 1, args); |
821 | 822 |
822 if (args[0].type == GTK_TYPE_INVALID) | 823 if (args[0].type == GTK_TYPE_INVALID) |
876 | 877 |
877 args[0].type = info->type; | 878 args[0].type = info->type; |
878 | 879 |
879 if (lisp_to_gtk_type (value, &args[0])) | 880 if (lisp_to_gtk_type (value, &args[0])) |
880 { | 881 { |
881 signal_simple_error ("Error converting to GtkType", value); | 882 gui_error ("Error converting to GtkType", value); |
882 } | 883 } |
883 | 884 |
884 if (!(info->arg_flags & GTK_ARG_WRITABLE)) | 885 if (!(info->arg_flags & GTK_ARG_WRITABLE)) |
885 { | 886 { |
886 signal_simple_error ("Attemp to set read-only argument", prop); | 887 invalid_operation ("Attempt to set read-only argument", prop); |
887 } | 888 } |
888 | 889 |
889 gtk_object_setv (XGTK_OBJECT (obj)->object, 1, args); | 890 gtk_object_setv (XGTK_OBJECT (obj)->object, 1, args); |
890 | 891 |
891 return (1); | 892 return (1); |
905 if (for_disksave) | 906 if (for_disksave) |
906 { | 907 { |
907 Lisp_Object obj; | 908 Lisp_Object obj; |
908 XSETGTK_OBJECT (obj, data); | 909 XSETGTK_OBJECT (obj, data); |
909 | 910 |
910 signal_simple_error | 911 invalid_operation |
911 ("Can't dump an emacs containing GtkObject objects", obj); | 912 ("Can't dump an emacs containing GtkObject objects", obj); |
912 } | 913 } |
913 | 914 |
914 if (data->alive_p) | 915 if (data->alive_p) |
915 { | 916 { |
1083 emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 1084 emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
1084 { | 1085 { |
1085 char buf[200]; | 1086 char buf[200]; |
1086 | 1087 |
1087 if (print_readably) | 1088 if (print_readably) |
1088 error ("printing unreadable object #<GtkBoxed %p>", XGTK_BOXED (obj)->object); | 1089 printing_unreadable_object ("#<GtkBoxed %p>", XGTK_BOXED (obj)->object); |
1089 | 1090 |
1090 write_c_string ("#<GtkBoxed (", printcharfun); | 1091 write_c_string ("#<GtkBoxed (", printcharfun); |
1091 write_c_string (gtk_type_name (XGTK_BOXED (obj)->object_type), printcharfun); | 1092 write_c_string (gtk_type_name (XGTK_BOXED (obj)->object_type), printcharfun); |
1092 sprintf (buf, ") %p>", (void *) XGTK_BOXED (obj)->object); | 1093 sprintf (buf, ") %p>", (void *) XGTK_BOXED (obj)->object); |
1093 write_c_string (buf, printcharfun); | 1094 write_c_string (buf, printcharfun); |
1193 | 1194 |
1194 t = gtk_type_from_name ((char *) XSTRING_DATA (type)); | 1195 t = gtk_type_from_name ((char *) XSTRING_DATA (type)); |
1195 | 1196 |
1196 if (t == GTK_TYPE_INVALID) | 1197 if (t == GTK_TYPE_INVALID) |
1197 { | 1198 { |
1198 signal_simple_error ("Not a GTK type", type); | 1199 invalid_argument ("Not a GTK type", type); |
1199 } | 1200 } |
1200 return (make_int (GTK_FUNDAMENTAL_TYPE (t))); | 1201 return (make_int (GTK_FUNDAMENTAL_TYPE (t))); |
1201 } | 1202 } |
1202 | 1203 |
1203 DEFUN ("gtk-object-type", Fgtk_object_type, 1, 1, 0, /* | 1204 DEFUN ("gtk-object-type", Fgtk_object_type, 1, 1, 0, /* |
1229 if (STRINGP (type)) | 1230 if (STRINGP (type)) |
1230 { | 1231 { |
1231 t = gtk_type_from_name (XSTRING_DATA (type)); | 1232 t = gtk_type_from_name (XSTRING_DATA (type)); |
1232 if (t == GTK_TYPE_INVALID) | 1233 if (t == GTK_TYPE_INVALID) |
1233 { | 1234 { |
1234 signal_simple_error ("Not a GTK type", type); | 1235 invalid_argument ("Not a GTK type", type); |
1235 } | 1236 } |
1236 } | 1237 } |
1237 else | 1238 else |
1238 { | 1239 { |
1239 CHECK_INT (type); | 1240 CHECK_INT (type); |
1240 t = XINT (type); | 1241 t = XINT (type); |
1241 } | 1242 } |
1242 | 1243 |
1243 if (GTK_FUNDAMENTAL_TYPE (t) != GTK_TYPE_OBJECT) | 1244 if (GTK_FUNDAMENTAL_TYPE (t) != GTK_TYPE_OBJECT) |
1244 { | 1245 { |
1245 signal_simple_error ("Not a GtkObject", type); | 1246 invalid_argument ("Not a GtkObject", type); |
1246 } | 1247 } |
1247 | 1248 |
1248 /* Need to do stupid shit like this to get the args | 1249 /* Need to do stupid shit like this to get the args |
1249 ** registered... damn GTK and its lazy loading | 1250 ** registered... damn GTK and its lazy loading |
1250 */ | 1251 */ |
1328 syms_of_ui_gtk (void) | 1329 syms_of_ui_gtk (void) |
1329 { | 1330 { |
1330 INIT_LRECORD_IMPLEMENTATION (emacs_ffi); | 1331 INIT_LRECORD_IMPLEMENTATION (emacs_ffi); |
1331 INIT_LRECORD_IMPLEMENTATION (emacs_gtk_object); | 1332 INIT_LRECORD_IMPLEMENTATION (emacs_gtk_object); |
1332 INIT_LRECORD_IMPLEMENTATION (emacs_gtk_boxed); | 1333 INIT_LRECORD_IMPLEMENTATION (emacs_gtk_boxed); |
1333 defsymbol (&Qemacs_ffip, "emacs-ffi-p"); | 1334 DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_ffip); |
1334 defsymbol (&Qemacs_gtk_objectp, "emacs-gtk-object-p"); | 1335 DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_gtk_objectp); |
1335 defsymbol (&Qemacs_gtk_boxedp, "emacs-gtk-boxed-p"); | 1336 DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_gtk_boxedp); |
1336 defsymbol (&Qvoid, "void"); | 1337 DEFSYMBOL (Qvoid); |
1337 DEFSUBR (Fdll_load); | 1338 DEFSUBR (Fdll_load); |
1338 DEFSUBR (Fgtk_import_function_internal); | 1339 DEFSUBR (Fgtk_import_function_internal); |
1339 DEFSUBR (Fgtk_import_variable_internal); | 1340 DEFSUBR (Fgtk_import_variable_internal); |
1340 DEFSUBR (Fgtk_signal_connect); | 1341 DEFSUBR (Fgtk_signal_connect); |
1341 DEFSUBR (Fgtk_call_function); | 1342 DEFSUBR (Fgtk_call_function); |
1641 { | 1642 { |
1642 GTK_VALUE_BOXED(*arg) = GTK_WIDGET (XGTK_OBJECT (obj))->window; | 1643 GTK_VALUE_BOXED(*arg) = GTK_WIDGET (XGTK_OBJECT (obj))->window; |
1643 } | 1644 } |
1644 else | 1645 else |
1645 { | 1646 { |
1646 signal_simple_error ("Don't know how to convert object to GDK_WINDOW", obj); | 1647 invalid_argument ("Don't know how to convert object to GDK_WINDOW", obj); |
1647 } | 1648 } |
1648 break; | 1649 break; |
1649 } | 1650 } |
1650 else if (arg->type == GTK_TYPE_GDK_COLOR) | 1651 else if (arg->type == GTK_TYPE_GDK_COLOR) |
1651 { | 1652 { |
1662 /* Easiest one */ | 1663 /* Easiest one */ |
1663 GTK_VALUE_BOXED(*arg) = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (obj)); | 1664 GTK_VALUE_BOXED(*arg) = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (obj)); |
1664 } | 1665 } |
1665 else if (STRINGP (obj)) | 1666 else if (STRINGP (obj)) |
1666 { | 1667 { |
1667 signal_simple_error ("Please use a color specifier or instance, not a string", obj); | 1668 invalid_argument ("Please use a color specifier or instance, not a string", obj); |
1668 } | 1669 } |
1669 else | 1670 else |
1670 { | 1671 { |
1671 signal_simple_error ("Don't know hot to convert to GdkColor", obj); | 1672 invalid_argument ("Don't know how to convert to GdkColor", obj); |
1672 } | 1673 } |
1673 } | 1674 } |
1674 else if (arg->type == GTK_TYPE_GDK_FONT) | 1675 else if (arg->type == GTK_TYPE_GDK_FONT) |
1675 { | 1676 { |
1676 if (SYMBOLP (obj)) | 1677 if (SYMBOLP (obj)) |
1700 /* Easiest one */ | 1701 /* Easiest one */ |
1701 GTK_VALUE_BOXED(*arg) = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (obj)); | 1702 GTK_VALUE_BOXED(*arg) = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (obj)); |
1702 } | 1703 } |
1703 else if (STRINGP (obj)) | 1704 else if (STRINGP (obj)) |
1704 { | 1705 { |
1705 signal_simple_error ("Please use a font specifier or instance, not a string", obj); | 1706 invalid_argument ("Please use a font specifier or instance, not a string", obj); |
1706 } | 1707 } |
1707 else | 1708 else |
1708 { | 1709 { |
1709 signal_simple_error ("Don't know hot to convert to GdkColor", obj); | 1710 invalid_argument ("Don't know how to convert to GdkColor", obj); |
1710 } | 1711 } |
1711 } | 1712 } |
1712 else | 1713 else |
1713 { | 1714 { |
1714 /* Unknown type to convert to boxed */ | 1715 /* Unknown type to convert to boxed */ |
1760 { | 1761 { |
1761 CHECK_GTK_OBJECT (obj); | 1762 CHECK_GTK_OBJECT (obj); |
1762 if (XGTK_OBJECT (obj)->alive_p) | 1763 if (XGTK_OBJECT (obj)->alive_p) |
1763 GTK_VALUE_OBJECT (*arg) = XGTK_OBJECT (obj)->object; | 1764 GTK_VALUE_OBJECT (*arg) = XGTK_OBJECT (obj)->object; |
1764 else | 1765 else |
1765 signal_simple_error ("Attempting to pass dead object to GTK function", obj); | 1766 invalid_argument ("Attempting to pass dead object to GTK function", obj); |
1766 } | 1767 } |
1767 break; | 1768 break; |
1768 | 1769 |
1769 default: | 1770 default: |
1770 if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_ARRAY) | 1771 if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_ARRAY) |
1823 Lisp_Object alist = get_enumeration (t); | 1824 Lisp_Object alist = get_enumeration (t); |
1824 Lisp_Object value = Qnil; | 1825 Lisp_Object value = Qnil; |
1825 | 1826 |
1826 if (NILP (alist)) | 1827 if (NILP (alist)) |
1827 { | 1828 { |
1828 signal_simple_error ("Unkown enumeration", build_string (gtk_type_name (t))); | 1829 invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t))); |
1829 } | 1830 } |
1830 | 1831 |
1831 value = Fassq (obj, alist); | 1832 value = Fassq (obj, alist); |
1832 | 1833 |
1833 if (NILP (value)) | 1834 if (NILP (value)) |
1834 { | 1835 { |
1835 signal_simple_error ("Unknown value", obj); | 1836 invalid_argument ("Unknown value", obj); |
1836 } | 1837 } |
1837 | 1838 |
1838 CHECK_INT (XCDR (value)); | 1839 CHECK_INT (XCDR (value)); |
1839 | 1840 |
1840 return (XINT (XCDR (value))); | 1841 return (XINT (XCDR (value))); |
1892 Lisp_Object alist = get_enumeration (t); | 1893 Lisp_Object alist = get_enumeration (t); |
1893 Lisp_Object cell = Qnil; | 1894 Lisp_Object cell = Qnil; |
1894 | 1895 |
1895 if (NILP (alist)) | 1896 if (NILP (alist)) |
1896 { | 1897 { |
1897 signal_simple_error ("Unkown enumeration", build_string (gtk_type_name (t))); | 1898 invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t))); |
1898 } | 1899 } |
1899 | 1900 |
1900 cell = Frassq (make_int (value), alist); | 1901 cell = Frassq (make_int (value), alist); |
1901 | 1902 |
1902 return (NILP (cell) ? Qnil : XCAR (cell)); | 1903 return (NILP (cell) ? Qnil : XCAR (cell)); |