comparison src/widget.c @ 7557:889a8cd345b2

(setup_frame_gcs): Move cursor_bits variable out of setup_frame_gcs and rename to setup_frame_cursor_bits.
author Richard M. Stallman <rms@gnu.org>
date Thu, 19 May 1994 18:32:59 +0000
parents 67bb36e8e602
children 782afa5d95cb
comparison
equal deleted inserted replaced
7556:48f98b59a339 7557:889a8cd345b2
530 XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); 530 XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
531 s->display.x->cursor_gc = 531 s->display.x->cursor_gc =
532 XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); 532 XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
533 } 533 }
534 534
535 static char setup_frame_cursor_bits[] =
536 {
537 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
538 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
539 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
541 };
542
535 static void 543 static void
536 setup_frame_gcs (ew) 544 setup_frame_gcs (ew)
537 EmacsFrame ew; 545 EmacsFrame ew;
538 { 546 {
539 XGCValues gc_values; 547 XGCValues gc_values;
540 struct frame* s = ew->emacs_frame.frame; 548 struct frame* s = ew->emacs_frame.frame;
541 Pixmap blank_stipple, blank_tile; 549 Pixmap blank_stipple, blank_tile;
542
543 static char cursor_bits[] =
544 {
545 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
546 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
549 };
550 550
551 /* We have to initialize all of our GCs to have a stipple/tile, otherwise 551 /* We have to initialize all of our GCs to have a stipple/tile, otherwise
552 XGetGCValues returns uninitialized data when we query the stipple 552 XGetGCValues returns uninitialized data when we query the stipple
553 (instead of None or something sensible) and it makes things hard. 553 (instead of None or something sensible) and it makes things hard.
554 554
557 effectively cache all of the GC settings we need to use. 557 effectively cache all of the GC settings we need to use.
558 */ 558 */
559 559
560 blank_stipple = 560 blank_stipple =
561 XCreateBitmapFromData (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 561 XCreateBitmapFromData (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)),
562 cursor_bits, 2, 2); 562 setup_frame_cursor_bits, 2, 2);
563 563
564 /* use fg = 0, bg = 1 below, but it's irrelevant since this pixmap should 564 /* use fg = 0, bg = 1 below, but it's irrelevant since this pixmap should
565 never actually get used as a background tile! 565 never actually get used as a background tile!
566 */ 566 */
567 blank_tile = 567 blank_tile =
568 XCreatePixmapFromBitmapData (XtDisplay(ew), 568 XCreatePixmapFromBitmapData (XtDisplay(ew),
569 RootWindowOfScreen (XtScreen (ew)), 569 RootWindowOfScreen (XtScreen (ew)),
570 cursor_bits, 2, 2, 0, 1, ew->core.depth); 570 setup_frame_cursor_bits, 2, 2, 0, 1,
571 ew->core.depth);
571 572
572 /* Normal video */ 573 /* Normal video */
573 gc_values.font = ew->emacs_frame.font->fid; 574 gc_values.font = ew->emacs_frame.font->fid;
574 gc_values.foreground = ew->emacs_frame.foreground_pixel; 575 gc_values.foreground = ew->emacs_frame.foreground_pixel;
575 gc_values.background = ew->core.background_pixel; 576 gc_values.background = ew->core.background_pixel;
600 gc_values.graphics_exposures = False; 601 gc_values.graphics_exposures = False;
601 gc_values.tile = blank_tile; 602 gc_values.tile = blank_tile;
602 gc_values.stipple = 603 gc_values.stipple =
603 XCreateBitmapFromData (XtDisplay (ew), 604 XCreateBitmapFromData (XtDisplay (ew),
604 RootWindowOfScreen (XtScreen (ew)), 605 RootWindowOfScreen (XtScreen (ew)),
605 cursor_bits, 16, 16); 606 setup_frame_cursor_bits, 16, 16);
606 XChangeGC (XtDisplay (ew), s->display.x->cursor_gc, 607 XChangeGC (XtDisplay (ew), s->display.x->cursor_gc,
607 (GCFont | GCForeground | GCBackground | GCGraphicsExposures 608 (GCFont | GCForeground | GCBackground | GCGraphicsExposures
608 | GCStipple | GCTile), 609 | GCStipple | GCTile),
609 &gc_values); 610 &gc_values);
610 } 611 }