static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int,
int *, int *, int *));
static void note_mode_line_highlight P_ ((struct window *, int, int));
-static void x_check_font P_ ((struct frame *, XFontStruct *));
static void note_mouse_highlight P_ ((struct frame *, int, int));
static void note_tool_bar_highlight P_ ((struct frame *f, int, int));
static void x_handle_tool_bar_click P_ ((struct frame *, XButtonEvent *));
}
return ((pcm == NULL
- || pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0)
+ || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0))
? NULL : pcm);
}
struct it *it;
{
/* (space :width WIDTH :height HEIGHT. */
- extern Lisp_Object QCwidth, QCheight, QCascent, Qspace;
+#if GLYPH_DEBUG
+ extern Lisp_Object Qspace;
+#endif
+ extern Lisp_Object QCwidth, QCheight, QCascent;
extern Lisp_Object QCrelative_width, QCrelative_height;
extern Lisp_Object QCalign_to;
Lisp_Object prop, plist;
struct frame *f;
int *left, *right;
{
- int c;
-
*left = *right = 0;
if (glyph->type == CHAR_GLYPH)
#ifdef USE_X_TOOLKIT
-/* Allocate the color COLOR->pixel on the screen and display of
- widget WIDGET in colormap CMAP. If an exact match cannot be
- allocated, try the nearest color available. Value is non-zero
- if successful. This is called from lwlib. */
+static struct frame *x_frame_of_widget P_ ((Widget));
-int
-x_alloc_nearest_color_for_widget (widget, cmap, color)
+
+/* Return the frame on which widget WIDGET is used.. Abort if frame
+ cannot be determined. */
+
+struct frame *
+x_frame_of_widget (widget)
Widget widget;
- Colormap cmap;
- XColor *color;
{
- struct frame *f;
struct x_display_info *dpyinfo;
Lisp_Object tail;
-
+ struct frame *f;
+
dpyinfo = x_display_info_for_display (XtDisplay (widget));
/* Find the top-level shell of the widget. Note that this function
(f->output_data.nothing != 1
&& FRAME_X_DISPLAY_INFO (f) == dpyinfo))
&& f->output_data.x->widget == widget)
- return x_alloc_nearest_color (f, cmap, color);
+ return f;
abort ();
}
+
+/* Allocate the color COLOR->pixel on the screen and display of
+ widget WIDGET in colormap CMAP. If an exact match cannot be
+ allocated, try the nearest color available. Value is non-zero
+ if successful. This is called from lwlib. */
+
+int
+x_alloc_nearest_color_for_widget (widget, cmap, color)
+ Widget widget;
+ Colormap cmap;
+ XColor *color;
+{
+ struct frame *f = x_frame_of_widget (widget);
+ return x_alloc_nearest_color (f, cmap, color);
+}
+
+
#endif /* USE_X_TOOLKIT */
}
+/* Allocate color PIXEL on display DPY. PIXEL must already be allocated.
+ It's necessary to do this instead of just using PIXEL directly to
+ get color reference counts right. */
+
+unsigned long
+x_copy_dpy_color (dpy, cmap, pixel)
+ Display *dpy;
+ Colormap cmap;
+ unsigned long pixel;
+{
+ XColor color;
+
+ color.pixel = pixel;
+ BLOCK_INPUT;
+ XQueryColor (dpy, cmap, &color);
+ XAllocColor (dpy, cmap, &color);
+ UNBLOCK_INPUT;
+#ifdef DEBUG_X_COLORS
+ register_color (pixel);
+#endif
+ return color.pixel;
+}
+
+
/* Allocate a color which is lighter or darker than *PIXEL by FACTOR
or DELTA. Try a color with RGB values multiplied by FACTOR first.
If this produces the same color as PIXEL, try a color where all RGB
if (relief->gc
&& relief->allocated_p)
{
- /* If display has an immutable color map, freeing colors is not
- necessary and some servers don't allow it. So don't do it. */
x_free_colors (f, &relief->pixel, 1);
relief->allocated_p = 0;
}
#define BUILD_CHAR_GLYPH_STRINGS(W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P) \
do \
{ \
- int c, charset, face_id; \
+ int c, face_id; \
XChar2b *char2b; \
\
c = (ROW)->glyphs[AREA][START].u.ch; \
int *hpos, *vpos, *area;
{
struct glyph *glyph, *end;
- struct glyph_row *row;
+ struct glyph_row *row = NULL;
int x0, i, left_area_width;
/* Find row containing Y. Give up if some row is not enabled. */
{
#ifdef HAVE_XAW3D
ScrollbarWidget sb = (ScrollbarWidget) widget;
- int scroll_mode;
+ int scroll_mode = 0;
/* `scroll_mode' only exists with Xaw3d + ARROW_SCROLLBAR. */
if (xaw3d_arrow_scroll)
{
int fontset = fs_query_fontset (build_string (fontsetname), 0);
Lisp_Object result;
- char *fontname;
if (fontset < 0)
return Qnil;
/* It could be confusing if a real alarm arrives while
processing the fake one. Turn it off and let the
handler reset it. */
+ extern void poll_for_input_1 P_ ((void));
int old_poll_suppress_count = poll_suppress_count;
poll_suppress_count = 1;
poll_for_input_1 ();
free_frame_menubar (f);
#endif /* USE_X_TOOLKIT */
+ unload_color (f, f->output_data.x->foreground_pixel);
+ unload_color (f, f->output_data.x->background_pixel);
+ unload_color (f, f->output_data.x->cursor_pixel);
+ unload_color (f, f->output_data.x->cursor_foreground_pixel);
+ unload_color (f, f->output_data.x->border_pixel);
+ unload_color (f, f->output_data.x->mouse_pixel);
+ if (f->output_data.x->scroll_bar_background_pixel != -1)
+ unload_color (f, f->output_data.x->scroll_bar_background_pixel);
+ if (f->output_data.x->scroll_bar_foreground_pixel != -1)
+ unload_color (f, f->output_data.x->scroll_bar_foreground_pixel);
+ if (f->output_data.x->white_relief.allocated_p)
+ unload_color (f, f->output_data.x->white_relief.pixel);
+ if (f->output_data.x->black_relief.allocated_p)
+ unload_color (f, f->output_data.x->black_relief.pixel);
+
free_frame_faces (f);
XFlush (FRAME_X_DISPLAY (f));
}
for (; CONSP (patterns); patterns = XCDR (patterns))
{
int num_fonts;
- char **names;
+ char **names = NULL;
pattern = XCAR (patterns);
/* See if we cached the result for this particular query.