view lwlib/xrdb.c @ 40394:b2fcb3933879

Require `syntax'. (font-lock-defaults-alist): Don't define keywords for lisp languages. Use `c-font-lock-syntactic-face-function' for c languages. (font-lock-mode): Don't unset vars when turning the mode off. (font-lock-default-fontify-buffer): Don't unset vars at the end. (font-lock-extra-managed-props): New var. (font-lock-default-unfontify-region): Use it. (font-lock-apply-syntactic-highlight): Flush the syntax cache. Don't eval the value when there's no match. (font-lock-ppss-stats): New var. (font-lock-ppss): New fun. (font-lock-fontify-syntactically-region): Use it and syntax.ppss. (font-lock-apply-highlight): Allow `highlight' to set several props. (font-lock-set-defaults): Use dolist. (font-lock-unset-defaults): Remove. (font-lock-match-c-style-declaration-item-and-skip-to-next): Try to recognize prototypes using `foo P_ ((args))'. ({c,c++,java,objc}-font-lock-keywords-{1,2,3}): Don't setq a defconst. (c-font-lock-keywords-2): Fix last change to still use Anders' trick. (c-font-lock-syntactic-face-function): New function. (font-lock-match-c++-style-declaration-item-and-skip-to-next) (c++-keywords): Use a more sophisticated regexp to handle shallowly nested templates.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 28 Oct 2001 04:48:01 +0000
parents e0d966fb548f
children
line wrap: on
line source

/* This file overrides the R4 or R5 mit/lib/Xt/Initialize.c, except that
   the functions lwlib_GetFileDatabase(), lwlib_CombineFileDatabase(), and
   lwlib_xrdb_initialize() are called.  By doing this silly cpp hack, we
   avoid version skew problems.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/Xutil.h>

#ifdef XlibSpecificationRelease
#if XlibSpecificationRelease >= 5
#define HAVE_X11R5
#endif
#endif

extern struct _XrmHashBucketRec *lwlib_GetFileDatabase ();
extern void lwlib_xrdb_initialize ();

/* Replace all calls to XrmGetFileDatabase() with lwlib_GetFileDatabase(),
   calls to XrmCombineFileDatabase() with lwlib_CombineFileDatabase(), and
   rename the defined _XtDisplayInitialize() function.
 */
#define XrmGetFileDatabase lwlib_GetFileDatabase
#define XrmCombineFileDatabase lwlib_CombineFileDatabase
#define _XtDisplayInitialize _orig_XtDisplayInitialize

/* Suck in the original code.  Don't change this: see comments in Imakefile. */
#include "Initialize.c"

#undef XrmGetFileDatabase
#undef XrmCombineFileDatabase
#undef _XtDisplayInitialize

/* Now provide a definition of _XtDisplayInitialize() which invokes the
   original code after calling our initialization hook.  Note that the R4
   and R5 versions of _XtDisplayInitialize() take different arguments.
 */

#ifndef HAVE_X11R5

void _XtDisplayInitialize(dpy, pd, name, class, urlist, num_urs, argc, argv)
	Display *dpy;
        XtPerDisplay pd;
	String name, class;
	XrmOptionDescRec *urlist;
	Cardinal num_urs;
	Cardinal *argc;
	char *argv[];
{
  lwlib_xrdb_initialize(dpy);
  _orig_XtDisplayInitialize(dpy, pd, name, class, urlist, num_urs, argc, argv);
}

#else /* HAVE_X11R5 */

void _XtDisplayInitialize(dpy, pd, name, urlist, num_urs, argc, argv)
	Display *dpy;
        XtPerDisplay pd;
	String name;
	XrmOptionDescRec *urlist;
	Cardinal num_urs;
	int *argc;
	char **argv;
{
  lwlib_xrdb_initialize(dpy);
  _orig_XtDisplayInitialize(dpy, pd, name, urlist, num_urs, argc, argv);
}

#endif	/* HAVE_X11R5 */