From 3645f234d8596f6f334c262c6163e05573f8c55c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Jul 2004 14:05:27 +0000 Subject: [PATCH] *** empty log message *** --- src/encoding.h | 2 +- src/rxvtcolor.C | 26 ++++++++++++++++++-------- src/rxvtcolor.h | 13 +++++++++++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/encoding.h b/src/encoding.h index 2f94315b..aa1f5da6 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -1,7 +1,7 @@ #ifndef ENCODING_H #define ENCODING_H -#include +#include typedef uint32_t unicode_t; diff --git a/src/rxvtcolor.C b/src/rxvtcolor.C index 92bfa42b..dfa3e876 100644 --- a/src/rxvtcolor.C +++ b/src/rxvtcolor.C @@ -104,6 +104,7 @@ refcache::~refcache () ///////////////////////////////////////////////////////////////////////////// +#ifdef USE_XIM static void im_destroy_cb (XIM unused1, XPointer client_data, XPointer unused3) { @@ -138,6 +139,7 @@ rxvt_xim::~rxvt_xim () if (xim) XCloseIM (xim); } +#endif ///////////////////////////////////////////////////////////////////////////// @@ -185,7 +187,9 @@ bool rxvt_display::init () fcntl (fd, F_SETFD, FD_CLOEXEC); XSelectInput (display, root, PropertyChangeMask); +#ifdef USE_XIM xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0); +#endif flush (); @@ -200,11 +204,13 @@ rxvt_display::~rxvt_display () XCloseDisplay (display); } +#ifdef USE_XIM void rxvt_display::im_change_cb () { for (im_watcher **i = imw.begin (); i != imw.end (); ++i) (*i)->call (); } +#endif void rxvt_display::x_cb (io_watcher &w, short revents) { @@ -215,10 +221,12 @@ void rxvt_display::x_cb (io_watcher &w, short revents) //printf ("T %d w %lx\n", xev.type, xev.xany.window);//D +#ifdef USE_XIM if (xev.type == PropertyNotify && xev.xany.window == root && xev.xproperty.atom == xa_xim_servers) im_change_cb (); +#endif for (int i = xw.size (); i--; ) { @@ -258,6 +266,15 @@ void rxvt_display::unreg (xevent_watcher *w) xw[w->active - 1] = 0; } +void rxvt_display::set_selection_owner (rxvt_term *owner) +{ + if (selection_owner && selection_owner != owner) + selection_owner->selection_clear (); + + selection_owner = owner; +} + +#ifdef USE_XIM void rxvt_display::reg (im_watcher *w) { imw.push_back (w); @@ -268,14 +285,6 @@ void rxvt_display::unreg (im_watcher *w) imw.erase (find (imw.begin (), imw.end (), w)); } -void rxvt_display::set_selection_owner (rxvt_term *owner) -{ - if (selection_owner && selection_owner != owner) - selection_owner->selection_clear (); - - selection_owner = owner; -} - rxvt_xim *rxvt_display::get_xim (const char *locale, const char *modifiers) { char *id; @@ -301,6 +310,7 @@ void rxvt_display::put_xim (rxvt_xim *xim) { xims.put (xim); } +#endif Atom rxvt_display::atom (const char *name) { diff --git a/src/rxvtcolor.h b/src/rxvtcolor.h index 47796d7a..1adedfb4 100644 --- a/src/rxvtcolor.h +++ b/src/rxvtcolor.h @@ -48,6 +48,7 @@ struct refcache : vector { ///////////////////////////////////////////////////////////////////////////// +#ifdef USE_XIM struct rxvt_xim : refcounted { void destroy (); rxvt_display *display; @@ -59,6 +60,7 @@ struct rxvt_xim : refcounted { bool init (); ~rxvt_xim (); }; +#endif struct rxvt_display : refcounted { Atom xa_xim_servers; @@ -67,10 +69,12 @@ struct rxvt_display : refcounted { io_watcher x_ev; void x_cb (io_watcher &w, short revents); +#ifdef USE_XIM refcache xims; vector imw; void im_change_cb (); +#endif //public Display *display; @@ -87,19 +91,23 @@ struct rxvt_display : refcounted { void flush (); + void set_selection_owner (rxvt_term *owner); + void reg (xevent_watcher *w); void unreg (xevent_watcher *w); + +#ifdef USE_XIM void reg (im_watcher *w); void unreg (im_watcher *w); - void set_selection_owner (rxvt_term *owner); - rxvt_xim *get_xim (const char *locale, const char *modifiers); void put_xim (rxvt_xim *xim); +#endif Atom atom (const char *name); }; +#ifdef USE_XIM struct im_watcher : watcher, callback0 { template im_watcher (O1 *object, void (O2::*method) ()) @@ -115,6 +123,7 @@ struct im_watcher : watcher, callback0 { display->unreg (this); } }; +#endif struct xevent_watcher : watcher, callback1 { Window window; -- 2.34.1