-static char setup_frame_cursor_bits[] =
-{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static void
-setup_frame_gcs (EmacsFrame ew)
-{
- XGCValues gc_values;
- struct frame* s = ew->emacs_frame.frame;
- Pixmap blank_stipple, blank_tile;
- unsigned long valuemask = (GCForeground | GCBackground | GCGraphicsExposures
- | GCStipple | GCTile);
- Lisp_Object font;
-
- XSETFONT (font, ew->emacs_frame.font);
- font = Ffont_xlfd_name (font, Qnil);
- if (STRINGP (font))
- {
- XFontStruct *xfont = XLoadQueryFont (FRAME_DISPLAY_INFO (s)->display,
- SSDATA (font));
- if (xfont)
- {
- gc_values.font = xfont->fid;
- valuemask |= GCFont;
- }
- }
-
- /* We have to initialize all of our GCs to have a stipple/tile, otherwise
- XGetGCValues returns uninitialized data when we query the stipple
- (instead of None or something sensible) and it makes things hard.
-
- This should be fixed for real by not querying the GCs but instead having
- some GC-based cache instead of the current face-based cache which doesn't
- effectively cache all of the GC settings we need to use.
- */
-
- blank_stipple
- = XCreateBitmapFromData (XtDisplay (ew),
- RootWindowOfScreen (XtScreen (ew)),
- setup_frame_cursor_bits, 2, 2);
-
- /* use fg = 0, bg = 1 below, but it's irrelevant since this pixmap should
- never actually get used as a background tile!
- */
- blank_tile
- = XCreatePixmapFromBitmapData (XtDisplay (ew),
- RootWindowOfScreen (XtScreen (ew)),
- setup_frame_cursor_bits, 2, 2,
- 0, 1, ew->core.depth);
-
- /* Normal video */
- gc_values.foreground = ew->emacs_frame.foreground_pixel;
- gc_values.background = ew->core.background_pixel;
- gc_values.graphics_exposures = False;
- gc_values.stipple = blank_stipple;
- gc_values.tile = blank_tile;
- XChangeGC (XtDisplay (ew), s->output_data.x->normal_gc,
- valuemask, &gc_values);
-
- /* Reverse video style. */
- gc_values.foreground = ew->core.background_pixel;
- gc_values.background = ew->emacs_frame.foreground_pixel;
- gc_values.graphics_exposures = False;
- gc_values.stipple = blank_stipple;
- gc_values.tile = blank_tile;
- XChangeGC (XtDisplay (ew), s->output_data.x->reverse_gc,
- valuemask, &gc_values);
-
- /* Cursor has to have an empty stipple. */
- gc_values.foreground = ew->core.background_pixel;
- gc_values.background = ew->emacs_frame.cursor_color;
- gc_values.graphics_exposures = False;
- gc_values.tile = blank_tile;
- gc_values.stipple
- = XCreateBitmapFromData (XtDisplay (ew),
- RootWindowOfScreen (XtScreen (ew)),
- setup_frame_cursor_bits, 16, 16);
- XChangeGC (XtDisplay (ew), s->output_data.x->cursor_gc,
- valuemask, &gc_values);
-}
-