ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.C
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.132 by sf-exg, Sun Jun 3 15:50:22 2012 UTC vs.
Revision 1.136 by root, Wed Jun 6 20:22:04 2012 UTC

66#endif 66#endif
67#if USE_XIM 67#if USE_XIM
68 "WM_LOCALE_NAME", 68 "WM_LOCALE_NAME",
69 "XIM_SERVERS", 69 "XIM_SERVERS",
70#endif 70#endif
71#ifdef ENABLE_TRANSPARENCY 71#if ENABLE_TRANSPARENCY
72 "_XROOTPMAP_ID", 72 "_XROOTPMAP_ID",
73 "ESETROOT_PMAP_ID", 73 "ESETROOT_PMAP_ID",
74#endif 74#endif
75#if ENABLE_XEMBED 75#if ENABLE_XEMBED
76 "_XEMBED", 76 "_XEMBED",
153 put (*this->begin ()); 153 put (*this->begin ());
154} 154}
155 155
156///////////////////////////////////////////////////////////////////////////// 156/////////////////////////////////////////////////////////////////////////////
157 157
158#ifdef USE_XIM 158#if USE_XIM
159 159
160static void 160static void
161#if XIMCB_PROTO_BROKEN 161#if XIMCB_PROTO_BROKEN
162im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3) 162im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3)
163#else 163#else
473 int major, minor; 473 int major, minor;
474 if (XRenderQueryVersion (dpy, &major, &minor)) 474 if (XRenderQueryVersion (dpy, &major, &minor))
475 { 475 {
476 flags |= DISPLAY_HAS_RENDER; 476 flags |= DISPLAY_HAS_RENDER;
477 477
478 if (major > 0 || (major == 0 && minor >= 10))
479 flags |= DISPLAY_HAS_RENDER_10;
480
478 if (major > 0 || (major == 0 && minor >= 11)) 481 if (major > 0 || (major == 0 && minor >= 11))
479 flags |= DISPLAY_HAS_RENDER_MUL; 482 flags |= DISPLAY_HAS_RENDER_MUL;
480 483
481 XFilters *filters = XRenderQueryFilters (dpy, root); 484 XFilters *filters = XRenderQueryFilters (dpy, root);
482 if (filters) 485 if (filters)
534#ifdef POINTER_BLANK 537#ifdef POINTER_BLANK
535 XFreeCursor (dpy, blank_cursor); 538 XFreeCursor (dpy, blank_cursor);
536#endif 539#endif
537 x_ev.stop (); 540 x_ev.stop ();
538 flush_ev.stop (); 541 flush_ev.stop ();
539#ifdef USE_XIM 542#if USE_XIM
540 xims.clear (); 543 xims.clear ();
541#endif 544#endif
542 XrmDestroyDatabase (XrmGetDatabase (dpy)); 545 XrmDestroyDatabase (XrmGetDatabase (dpy));
543 XCloseDisplay (dpy); 546 XCloseDisplay (dpy);
544} 547}
545 548
546#ifdef USE_XIM 549#if USE_XIM
547void rxvt_display::im_change_cb () 550void rxvt_display::im_change_cb ()
548{ 551{
549 for (im_watcher **i = imw.begin (); i != imw.end (); ++i) 552 for (im_watcher **i = imw.begin (); i != imw.end (); ++i)
550 (*i)->call (); 553 (*i)->call ();
551} 554}
587 do 590 do
588 { 591 {
589 XEvent xev; 592 XEvent xev;
590 XNextEvent (dpy, &xev); 593 XNextEvent (dpy, &xev);
591 594
592#ifdef USE_XIM 595#if USE_XIM
593 if (!XFilterEvent (&xev, None)) 596 if (!XFilterEvent (&xev, None))
594 { 597 {
595 if (xev.type == PropertyNotify 598 if (xev.type == PropertyNotify
596 && xev.xany.window == root 599 && xev.xany.window == root
597 && xev.xproperty.atom == xa[XA_XIM_SERVERS]) 600 && xev.xproperty.atom == xa[XA_XIM_SERVERS])
605 if (!xw[i]) 608 if (!xw[i])
606 xw.erase_unordered (i); 609 xw.erase_unordered (i);
607 else if (xw[i]->window == xev.xany.window) 610 else if (xw[i]->window == xev.xany.window)
608 xw[i]->call (xev); 611 xw[i]->call (xev);
609 } 612 }
610#ifdef USE_XIM 613#if USE_XIM
611 } 614 }
612#endif 615#endif
613 } 616 }
614 while (XEventsQueued (dpy, QueuedAlready)); 617 while (XEventsQueued (dpy, QueuedAlready));
615 618
646 } 649 }
647 650
648 cur_owner = owner; 651 cur_owner = owner;
649} 652}
650 653
651#ifdef USE_XIM 654#if USE_XIM
652 655
653void rxvt_display::reg (im_watcher *w) 656void rxvt_display::reg (im_watcher *w)
654{ 657{
655 imw.push_back (w); 658 imw.push_back (w);
656} 659}
689#endif 692#endif
690 693
691Atom rxvt_display::atom (const char *name) 694Atom rxvt_display::atom (const char *name)
692{ 695{
693 return XInternAtom (dpy, name, False); 696 return XInternAtom (dpy, name, False);
697}
698
699Pixmap
700rxvt_display::get_pixmap_property (Atom property)
701{
702 Pixmap pixmap = None;
703
704 int aformat;
705 unsigned long nitems, bytes_after;
706 Atom atype;
707 unsigned char *prop;
708 int result = XGetWindowProperty (dpy, root, property,
709 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
710 &nitems, &bytes_after, &prop);
711 if (result == Success)
712 {
713 if (atype == XA_PIXMAP)
714 pixmap = *(Pixmap *)prop;
715 XFree (prop);
716 }
717
718 return pixmap;
694} 719}
695 720
696///////////////////////////////////////////////////////////////////////////// 721/////////////////////////////////////////////////////////////////////////////
697 722
698template class refcache<rxvt_display>; 723template class refcache<rxvt_display>;
865 890
866 return got; 891 return got;
867} 892}
868 893
869void 894void
870rxvt_color::get (rgba &color) 895rxvt_color::get (rgba &color) const
871{ 896{
872#if XFT 897#if XFT
873 color.r = c.color.red; 898 color.r = c.color.red;
874 color.g = c.color.green; 899 color.g = c.color.green;
875 color.b = c.color.blue; 900 color.b = c.color.blue;
881 color.a = rgba::MAX_CC; 906 color.a = rgba::MAX_CC;
882#endif 907#endif
883} 908}
884 909
885void 910void
886rxvt_color::get (XColor &color) 911rxvt_color::get (XColor &color) const
887{ 912{
888 rgba c; 913 rgba c;
889 get (c); 914 get (c);
890 915
891 color.red = c.r; 916 color.red = c.r;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines