This is better because this code always unconditionally skips
non-X frames in Vframe_list and issues the only XFlush if we
have more than one X frame on the same X display.
+ (any_help_event_p, x_draw_glyph_string_background, x_display_ok):
+ Use bool for booleans.
+ (x_draw_glyph_string_background, cvt_string_to_pixel):
+ (cvt_pixel_dtor): Drop unnecessary prototypes.
+ * xterm.h (x_display_ok): Adjust prototype.
2013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
/* Non-zero means that a HELP_EVENT has been generated since Emacs
start. */
-static int any_help_event_p;
+static bool any_help_event_p;
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
static Lisp_Object last_window;
static void x_set_glyph_string_clipping (struct glyph_string *);
static void x_set_glyph_string_gc (struct glyph_string *);
-static void x_draw_glyph_string_background (struct glyph_string *,
- int);
static void x_draw_glyph_string_foreground (struct glyph_string *);
static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
static void x_draw_glyph_string_box (struct glyph_string *);
contains the first component of a composition. */
static void
-x_draw_glyph_string_background (struct glyph_string *s, int force_p)
+x_draw_glyph_string_background (struct glyph_string *s, bool force_p)
{
/* Nothing to do if background has already been drawn or if it
shouldn't be drawn in the first place. */
#ifdef USE_X_TOOLKIT
-static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *,
- XrmValue *, XrmValue *, XtPointer *);
-static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer,
- XrmValue *, Cardinal *);
-
#ifdef USE_LUCID
/* Return the frame on which widget WIDGET is used.. Abort if frame
/* Return 1 if display DISPLAY is available for use, 0 otherwise.
But don't permanently open it, just test its availability. */
-int
+bool
x_display_ok (const char *display)
{
- int dpy_ok = 1;
- Display *dpy;
-
- dpy = XOpenDisplay (display);
- if (dpy)
- XCloseDisplay (dpy);
- else
- dpy_ok = 0;
- return dpy_ok;
+ Display *dpy = XOpenDisplay (display);
+ return dpy ? (XCloseDisplay (dpy), 1) : 0;
}
#ifdef USE_GTK
extern struct x_display_info *x_display_info_for_display (Display *);
extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
-extern int x_display_ok (const char *);
+extern bool x_display_ok (const char *);
extern void select_visual (struct x_display_info *);