#include "dispextern.h"
#include "keyboard.h"
#include "blockinput.h"
-#include "paths.h"
+#include <paths.h>
#ifdef HAVE_X_WINDOWS
extern void abort ();
+/* On some systems, the character-composition stuff is broken in X11R5. */
+#if defined (HAVE_X11R5) && ! defined (HAVE_X11R6)
+#ifdef X11R5_INHIBIT_I18N
+#undef HAVE_X_I18N
+#endif
+#endif
+
#ifndef VMS
#if 1 /* Used to be #ifdef EMACS_BITMAP_FILES, but this should always work. */
#include "bitmaps/gray.xbm"
#include "../lwlib/lwlib.h"
-/* Do the EDITRES protocol if running X11R5 */
-#if (XtSpecificationRelease >= 5)
+/* Do the EDITRES protocol if running X11R5
+ Exception: HP-UX (at least version A.09.05) has X11R5 without EditRes */
+#if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES)
#define HACK_EDITRES
extern void _XEditResCheckMessages ();
#endif /* R5 + Athena */
/* The below are defined in frame.c. */
extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
-extern Lisp_Object Qunsplittable, Qmenu_bar_lines;
+extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate;
extern Lisp_Object Vwindow_system_version;
error ("X windows are not in use or not initialized");
}
-/* Nonzero if using X for display. */
+/* Nonzero if we can use mouse menus.
+ You should not call this unless HAVE_MENUS is defined. */
int
-using_x_p ()
+have_menus_p ()
{
return x_in_use;
}
f = XFRAME (frame);
}
if (! FRAME_X_P (f))
- error ("non-X frame used");
+ error ("Non-X frame used");
return f;
}
CHECK_LIVE_FRAME (frame, 0);
f = XFRAME (frame);
if (! FRAME_X_P (f))
- error ("non-X frame used");
+ error ("Non-X frame used");
return FRAME_X_DISPLAY_INFO (f);
}
}
if (defined_color (f, XSTRING (arg)->data, &cdef, 1))
return cdef.pixel;
- /* defined_color failed; return an ultimate default. */
- return def;
+ Fsignal (Qerror, Fcons (build_string ("undefined color"),
+ Fcons (arg, Qnil)));
}
\f
/* Functions called only from `x_set_frame_param'
UNBLOCK_INPUT;
if (EQ (result, Qnil))
- error ("Font \"%s\" is not defined", XSTRING (arg)->data);
+ error ("Font `%s' is not defined", XSTRING (arg)->data);
else if (EQ (result, Qt))
error ("the characters of the given font have varying widths");
else if (STRINGP (result))
if (nlines)
{
FRAME_EXTERNAL_MENU_BAR (f) = 1;
- if (f->output_data.x->menubar_widget == 0)
+ if (FRAME_X_P (f) && f->output_data.x->menubar_widget == 0)
/* Make sure next redisplay shows the menu bar. */
XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
}
if (FRAME_EXTERNAL_MENU_BAR (f) == 1)
free_frame_menubar (f);
FRAME_EXTERNAL_MENU_BAR (f) = 0;
- f->output_data.x->menubar_widget = 0;
+ if (FRAME_X_P (f))
+ f->output_data.x->menubar_widget = 0;
}
#else /* not USE_X_TOOLKIT */
FRAME_MENU_BAR_LINES (f) = nlines;
class_hints.res_class = EMACS_CLASS;
XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
+#ifdef HAVE_X_I18N
+ {
+ XIM xim;
+ XIC xic = NULL;
+
+ xim = XOpenIM (FRAME_X_DISPLAY (f), NULL, NULL, NULL);
+
+ if (xim)
+ {
+ xic = XCreateIC (xim,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, FRAME_X_WINDOW(f),
+ XNFocusWindow, FRAME_X_WINDOW(f),
+ NULL);
+
+ if (xic == 0)
+ XCloseIM (xim);
+ }
+ FRAME_XIC (f) = xic;
+ }
+#endif
+
f->output_data.x->wm_hints.input = True;
f->output_data.x->wm_hints.flags |= InputHint;
XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
InputOutput, /* class */
FRAME_X_DISPLAY_INFO (f)->visual,
attribute_mask, &attributes);
+#ifdef HAVE_X_I18N
+ {
+ XIM xim;
+ XIC xic = NULL;
+
+ xim = XOpenIM (FRAME_X_DISPLAY(f), NULL, NULL, NULL);
+
+ if (xim)
+ {
+ xic = XCreateIC (xim,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, FRAME_X_WINDOW(f),
+ XNFocusWindow, FRAME_X_WINDOW(f),
+ NULL);
+
+ if (!xic)
+ XCloseIM (xim);
+ }
+
+ FRAME_XIC (f) = xic;
+ }
+#endif
validate_x_resource_name ();
"menuBar", "MenuBar", number);
x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
"scrollBarWidth", "ScrollBarWidth", number);
+ x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
+ "bufferPredicate", "BufferPredicate", symbol);
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
window_prompting = x_figure_window_size (f, parms);
/* Don't die if we get called with a terminal frame. */
if (! FRAME_X_P (f))
- error ("non-X frame used in `x-list-fonts'");
+ error ("Non-X frame used in `x-list-fonts'");
face_id = face_name_id_number (f, face);