As discussed this has been subsumed by valid-image-instantiator-format-p
and friends.
I will apply this to cvs.
andy
1999-07-04 Andy Piper <andy(a)xemacs.org>
* 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 Andy Piper <andy(a)xemacs.org>
* event-msw.c: fix definition booboo.
1999-06-28 Andy Piper <andy(a)xemacs.org>
* glyphs-x.c: change tree -> tree-view, progress ->
progress_gauge, edit -> edit-field, tab -> tab-control, combo ->
combo-box.
(complex_vars_of_glyphs_x): provide-on-console the implemented
widget types.
* glyphs-msw.c: ditto.
(complex_vars_of_glyphs_mswindows): ditto.
diff -u -r1.111.2.30 configure.in
--- configure.in 1999/06/23 12:25:48 1.111.2.30
+++ configure.in 1999/07/04 19:05:11
@@ -362,6 +362,7 @@
with_site_modules='yes'
with_menubars=''
with_scrollbars=''
+with_widgets=''
with_dialogs=''
with_file_coding=''
dnl const_is_losing is removed - we rely on AC_C_CONST instead.
@@ -739,7 +740,8 @@
dnl Has the user specified the toolkit(s) to use for GUI elements?
"with_menubars" | \
"with_scrollbars" | \
- "with_dialogs" )
+ "with_dialogs" | \
+ "with_widgets" )
case "$val" in
l | lu | luc | luci | lucid ) val=lucid ;;
m | mo | mot | moti | motif ) val=motif ;;
@@ -2878,8 +2880,13 @@
case "$with_scrollbars" in "" | "yes" )
with_scrollbars="lucid" ;;
esac
+case "$with_widgets" in "" | "yes" )
+ if test "$have_motif" = "yes"; then with_widgets="motif"
+ else with_widgets=no
+ fi ;;
+esac
-all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
+all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
case "$all_widgets" in *athena* )
AC_DEFINE(LWLIB_USES_ATHENA)
@@ -2932,7 +2939,7 @@
test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-x.o)
test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-x.o)
test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-x.o)
- test "$all_widgets" != "no no no no" && XE_ADD_OBJS(gui-x.o)
+ test "$all_widgets" != "no no no no no" && XE_ADD_OBJS(gui-x.o)
else
if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
echo "Attempt to Build NAS sound without X"
Index: configure.usage
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/configure.usage,v
retrieving revision 1.17.2.7
diff -u -r1.17.2.7 configure.usage
--- configure.usage 1999/06/23 12:25:49 1.17.2.7
+++ configure.usage 1999/07/04 19:05:14
@@ -66,6 +66,9 @@
--with-dialogs=TYPE Use TYPE dialog boxes (motif, athena, athena3d, or no).
Lucid menubars and scrollbars are the default.
Motif dialog boxes will be used if Motif can be found.
+--with-widgets=TYPE Use TYPE widgets (motif, athena, athena3d, or no).
+ Motif widgets will be used if Motif can be found.
+ Other widget types are currently unsupported.
--with-dragndrop (*) Compile in the generic drag and drop API. This is
automatically added if one of the drag and drop
protocols is found (currently CDE, OffiX, MSWindows).
Index: src/console-tty.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console-tty.c,v
retrieving revision 1.18.2.2
diff -u -r1.18.2.2 console-tty.c
--- src/console-tty.c 1998/12/18 05:42:03 1.18.2.2
+++ src/console-tty.c 1999/07/04 19:05:38
@@ -32,6 +32,7 @@
#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 @@
#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;
@@ -364,6 +369,15 @@
CONSOLE_HAS_METHOD (tty, canonicalize_device_connection);
CONSOLE_HAS_METHOD (tty, semi_canonicalize_console_connection);
CONSOLE_HAS_METHOD (tty, semi_canonicalize_device_connection);
+}
+
+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
Index: src/console.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console.c,v
retrieving revision 1.17.2.4
diff -u -r1.17.2.4 console.c
--- src/console.c 1999/06/29 14:35:31 1.17.2.4
+++ src/console.c 1999/07/04 19:05:43
@@ -781,14 +781,6 @@
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 @@
DEFSUBR (Fconsole_enable_input);
DEFSUBR (Fconsole_disable_input);
DEFSUBR (Fconsole_on_window_system_p);
- DEFSUBR (Fconsole_features);
DEFSUBR (Fsuspend_console);
DEFSUBR (Fresume_console);
Index: src/console.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/console.h,v
retrieving revision 1.22.2.6
diff -u -r1.22.2.6 console.h
--- src/console.h 1999/06/29 14:35:31 1.22.2.6
+++ src/console.h 1999/07/04 19:05:46
@@ -272,9 +272,6 @@
/* dialog methods */
void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc);
#endif
-
- /* Console-specific features */
- Lisp_Object features;
};
/*
@@ -286,9 +283,7 @@
#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 @@
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
Index: src/emacs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.82.2.19
diff -u -r1.82.2.19 emacs.c
--- src/emacs.c 1999/06/05 08:22:21 1.82.2.19
+++ src/emacs.c 1999/07/04 19:05:53
@@ -1200,6 +1202,9 @@
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 */
Index: src/event-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/event-msw.c,v
retrieving revision 1.38.2.14
diff -u -r1.38.2.14 event-msw.c
--- src/event-msw.c 1999/06/29 14:35:31 1.38.2.14
+++ src/event-msw.c 1999/07/04 19:06:04
@@ -73,11 +73,7 @@
#include <errno.h>
#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
Index: src/fns.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/fns.c,v
retrieving revision 1.30.2.17
diff -u -r1.30.2.17 fns.c
--- src/fns.c 1999/06/29 14:35:32 1.30.2.17
+++ src/fns.c 1999/07/04 19:06:13
@@ -3231,7 +3231,7 @@
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 @@
for supporting multiple Emacs variants, lobby Richard Stallman at
<bug-gnu-emacs(a)prep.ai.mit.edu>.
*/
- (fexp, console))
+ (fexp))
{
#ifndef FEATUREP_SYNTAX
CHECK_SYMBOL (fexp);
@@ -3278,11 +3278,7 @@
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 @@
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 @@
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 @@
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 @@
DEFSUBR (Ffeaturep);
DEFSUBR (Frequire);
DEFSUBR (Fprovide);
- DEFSUBR (Fprovide_on_console);
DEFSUBR (Fbase64_encode_region);
DEFSUBR (Fbase64_encode_string);
DEFSUBR (Fbase64_decode_region);
Index: src/glyphs-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-msw.c,v
retrieving revision 1.21.2.17
diff -u -r1.21.2.17 glyphs-msw.c
--- src/glyphs-msw.c 1999/06/29 14:35:32 1.21.2.17
+++ src/glyphs-msw.c 1999/07/04 19:06:25
@@ -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 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
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);
}
Index: src/glyphs-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.49.2.11
diff -u -r1.49.2.11 glyphs-x.c
--- src/glyphs-x.c 1999/06/29 14:35:33 1.49.2.11
+++ src/glyphs-x.c 1999/07/04 19:06:31
@@ -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 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
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);*/
}
Index: src/glyphs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v
retrieving revision 1.23.2.14
diff -u -r1.23.2.14 glyphs.c
--- src/glyphs.c 1999/06/23 19:52:45 1.23.2.14
+++ src/glyphs.c 1999/07/04 19:06:41
@@ -174,21 +174,38 @@
}
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 @@
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 @@
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 */
Index: src/glyphs.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.h,v
retrieving revision 1.18.2.12
diff -u -r1.18.2.12 glyphs.h
--- src/glyphs.h 1999/06/29 14:35:34 1.18.2.12
+++ src/glyphs.h 1999/07/04 19:06:43
@@ -85,6 +85,8 @@
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 @@
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 @@
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 @@
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
Index: src/lisp.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.38.2.16
diff -u -r1.38.2.16 lisp.h
--- src/lisp.h 1999/06/29 14:35:34 1.38.2.16
+++ src/lisp.h 1999/07/04 19:06:54
@@ -2739,7 +2739,6 @@
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);
Index: src/symsinit.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/symsinit.h,v
retrieving revision 1.31.2.6
diff -u -r1.31.2.6 symsinit.h
--- src/symsinit.h 1999/06/03 07:53:04 1.31.2.6
+++ src/symsinit.h 1999/07/04 19:06:58
@@ -200,6 +202,7 @@
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). */
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd