*** empty log message ***
authorpcg <pcg>
Mon, 8 Dec 2003 23:14:40 +0000 (23:14 +0000)
committerpcg <pcg>
Mon, 8 Dec 2003 23:14:40 +0000 (23:14 +0000)
src/command.C
src/init.C
src/main.C

index 7f1470ba44bee0be97a61424db2cb31256cd4860..0bc0cd3a6f85d709589154d6519990b28b7e89a1 100644 (file)
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:       command.c
  *----------------------------------------------------------------------*
- * $Id: command.C,v 1.13 2003-12-05 04:27:20 pcg Exp $
+ * $Id: command.C,v 1.14 2003-12-08 23:14:40 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -63,9 +63,7 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
 #ifdef DEBUG_CMD
     static int      debug_key = 1;     /* accessible by a debugger only */
 #endif
-#ifdef USE_XIM
     int             valid_keysym;
-#endif
     unsigned char  *kbuf = R->kbuf;
 
 /*
@@ -77,15 +75,20 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
     shft = (ev->state & ShiftMask);
     ctrl = (ev->state & ControlMask);
     meta = (ev->state & R->ModMetaMask);
-    if (R->numlock_state || (ev->state & R->ModNumLockMask)) {
+
+    if (R->numlock_state || (ev->state & R->ModNumLockMask))
+      {
        R->numlock_state = (ev->state & R->ModNumLockMask);
        PrivMode((!R->numlock_state), PrivMode_aplKP);
-    }
+      }
+
+    kbuf[0] = 0;
+
 #ifdef USE_XIM
-    if (R->Input_Context != NULL) {
-       Status          status_return;
+    if (R->Input_Context)
+      {
+       Status status_return;
 
-       kbuf[0] = '\0';
 #ifdef X_HAVE_UTF8_STRING
        len = Xutf8LookupString(R->Input_Context, ev, (char *)kbuf,
                              KBUFSZ, &keysym, &status_return);
@@ -95,47 +98,35 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
 #endif
        valid_keysym = ((status_return == XLookupKeySym)
                        || (status_return == XLookupBoth));
-    } else {
-       len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym,
-                           &R->compose);
-       valid_keysym = 1;
-    }
-#else                          /* USE_XIM */
-    len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym,
-                       &R->compose);
-/*
- * map unmapped Latin[2-4]/Katakana/Arabic/Cyrillic/Greek entries -> Latin1
- * good for installations with correct fonts, but without XLOCALE
- */
-    if (!len) {
-       if ((keysym >= 0x0100) && (keysym < 0x0800)) {
-           kbuf[0] = (keysym & 0xFF);
-           kbuf[1] = '\0';
-           len = 1;
-       } else
-           kbuf[0] = '\0';
-    }
-#endif                         /* USE_XIM */
+      }
+    else
+#endif
+      {
+       len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym, &R->compose);
+       valid_keysym = !len;
+      }
 
-#ifdef USE_XIM
     if (valid_keysym)
-#endif
-    {
+      {
 /* for some backwards compatibility */
 #if defined(HOTKEY_CTRL) || defined(HOTKEY_META)
 # ifdef HOTKEY_CTRL
-       if (ctrl) {
+       if (ctrl)
 # else
-       if (meta) {
+       if (meta)
 # endif
-           if (keysym == R->ks_bigfont) {
+          {
+           if (keysym == R->ks_bigfont)
+              {
                rxvt_change_font(aR_ 0, FONT_UP);
                return;
-           } else if (keysym == R->ks_smallfont) {
+             }
+            else if (keysym == R->ks_smallfont)
+              {
                rxvt_change_font(aR_ 0, FONT_DN);
                return;
-           }
-       }
+             }
+         }
 #endif
 
        if (R->TermWin.saveLines) {
@@ -239,8 +230,8 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
 # ifdef META8_OPTION
                    if (R->meta_char == C0_ESC)
 # endif
-                       R->tt_write(&ch, 1);
-               R->tt_write(kbuf0, l);
+                       R->tt_write (&ch, 1);
+               R->tt_write (kbuf0, l);
                return;
            } else
 #endif
@@ -574,7 +565,7 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
 #endif
        /* nil */ ;
        }
-    }
+      }
 
     if (len <= 0)
        return;                 /* not mapped */
index 8d6df159dff2102e92b7f2f6d5cc35eb43da86e7..aad29bc942090266a69598c78fe2e59090225644 100644 (file)
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:        init.c
  *----------------------------------------------------------------------*
- * $Id: init.C,v 1.9 2003-12-02 21:49:46 pcg Exp $
+ * $Id: init.C,v 1.10 2003-12-08 23:14:40 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -825,7 +825,7 @@ rxvt_init_xlocale(pR)
     rxvt_print_error("Setting locale failed.");
   else
     {
-      Atom            wmlocale;
+      Atom wmlocale;
 
       wmlocale = XInternAtom(R->Xdisplay, "WM_LOCALE_NAME", False);
       XChangeProperty(R->Xdisplay, R->TermWin.parent[0], wmlocale,
@@ -837,6 +837,7 @@ rxvt_init_xlocale(pR)
           rxvt_print_error("The locale is not supported by Xlib");
           return;
         }
+
       rxvt_setTermFontSet(aR_ 0);
 
       /* see if we can connect yet */
index 6ed2dac42511a459b087d8d6f3d5c3946010528d..3c803e826c91921320528b6d40ab96e1c81442af 100644 (file)
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:        main.c
  *----------------------------------------------------------------------*
- * $Id: main.C,v 1.10 2003-12-03 23:19:44 pcg Exp $
+ * $Id: main.C,v 1.11 2003-12-08 23:14:40 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -1120,49 +1120,53 @@ rxvt_IMInstantiateCallback(Display * unused
                            __attribute__ ((unused)), XPointer call_data
                            __attribute__ ((unused)))
 {
-    dR;
-    int             i, found, had_im;
-    const char     *p;
-    char          **s;
-    char            buf[IMBUFSIZ];
+  dR;
+  int i, found, had_im;
+  const char *p;
+  char **s;
+  char buf[IMBUFSIZ];
 
-    D_MAIN((stderr, "rxvt_IMInstantiateCallback()"));
-    if (R->Input_Context)
-        return;
+  D_MAIN((stderr, "rxvt_IMInstantiateCallback()"));
+  if (R->Input_Context)
+    return;
+
+  p = R->rs[Rs_inputMethod];
+  if (p && *p)
+    {
+      bool found = false;
 
-    found = had_im = 0;
-    p = R->rs[Rs_inputMethod];
-    if (p && *p) {
-        had_im = 1;
-        s = rxvt_splitcommastring(p);
-        for (i = 0; s[i]; i++) {
-            if (*s[i]) {
-                STRCPY(buf, "@im=");
-                STRNCAT(buf, s[i], IMBUFSIZ - 5);
-                if ((p = XSetLocaleModifiers(buf)) != NULL && *p
-                    && (rxvt_IM_get_IC(aR) == True)) {
-                    found = 1;
-                    break;
+      s = rxvt_splitcommastring (p);
+      for (i = 0; s[i]; i++)
+        {
+          if (*s[i])
+            {
+              STRCPY (buf, "@im=");
+              STRNCAT (buf, s[i], IMBUFSIZ - 5);
+              if ((p = XSetLocaleModifiers (buf)) && *p
+                  && rxvt_IM_get_IC (aR))
+                {
+                  found = true;
+                  break;
                 }
             }
         }
-        for (i = 0; s[i]; i++)
-            free(s[i]);
-        free(s);
-    }
-    if (found)
-        return;
+      for (i = 0; s[i]; i++)
+          free(s[i]);
+      free(s);
 
-/* try with XMODIFIERS env. var. */
-    if ((p = XSetLocaleModifiers("")) != NULL && *p) {
-        rxvt_IM_get_IC(aR);
+      if (found)
         return;
     }
 
+/* try with XMODIFIERS env. var. */
+  if ((p = XSetLocaleModifiers ("")) && *p
+      && rxvt_IM_get_IC (aR))
+    return;
+
 /* try with no modifiers base IF the user didn't specify an IM */
-    if (!had_im && (p = XSetLocaleModifiers("@im=none")) != NULL && *p
-        && rxvt_IM_get_IC(aR) == True)
-        return;
+  if ((p = XSetLocaleModifiers ("@im=none")) && *p
+      && rxvt_IM_get_IC (aR) == True)
+    return;
 }
 
 /*