(ccl_driver): New case lable `CCL_Extention'.
(setup_ccl_program): Initialize the member `private_state' of CCL.
+1999-07-04 Andy Piper <andy@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 Olivier Galibert <galibert@pobox.com>
+
+ * lisp.h: Add #include <stddef.h>.
+
+ * sysdep.c: Remove #include <stddef.h>.
+ * symbols.c: Remove #include <stddef.h>.
+ * sheap.c: Remove #include <stddef.h>.
+ * opaque.c: Remove #include <stddef.h>.
+ * nt.c: Remove #include <stddef.h>.
+ * mule-charset.c: Remove #include <stddef.h>.
+ * marker.c: Remove #include <stddef.h>.
+ * file-coding.c: Remove #include <stddef.h>.
+ * extents.c: Remove #include <stddef.h>.
+ * elhash.c: Remove #include <stddef.h>.
+ * data.c: Remove #include <stddef.h>.
+ * chartab.c: Remove #include <stddef.h>.
+ * bytecode.c: Remove #include <stddef.h>.
+ * alloc.c: Remove #include <stddef.h>. Fix vector description
+
1999-06-30 SL Baur <steve@miho.m17n.org>
* editfns.c: Document "%s" format spec.
#include "sysfile.h"
#include "window.h"
-#include <stddef.h>
-
#ifdef DOUG_LEA_MALLOC
#include <malloc.h>
#endif
* knows how to handle vectors.
*/
0,
- 0,
+ vector_description,
size_vector, Lisp_Vector);
/* #### should allocate `small' vectors from a frob-block */
#include "opaque.h"
#include "syntax.h"
-#include <stddef.h>
#include <limits.h>
EXFUN (Ffetch_bytecode, 1);
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include "chartab.h"
#include "faces.h"
#include "frame.h"
#include "lstream.h"
+#include "glyphs.h"
#include "sysdep.h"
#include "sysfile.h"
#ifdef FILE_CODING
#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;
}
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);
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));
-}
-
\f
/**********************************************************************/
DEFSUBR (Fconsole_enable_input);
DEFSUBR (Fconsole_disable_input);
DEFSUBR (Fconsole_on_window_system_p);
- DEFSUBR (Fconsole_features);
DEFSUBR (Fsuspend_console);
DEFSUBR (Fresume_console);
/* dialog methods */
void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc);
#endif
-
- /* Console-specific features */
- Lisp_Object features;
};
/*
#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 *********/
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
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include "bytecode.h"
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "bytecode.h"
#include "elhash.h"
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 */
#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
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include "debug.h"
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include "elhash.h"
\f
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.
for supporting multiple Emacs variants, lobby Richard Stallman at
<bug-gnu-emacs@prep.ai.mit.edu>.
*/
- (fexp, console))
+ (fexp))
{
#ifndef FEATUREP_SYNTAX
CHECK_SYMBOL (fexp);
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))
{
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);
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
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
{
DEFSUBR (Ffeaturep);
DEFSUBR (Frequire);
DEFSUBR (Fprovide);
- DEFSUBR (Fprovide_on_console);
DEFSUBR (Fbase64_encode_region);
DEFSUBR (Fbase64_encode_string);
DEFSUBR (Fbase64_decode_region);
/* mswindows-specific glyph objects.
- Copyright (C) 1998 Andy Piper.
+ Copyright (C) 1998, 99 Andy Piper.
This file is part of XEmacs.
#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
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);
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);
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,
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
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);
}
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.
#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
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);
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);
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);
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);
}
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);*/
}
}
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;
}
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);
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 */
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
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)
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) \
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
#include <stdio.h> /* NULL, etc. */
#include <ctype.h>
#include <stdarg.h>
+#include <stddef.h> /* offsetof */
#ifdef __lucid
# include <sysent.h>
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);
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include <config.h>
#include "lisp.h"
-#include <stddef.h>
#include "buffer.h"
#include "chartab.h"
#include <io.h>
#include <pwd.h>
#include <signal.h>
-#include <stddef.h> /* for offsetof */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <config.h>
#include "lisp.h"
#include "opaque.h"
-#include <stddef.h>
Lisp_Object Qopaquep;
#include <config.h>
#include <stdio.h>
#include "lisp.h"
-#include <stddef.h>
#include <unistd.h>
#include <sheap-adjust.h>
#include "console.h"
#include "elhash.h"
-#include <stddef.h>
-
Lisp_Object Qad_advice_info, Qad_activate;
Lisp_Object Qget_value, Qset_value, Qbound_predicate, Qmake_unbound;
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). */
#include "lisp.h"
-#include <stddef.h>
#include <stdlib.h>
/* ------------------------------- */