From 9a54074238a035dbf783b24383f640d215ec8894 Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 6 Jul 1999 04:39:30 +0000 Subject: [PATCH] Sync up with r21-2-17-1999-07-05-18. --- src/ChangeLog | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/alloc.c | 4 +--- src/bytecode.c | 1 - src/chartab.c | 1 - src/console-tty.c | 14 ++++++++++++++ src/console.c | 9 --------- src/console.h | 7 ------- src/data.c | 1 - src/elhash.c | 1 - src/emacs.c | 3 +++ src/event-msw.c | 6 +----- src/extents.c | 1 - src/file-coding.c | 1 - src/fns.c | 49 ++++-------------------------------------------- src/glyphs-msw.c | 46 ++++++++++++++++++++++++++++++++++----------- src/glyphs-x.c | 40 +++++++++++++++++++++++++++++++++++---- src/glyphs.c | 33 ++++++++++++++++++++++++++------ src/glyphs.h | 18 ++++++++++++++++++ src/lisp.h | 2 +- src/marker.c | 1 - src/mule-charset.c | 1 - src/nt.c | 1 - src/opaque.c | 1 - src/sheap.c | 1 - src/symbols.c | 2 -- src/symsinit.h | 1 + src/sysdep.c | 1 - 27 files changed, 194 insertions(+), 105 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 93af195..bdef495 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -72,6 +72,59 @@ (ccl_driver): New case lable `CCL_Extention'. (setup_ccl_program): Initialize the member `private_state' of CCL. +1999-07-04 Andy Piper + + * console.c: undo earlier Fprovide changes. + * fns.c: ditto. + * console.h: ditto. + + * console-tty.c (image_instantiator_format_create_glyphs_tty): new + function. validate appropriate image formats for tty. + + * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): + initialize consoles parameter. + (struct image_instantiator_methods): add consoles parameter. + (IIFORMAT_VALID_CONSOLE): new function. validate the format on the + console. + (INITIALIZE_DEVICE_IIFORMAT): validate the format on the given + console. + + * glyphs-msw.c: declare instantiators for later use. + (image_instantiator_format_create_glyphs_mswindows): validate xpm + and friends on the mswindows console. + * glyphs-x.c: ditto. + + * glyphs.c (valid_image_instantiator_format_p): disallow glyphs + that have not been registered on the supplied device. + (Fvalid_image_instantiator_format_p): add locale argument. + (instantiate_image_instantiator): valid image instantiator on the + device. + + * symsinit.h: add image_instantiator_format_create_glyphs_tty() + declaration. + + * emacs.c (main_1): add call to + image_instantiator_format_create_glyphs_tty(). + +1999-06-29 Olivier Galibert + + * lisp.h: Add #include . + + * sysdep.c: Remove #include . + * symbols.c: Remove #include . + * sheap.c: Remove #include . + * opaque.c: Remove #include . + * nt.c: Remove #include . + * mule-charset.c: Remove #include . + * marker.c: Remove #include . + * file-coding.c: Remove #include . + * extents.c: Remove #include . + * elhash.c: Remove #include . + * data.c: Remove #include . + * chartab.c: Remove #include . + * bytecode.c: Remove #include . + * alloc.c: Remove #include . Fix vector description + 1999-06-30 SL Baur * editfns.c: Document "%s" format spec. diff --git a/src/alloc.c b/src/alloc.c index 103d9da..610efa4 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -58,8 +58,6 @@ Boston, MA 02111-1307, USA. */ #include "sysfile.h" #include "window.h" -#include - #ifdef DOUG_LEA_MALLOC #include #endif @@ -1186,7 +1184,7 @@ DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, * knows how to handle vectors. */ 0, - 0, + vector_description, size_vector, Lisp_Vector); /* #### should allocate `small' vectors from a frob-block */ diff --git a/src/bytecode.c b/src/bytecode.c index 23f0b9f..af9d3f4 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -56,7 +56,6 @@ by Hallvard: #include "opaque.h" #include "syntax.h" -#include #include EXFUN (Ffetch_bytecode, 1); diff --git a/src/chartab.c b/src/chartab.c index 43f7849..4e7480d 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -37,7 +37,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" #include "chartab.h" diff --git a/src/console-tty.c b/src/console-tty.c index ec63358..c57c0f7 100644 --- a/src/console-tty.c +++ b/src/console-tty.c @@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ #include "faces.h" #include "frame.h" #include "lstream.h" +#include "glyphs.h" #include "sysdep.h" #include "sysfile.h" #ifdef FILE_CODING @@ -42,6 +43,10 @@ Boston, MA 02111-1307, USA. */ #endif DEFINE_CONSOLE_TYPE (tty); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); Lisp_Object Qterminal_type; Lisp_Object Qcontrolling_process; @@ -367,6 +372,15 @@ console_type_create_tty (void) } void +image_instantiator_format_create_glyphs_tty (void) +{ + IIFORMAT_VALID_CONSOLE (tty, nothing); + IIFORMAT_VALID_CONSOLE (tty, string); + IIFORMAT_VALID_CONSOLE (tty, formatted_string); + IIFORMAT_VALID_CONSOLE (tty, inherit); +} + +void vars_of_console_tty (void) { Fprovide (Qtty); diff --git a/src/console.c b/src/console.c index 2b4c637..7e27f86 100644 --- a/src/console.c +++ b/src/console.c @@ -781,14 +781,6 @@ the toolbar, glyphs, etc. return !EQ (type, Qtty) && !EQ (type, Qstream) ? Qt : Qnil; } -DEFUN ("console-features", Fconsole_features, 0, 1, 0, /* -Return a list of console-specific features. -*/ - (console)) -{ - return CONSOLE_FEATURES (decode_console (console)); -} - /**********************************************************************/ @@ -1087,7 +1079,6 @@ syms_of_console (void) DEFSUBR (Fconsole_enable_input); DEFSUBR (Fconsole_disable_input); DEFSUBR (Fconsole_on_window_system_p); - DEFSUBR (Fconsole_features); DEFSUBR (Fsuspend_console); DEFSUBR (Fresume_console); diff --git a/src/console.h b/src/console.h index df4eeb7..d551141 100644 --- a/src/console.h +++ b/src/console.h @@ -272,9 +272,6 @@ struct console_methods /* dialog methods */ void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc); #endif - - /* Console-specific features */ - Lisp_Object features; }; /* @@ -286,9 +283,7 @@ struct console_methods #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) #define CONSOLE_TYPE(c) ((c)->conmeths->symbol) -#define CONSOLE_FEATURES(c) ((c)->conmeths->features) #define CONMETH_TYPE(meths) ((meths)->symbol) -#define CONMETH_FEATURES(c) ((meths)->features) /******** Accessing / calling a console method *********/ @@ -354,8 +349,6 @@ struct console_methods * type##_console_methods add_entry_to_console_type_list (Q##type, type##_console_methods); \ type##_console_methods->image_conversion_list = Qnil; \ staticpro (&type##_console_methods->image_conversion_list); \ - type##_console_methods->features = Qnil; \ - staticpro (&type##_console_methods->features); \ } while (0) /* Declare that console-type TYPE has method M; used in diff --git a/src/data.c b/src/data.c index 0fe0f09..20100db 100644 --- a/src/data.c +++ b/src/data.c @@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" #include "bytecode.h" diff --git a/src/elhash.c b/src/elhash.c index 34c22c5..b53f7a0 100644 --- a/src/elhash.c +++ b/src/elhash.c @@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "bytecode.h" #include "elhash.h" diff --git a/src/emacs.c b/src/emacs.c index 05e8ed4..3f7d8c5 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1200,6 +1200,9 @@ main_1 (int argc, char **argv, char **envp, int restart) image_instantiator_format_create (); image_instantiator_format_create_glyphs_eimage (); image_instantiator_format_create_glyphs_widget (); +#ifdef HAVE_TTY + image_instantiator_format_create_glyphs_tty (); +#endif #ifdef HAVE_X_WINDOWS image_instantiator_format_create_glyphs_x (); #endif /* HAVE_X_WINDOWS */ diff --git a/src/event-msw.c b/src/event-msw.c index 2a9b919..49a2446 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -73,11 +73,7 @@ typedef unsigned int SOCKET; #include #if defined (__CYGWIN32__) && !defined (CYGWIN_VERSION_DLL_MAJOR) -typedef struct tagNMHDR { - HWND hwndFrom; - UINT idFrom; - UINT code; -} NMHDR, *PNMHDR, *LPNMHDR; +typedef NMHDR *LPNMHDR; #endif #ifdef HAVE_MENUBARS diff --git a/src/extents.c b/src/extents.c index cc7ad8a..e11eded 100644 --- a/src/extents.c +++ b/src/extents.c @@ -213,7 +213,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" #include "debug.h" diff --git a/src/file-coding.c b/src/file-coding.c index 94070da..eef4f69 100644 --- a/src/file-coding.c +++ b/src/file-coding.c @@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" #include "elhash.h" diff --git a/src/fns.c b/src/fns.c index bf65f9f..55d5e2f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3231,7 +3231,7 @@ in which case you can't use this. Lisp_Object Vfeatures; -DEFUN ("featurep", Ffeaturep, 1, 2, 0, /* +DEFUN ("featurep", Ffeaturep, 1, 1, 0, /* Return non-nil if feature FEXP is present in this Emacs. Use this to conditionalize execution of lisp code based on the presence or absence of emacs or environment extensions. @@ -3266,7 +3266,7 @@ symbol) are not yet supported by FSF Emacs. If you feel they are useful for supporting multiple Emacs variants, lobby Richard Stallman at . */ - (fexp, console)) + (fexp)) { #ifndef FEATUREP_SYNTAX CHECK_SYMBOL (fexp); @@ -3278,11 +3278,7 @@ for supporting multiple Emacs variants, lobby Richard Stallman at if (SYMBOLP (fexp)) { /* Original definition */ - return (NILP (Fmemq (fexp, Vfeatures)) - && - NILP (Fmemq (fexp, - CONSOLE_FEATURES (decode_console (console))))) - ? Qnil : Qt; + return NILP (Fmemq (fexp, Vfeatures)) ? Qnil : Qt; } else if (INTP (fexp) || FLOATP (fexp)) { @@ -3351,7 +3347,6 @@ This function updates the value of the variable `features'. CHECK_SYMBOL (feature); if (!NILP (Vautoload_queue)) Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); - tem = Fmemq (feature, Vfeatures); if (NILP (tem)) Vfeatures = Fcons (feature, Vfeatures); @@ -3359,38 +3354,6 @@ This function updates the value of the variable `features'. return feature; } -DEFUN ("provide-on-console", Fprovide_on_console, 2, 2, 0, /* -Announce that FEATURE is a feature of the current Emacs. -This function updates the value of `console-features' for the provided CONSOLE. -*/ - (feature, console)) -{ - Lisp_Object tem; - CHECK_SYMBOL (feature); - - if (SYMBOLP (console)) - { - struct console_methods* meths = decode_console_type (console, ERROR_ME); - - tem = Fmemq (feature, CONMETH_FEATURES (meths)); - if (NILP (tem)) - CONMETH_FEATURES (meths) = - Fcons (feature, CONMETH_FEATURES (meths)); - } - else - { - struct console* pconsole; - CHECK_CONSOLE (console); - - pconsole = decode_console (console); - tem = Fmemq (feature, CONSOLE_FEATURES (pconsole)); - if (NILP (tem)) - CONSOLE_FEATURES (pconsole) = - Fcons (feature, CONSOLE_FEATURES (pconsole)); - } - return feature; -} - DEFUN ("require", Frequire, 1, 2, 0, /* If feature FEATURE is not loaded, load it from FILENAME. If FEATURE is not a member of the list `features', then the feature @@ -3403,10 +3366,7 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name. CHECK_SYMBOL (feature); tem = Fmemq (feature, Vfeatures); LOADHIST_ATTACH (Fcons (Qrequire, feature)); - if (!NILP (tem) - || - !NILP (Fmemq (feature, CONSOLE_FEATURES - (XCONSOLE (Fselected_console ()))))) + if (!NILP (tem)) return feature; else { @@ -3917,7 +3877,6 @@ syms_of_fns (void) DEFSUBR (Ffeaturep); DEFSUBR (Frequire); DEFSUBR (Fprovide); - DEFSUBR (Fprovide_on_console); DEFSUBR (Fbase64_encode_region); DEFSUBR (Fbase64_encode_string); DEFSUBR (Fbase64_decode_region); diff --git a/src/glyphs-msw.c b/src/glyphs-msw.c index a619dfb..805e812 100644 --- a/src/glyphs-msw.c +++ b/src/glyphs-msw.c @@ -1,5 +1,5 @@ /* mswindows-specific glyph objects. - Copyright (C) 1998 Andy Piper. + Copyright (C) 1998, 99 Andy Piper. This file is part of XEmacs. @@ -53,6 +53,22 @@ Boston, MA 02111-1307, USA. */ #define WIDGET_GLYPH_SLOT 0 +DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); +#ifdef HAVE_JPEG +DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); +#endif +#ifdef HAVE_TIFF +DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff); +#endif +#ifdef HAVE_PNG +DECLARE_IMAGE_INSTANTIATOR_FORMAT (png); +#endif +#ifdef HAVE_GIF +DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); +#endif #ifdef HAVE_XPM DEFINE_DEVICE_IIFORMAT (mswindows, xpm); #endif @@ -2728,6 +2744,10 @@ console_type_create_glyphs_mswindows (void) void image_instantiator_format_create_glyphs_mswindows (void) { + IIFORMAT_VALID_CONSOLE (mswindows, nothing); + IIFORMAT_VALID_CONSOLE (mswindows, string); + IIFORMAT_VALID_CONSOLE (mswindows, formatted_string); + IIFORMAT_VALID_CONSOLE (mswindows, inherit); /* image-instantiator types */ #ifdef HAVE_XPM INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); @@ -2739,6 +2759,18 @@ image_instantiator_format_create_glyphs_mswindows (void) INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); #endif +#ifdef HAVE_JPEG + IIFORMAT_VALID_CONSOLE (mswindows, jpeg); +#endif +#ifdef HAVE_TIFF + IIFORMAT_VALID_CONSOLE (mswindows, tiff); +#endif +#ifdef HAVE_PNG + IIFORMAT_VALID_CONSOLE (mswindows, png); +#endif +#ifdef HAVE_GIF + IIFORMAT_VALID_CONSOLE (mswindows, gif); +#endif /* button widget */ INITIALIZE_DEVICE_IIFORMAT (mswindows, button); IIFORMAT_HAS_DEVMETHOD (mswindows, button, property); @@ -2793,6 +2825,7 @@ image_instantiator_format_create_glyphs_mswindows (void) IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); + IIFORMAT_VALID_CONSOLE (mswindows, bmp); /* mswindows resources */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, @@ -2807,6 +2840,7 @@ image_instantiator_format_create_glyphs_mswindows (void) check_valid_resource_symbol); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); + IIFORMAT_VALID_CONSOLE (mswindows, mswindows_resource); } void @@ -2822,14 +2856,4 @@ This is used by the `make-image-instance' function. void complex_vars_of_glyphs_mswindows (void) { - Fprovide_on_console (Qbmp, Qmswindows); - Fprovide_on_console (Qmswindows_resource, Qmswindows); - Fprovide_on_console (Qbutton, Qmswindows); - Fprovide_on_console (Qedit_field, Qmswindows); - Fprovide_on_console (Qcombo_box, Qmswindows); - Fprovide_on_console (Qscrollbar, Qmswindows); - Fprovide_on_console (Qlabel, Qmswindows); - Fprovide_on_console (Qprogress_gauge, Qmswindows); - Fprovide_on_console (Qtree_view, Qmswindows); - Fprovide_on_console (Qtab_control, Qmswindows); } diff --git a/src/glyphs-x.c b/src/glyphs-x.c index cbd91ed..45f1e10 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -4,6 +4,7 @@ Copyright (C) 1995 Tinker Systems Copyright (C) 1995, 1996 Ben Wing Copyright (C) 1995 Sun Microsystems + Copyright (C) 1999 Andy Piper This file is part of XEmacs. @@ -89,6 +90,22 @@ Boston, MA 02111-1307, USA. */ #define LISP_DEVICE_TO_X_SCREEN(dev) XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev))) +DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); +DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); +#ifdef HAVE_JPEG +DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); +#endif +#ifdef HAVE_TIFF +DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff); +#endif +#ifdef HAVE_PNG +DECLARE_IMAGE_INSTANTIATOR_FORMAT (png); +#endif +#ifdef HAVE_GIF +DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); +#endif #ifdef HAVE_XPM DEFINE_DEVICE_IIFORMAT (x, xpm); #endif @@ -2411,10 +2428,26 @@ console_type_create_glyphs_x (void) void image_instantiator_format_create_glyphs_x (void) { + IIFORMAT_VALID_CONSOLE (x, nothing); + IIFORMAT_VALID_CONSOLE (x, string); + IIFORMAT_VALID_CONSOLE (x, formatted_string); + IIFORMAT_VALID_CONSOLE (x, inherit); #ifdef HAVE_XPM INITIALIZE_DEVICE_IIFORMAT (x, xpm); IIFORMAT_HAS_DEVMETHOD (x, xpm, instantiate); #endif +#ifdef HAVE_JPEG + IIFORMAT_VALID_CONSOLE (x, jpeg); +#endif +#ifdef HAVE_TIFF + IIFORMAT_VALID_CONSOLE (x, tiff); +#endif +#ifdef HAVE_PNG + IIFORMAT_VALID_CONSOLE (x, png); +#endif +#ifdef HAVE_GIF + IIFORMAT_VALID_CONSOLE (x, gif); +#endif INITIALIZE_DEVICE_IIFORMAT (x, xbm); IIFORMAT_HAS_DEVMETHOD (x, xbm, instantiate); @@ -2441,6 +2474,7 @@ image_instantiator_format_create_glyphs_x (void) IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate); INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (cursor_font, "cursor-font"); + IIFORMAT_VALID_CONSOLE (x, cursor_font); IIFORMAT_HAS_METHOD (cursor_font, validate); IIFORMAT_HAS_METHOD (cursor_font, possible_dest_types); @@ -2455,6 +2489,7 @@ image_instantiator_format_create_glyphs_x (void) IIFORMAT_HAS_METHOD (font, validate); IIFORMAT_HAS_METHOD (font, possible_dest_types); IIFORMAT_HAS_METHOD (font, instantiate); + IIFORMAT_VALID_CONSOLE (x, font); IIFORMAT_VALID_KEYWORD (font, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (font, Q_foreground, check_valid_string); @@ -2472,6 +2507,7 @@ image_instantiator_format_create_glyphs_x (void) IIFORMAT_HAS_METHOD (autodetect, normalize); IIFORMAT_HAS_METHOD (autodetect, possible_dest_types); IIFORMAT_HAS_METHOD (autodetect, instantiate); + IIFORMAT_VALID_CONSOLE (x, autodetect); IIFORMAT_VALID_KEYWORD (autodetect, Q_data, check_valid_string); } @@ -2508,8 +2544,4 @@ complex_vars_of_glyphs_x (void) BUILD_GLYPH_INST (Vhscroll_glyph, hscroll); #undef BUILD_GLYPH_INST - Fprovide_on_console (Qbutton, Qx); - Fprovide_on_console (Qedit_field, Qx); - Fprovide_on_console (Qprogress_gauge, Qx); - /* Fprovide (Qcombo_box);*/ } diff --git a/src/glyphs.c b/src/glyphs.c index 307b6fa..0db3c08 100644 --- a/src/glyphs.c +++ b/src/glyphs.c @@ -174,21 +174,38 @@ decode_image_instantiator_format (Lisp_Object format, Error_behavior errb) } static int -valid_image_instantiator_format_p (Lisp_Object format) +valid_image_instantiator_format_p (Lisp_Object format, Lisp_Object locale) { - return (decode_image_instantiator_format (format, ERROR_ME_NOT) != 0); + int i; + struct image_instantiator_methods* meths = + decode_image_instantiator_format (format, ERROR_ME_NOT); + struct console* console = decode_console (locale); + Lisp_Object contype = console ? CONSOLE_TYPE (console) : locale; + /* nothing is valid in all locales */ + if (EQ (format, Qnothing)) + return 1; + /* reject unknown formats */ + else if (!console || !meths) + return 0; + + for (i = 0; i < Dynarr_length (meths->consoles); i++) + if (EQ (contype, Dynarr_at (meths->consoles, i).symbol)) + return 1; + return 0; } DEFUN ("valid-image-instantiator-format-p", Fvalid_image_instantiator_format_p, - 1, 1, 0, /* + 1, 2, 0, /* Given an IMAGE-INSTANTIATOR-FORMAT, return non-nil if it is valid. +If LOCALE is non-nil then the format is checked in that domain. +If LOCALE is nil the current console is used. Valid formats are some subset of 'nothing, 'string, 'formatted-string, 'xpm, 'xbm, 'xface, 'gif, 'jpeg, 'png, 'tiff, 'cursor-font, 'font, 'autodetect, 'widget and 'subwindow, depending on how XEmacs was compiled. */ - (image_instantiator_format)) + (image_instantiator_format, locale)) { - return valid_image_instantiator_format_p (image_instantiator_format) ? + return valid_image_instantiator_format_p (image_instantiator_format, locale) ? Qt : Qnil; } @@ -547,6 +564,11 @@ instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain, int methp = 0; GCPRO1 (ii); + if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0], device)) + signal_simple_error + ("Image instantiator format is invalid in this locale.", + instantiator); + meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], ERROR_ME); methp = (int)HAS_IIFORMAT_METH_P (meths, instantiate); @@ -4107,7 +4129,6 @@ image_instantiator_format_create (void) IIFORMAT_HAS_METHOD (formatted_string, validate); IIFORMAT_HAS_METHOD (formatted_string, possible_dest_types); IIFORMAT_HAS_METHOD (formatted_string, instantiate); - IIFORMAT_VALID_KEYWORD (formatted_string, Q_data, check_valid_string); /* subwindows */ diff --git a/src/glyphs.h b/src/glyphs.h index cbc8ad1..2780192 100644 --- a/src/glyphs.h +++ b/src/glyphs.h @@ -85,6 +85,8 @@ struct image_instantiator_methods Lisp_Object device; /* sometimes used */ ii_keyword_entry_dynarr *keywords; + /* consoles this ii is supported on */ + console_type_entry_dynarr *consoles; /* Implementation specific methods: */ /* Validate method: Given an instantiator vector, signal an error if @@ -170,6 +172,8 @@ do { \ format##_image_instantiator_methods->device = Qnil; \ format##_image_instantiator_methods->keywords = \ Dynarr_new (ii_keyword_entry); \ + format##_image_instantiator_methods->consoles = \ + Dynarr_new (console_type_entry); \ add_entry_to_image_instantiator_format_list \ (Q##format, format##_image_instantiator_methods); \ } while (0) @@ -215,7 +219,20 @@ do { \ entry); \ } while (0) +/* Declare that image-instantiator format FORMAT is supported on + CONSOLE type. */ +#define IIFORMAT_VALID_CONSOLE(console, format) \ + do { \ + struct console_type_entry entry; \ + \ + entry.symbol = Q##console; \ + entry.meths = console##_console_methods; \ + Dynarr_add (format##_image_instantiator_methods->consoles, \ + entry); \ + } while (0) + #define DEFINE_DEVICE_IIFORMAT(type, format)\ +DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \ struct image_instantiator_methods *type##_##format##_image_instantiator_methods #define INITIALIZE_DEVICE_IIFORMAT(type, format) \ @@ -228,6 +245,7 @@ do { \ Dynarr_new (ii_keyword_entry); \ add_entry_to_device_ii_format_list \ (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ + IIFORMAT_VALID_CONSOLE(type,format); \ } while (0) /* Declare that image-instantiator format FORMAT has method M; used in diff --git a/src/lisp.h b/src/lisp.h index a615f67..1f6c0b2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. */ #include /* NULL, etc. */ #include #include +#include /* offsetof */ #ifdef __lucid # include @@ -2739,7 +2740,6 @@ EXFUN (Fprint, 2); EXFUN (Fprocess_status, 1); EXFUN (Fprogn, UNEVALLED); EXFUN (Fprovide, 1); -EXFUN (Fprovide_on_console, 2); EXFUN (Fpurecopy, 1); EXFUN (Fput, 3); EXFUN (Fput_range_table, 4); diff --git a/src/marker.c b/src/marker.c index 0a68b44..5ed6c4d 100644 --- a/src/marker.c +++ b/src/marker.c @@ -32,7 +32,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" diff --git a/src/mule-charset.c b/src/mule-charset.c index 2f44aa0..0a4b0ed 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" -#include #include "buffer.h" #include "chartab.h" diff --git a/src/nt.c b/src/nt.c index 793cc81..54e06e1 100644 --- a/src/nt.c +++ b/src/nt.c @@ -43,7 +43,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include #include #include -#include /* for offsetof */ #include #include #include diff --git a/src/opaque.c b/src/opaque.c index c53af0b..70d29b9 100644 --- a/src/opaque.c +++ b/src/opaque.c @@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" #include "opaque.h" -#include Lisp_Object Qopaquep; diff --git a/src/sheap.c b/src/sheap.c index 977addc..e2c848c 100644 --- a/src/sheap.c +++ b/src/sheap.c @@ -21,7 +21,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include #include #include "lisp.h" -#include #include #include diff --git a/src/symbols.c b/src/symbols.c index 01a6c36..9b3192d 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -58,8 +58,6 @@ Boston, MA 02111-1307, USA. */ #include "console.h" #include "elhash.h" -#include - Lisp_Object Qad_advice_info, Qad_activate; Lisp_Object Qget_value, Qset_value, Qbound_predicate, Qmake_unbound; diff --git a/src/symsinit.h b/src/symsinit.h index 542980f..d0f4e1f 100644 --- a/src/symsinit.h +++ b/src/symsinit.h @@ -200,6 +200,7 @@ void image_instantiator_format_create_glyphs_eimage (void); void image_instantiator_format_create_glyphs_widget (void); void image_instantiator_format_create_glyphs_x (void); void image_instantiator_format_create_glyphs_mswindows (void); +void image_instantiator_format_create_glyphs_tty (void); /* Initialize the lstream types (dump-time only). */ diff --git a/src/sysdep.c b/src/sysdep.c index 0dc66fa..398eaca 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -50,7 +50,6 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" -#include #include /* ------------------------------- */ -- 1.7.10.4