… | |
… | |
96 | text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2) |
96 | text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2) |
97 | { |
97 | { |
98 | compose_char *cc; |
98 | compose_char *cc; |
99 | |
99 | |
100 | // break compose chains, as stupid readline really likes to duplicate |
100 | // break compose chains, as stupid readline really likes to duplicate |
101 | // composing characters for some reason near the end of a line. |
101 | // composing characters for some reason, near the end of a line. |
102 | cc = (*this)[c1]; |
102 | cc = (*this)[c1]; |
103 | while (cc) |
103 | while (cc) |
104 | { |
104 | { |
105 | if (cc->c2 == c2) return c1; |
105 | if (cc->c2 == c2) return c1; |
106 | cc = (*this)[cc->c1]; |
106 | cc = (*this)[cc->c1]; |
107 | } |
107 | } |
108 | |
108 | |
109 | // check to see whether this combination already exists otherwise |
109 | // check to see whether this combination already exists otherwise |
110 | for (cc = v.end (); cc-- > v.begin (); ) |
110 | for (cc = v.end (); cc-- > v.begin (); ) |
111 | { |
|
|
112 | if (cc->c1 == c1 && cc->c2 == c2) |
111 | if (cc->c1 == c1 && cc->c2 == c2) |
113 | return COMPOSE_LO + (cc - v.begin ()); |
112 | return COMPOSE_LO + (cc - v.begin ()); |
114 | } |
|
|
115 | |
113 | |
116 | // allocate a new combination |
114 | // allocate a new combination |
117 | if (v.size () == COMPOSE_HI - COMPOSE_LO + 1) |
115 | if (v.size () == COMPOSE_HI - COMPOSE_LO + 1) |
118 | { |
116 | { |
119 | static int seen; |
117 | static int seen; |
120 | |
118 | |
121 | if (!seen++) |
119 | if (!seen++) |
122 | fprintf (stderr, "too many unrepresentable composite characters, try --enable-unicode3\n"); |
120 | rxvt_warn ("too many unrepresentable composite characters, try --enable-unicode3\n"); |
123 | |
121 | |
124 | return REPLACEMENT_CHAR; |
122 | return REPLACEMENT_CHAR; |
125 | } |
123 | } |
126 | |
124 | |
127 | v.push_back (compose_char (c1, c2)); |
125 | v.push_back (compose_char (c1, c2)); |
… | |
… | |
394 | print_x_error (Display *dpy, XErrorEvent *event) |
392 | print_x_error (Display *dpy, XErrorEvent *event) |
395 | { |
393 | { |
396 | char buffer[BUFSIZ]; |
394 | char buffer[BUFSIZ]; |
397 | char mesg[BUFSIZ]; |
395 | char mesg[BUFSIZ]; |
398 | char number[32]; |
396 | char number[32]; |
399 | char *mtype = "XlibMessage"; |
397 | const char mtype[] = "XlibMessage"; |
400 | XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); |
398 | XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); |
401 | XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); |
399 | XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); |
402 | rxvt_warn ("An X Error occurred, trying to continue after report.\n"); |
400 | rxvt_warn ("An X Error occurred, trying to continue after report.\n"); |
403 | rxvt_warn ("%s: %s\n", mesg, buffer); |
401 | rxvt_warn ("%s: %s\n", mesg, buffer); |
404 | XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", mesg, BUFSIZ); |
402 | XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", mesg, BUFSIZ); |
… | |
… | |
958 | void |
956 | void |
959 | rxvt_term::set_colorfgbg () |
957 | rxvt_term::set_colorfgbg () |
960 | { |
958 | { |
961 | unsigned int i; |
959 | unsigned int i; |
962 | const char *xpmb = ""; |
960 | const char *xpmb = ""; |
963 | char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1]; |
961 | char fstr[] = "default"; |
|
|
962 | char bstr[] = "default"; |
964 | |
963 | |
965 | strcpy (fstr, "default"); |
|
|
966 | strcpy (bstr, "default"); |
|
|
967 | for (i = Color_Black; i <= Color_White; i++) |
964 | for (i = Color_Black; i <= Color_White; i++) |
968 | if (pix_colors[Color_fg] == pix_colors[i]) |
965 | if (pix_colors[Color_fg] == pix_colors[i]) |
969 | { |
966 | { |
970 | sprintf (fstr, "%d", (i - Color_Black)); |
967 | sprintf (fstr, "%d", i - Color_Black); |
971 | break; |
968 | break; |
972 | } |
969 | } |
973 | |
970 | |
974 | for (i = Color_Black; i <= Color_White; i++) |
971 | for (i = Color_Black; i <= Color_White; i++) |
975 | if (pix_colors[Color_bg] == pix_colors[i]) |
972 | if (pix_colors[Color_bg] == pix_colors[i]) |
976 | { |
973 | { |
977 | sprintf (bstr, "%d", (i - Color_Black)); |
974 | sprintf (bstr, "%d", i - Color_Black); |
978 | #ifdef BG_IMAGE_FROM_FILE |
975 | #ifdef BG_IMAGE_FROM_FILE |
979 | xpmb = "default;"; |
976 | xpmb = "default;"; |
980 | #endif |
977 | #endif |
981 | break; |
978 | break; |
982 | } |
979 | } |
… | |
… | |
1356 | p = pet[pi]; |
1353 | p = pet[pi]; |
1357 | |
1354 | |
1358 | if (!p) |
1355 | if (!p) |
1359 | continue; |
1356 | continue; |
1360 | |
1357 | |
1361 | s = rxvt_splitcommastring (p); |
1358 | s = rxvt_strsplit (',', p); |
1362 | |
1359 | |
1363 | for (i = found = 0; !found && s[i]; i++) |
1360 | for (i = found = 0; !found && s[i]; i++) |
1364 | { |
1361 | { |
1365 | if (!strcmp (s[i], "OverTheSpot")) |
1362 | if (!strcmp (s[i], "OverTheSpot")) |
1366 | input_style = XIMPreeditPosition | XIMStatusNothing; |
1363 | input_style = XIMPreeditPosition | XIMStatusNothing; |
… | |
… | |
1378 | input_style = XIMPreeditNothing | XIMStatusNothing; |
1375 | input_style = XIMPreeditNothing | XIMStatusNothing; |
1379 | |
1376 | |
1380 | for (j = 0; j < xim_styles->count_styles; j++) |
1377 | for (j = 0; j < xim_styles->count_styles; j++) |
1381 | if (input_style == xim_styles->supported_styles[j]) |
1378 | if (input_style == xim_styles->supported_styles[j]) |
1382 | { |
1379 | { |
1383 | rxvt_freecommastring (s); |
1380 | rxvt_free_strsplit (s); |
1384 | |
1381 | |
1385 | found = 1; |
1382 | found = 1; |
1386 | goto foundpet; |
1383 | goto foundpet; |
1387 | } |
1384 | } |
1388 | |
1385 | |
1389 | } |
1386 | } |
1390 | |
1387 | |
1391 | rxvt_freecommastring (s); |
1388 | rxvt_free_strsplit (s); |
1392 | } |
1389 | } |
1393 | |
1390 | |
1394 | foundpet: |
1391 | foundpet: |
1395 | |
1392 | |
1396 | XFree (xim_styles); |
1393 | XFree (xim_styles); |
… | |
… | |
1552 | p = rs[Rs_inputMethod]; |
1549 | p = rs[Rs_inputMethod]; |
1553 | if (p && *p) |
1550 | if (p && *p) |
1554 | { |
1551 | { |
1555 | bool found = false; |
1552 | bool found = false; |
1556 | |
1553 | |
1557 | s = rxvt_splitcommastring (p); |
1554 | s = rxvt_strsplit (',', p); |
1558 | |
1555 | |
1559 | for (i = 0; s[i]; i++) |
1556 | for (i = 0; s[i]; i++) |
1560 | { |
1557 | { |
1561 | if (*s[i]) |
1558 | if (*s[i]) |
1562 | { |
1559 | { |
… | |
… | |
1568 | break; |
1565 | break; |
1569 | } |
1566 | } |
1570 | } |
1567 | } |
1571 | } |
1568 | } |
1572 | |
1569 | |
1573 | rxvt_freecommastring (s); |
1570 | rxvt_free_strsplit (s); |
1574 | |
1571 | |
1575 | if (found) |
1572 | if (found) |
1576 | goto done; |
1573 | goto done; |
1577 | } |
1574 | } |
1578 | |
1575 | |