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

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.206 by root, Wed Jan 25 21:03:04 2006 UTC vs.
Revision 1.207 by root, Wed Jan 25 21:09:21 2006 UTC

514#if ENABLE_XEMBED 514#if ENABLE_XEMBED
515 if (rs[Rs_embed]) 515 if (rs[Rs_embed])
516 { 516 {
517 long info[2] = { 0, XEMBED_MAPPED }; 517 long info[2] = { 0, XEMBED_MAPPED };
518 518
519 XChangeProperty (display->display, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], 519 XChangeProperty (xdisp, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO],
520 32, PropModeReplace, (unsigned char *)&info, 2); 520 32, PropModeReplace, (unsigned char *)&info, 2);
521 } 521 }
522#endif 522#endif
523 523
524 XMapWindow (xdisp, vt); 524 XMapWindow (xdisp, vt);
842 return true; 842 return true;
843} 843}
844 844
845void rxvt_term::set_string_property (Atom prop, const char *str, int len) 845void rxvt_term::set_string_property (Atom prop, const char *str, int len)
846{ 846{
847 XChangeProperty (display->display, parent[0], 847 XChangeProperty (xdisp, parent[0],
848 prop, XA_STRING, 8, PropModeReplace, 848 prop, XA_STRING, 8, PropModeReplace,
849 (const unsigned char *)str, len >= 0 ? len : strlen (str)); 849 (const unsigned char *)str, len >= 0 ? len : strlen (str));
850} 850}
851 851
852void rxvt_term::set_utf8_property (Atom prop, const char *str, int len) 852void rxvt_term::set_utf8_property (Atom prop, const char *str, int len)
853{ 853{
854 wchar_t *ws = rxvt_mbstowcs (str, len); 854 wchar_t *ws = rxvt_mbstowcs (str, len);
855 char *s = rxvt_wcstoutf8 (ws); 855 char *s = rxvt_wcstoutf8 (ws);
856 856
857 XChangeProperty (display->display, parent[0], 857 XChangeProperty (xdisp, parent[0],
858 prop, xa[XA_UTF8_STRING], 8, PropModeReplace, 858 prop, xa[XA_UTF8_STRING], 8, PropModeReplace,
859 (const unsigned char *)s, strlen (s)); 859 (const unsigned char *)s, strlen (s));
860 860
861 free (s); 861 free (s);
862 free (ws); 862 free (ws);
915 } 915 }
916 916
917 if (!rXParseAllocColor (&xcol, color)) 917 if (!rXParseAllocColor (&xcol, color))
918 return; 918 return;
919 919
920 /* XStoreColor (display->display, display->cmap, XColor*); */ 920 /* XStoreColor (xdisp, display->cmap, XColor*); */
921 921
922 /* 922 /*
923 * FIXME: should free colors here, but no idea how to do it so instead, 923 * FIXME: should free colors here, but no idea how to do it so instead,
924 * so just keep gobbling up the colormap 924 * so just keep gobbling up the colormap
925 */ 925 */
928 if (pix_colors[idx] == pix_colors[i]) 928 if (pix_colors[idx] == pix_colors[i])
929 break; 929 break;
930 if (i > Color_White) 930 if (i > Color_White)
931 { 931 {
932 /* fprintf (stderr, "XFreeColors: pix_colors [%d] = %lu\n", idx, pix_colors [idx]); */ 932 /* fprintf (stderr, "XFreeColors: pix_colors [%d] = %lu\n", idx, pix_colors [idx]); */
933 XFreeColors (display->display, display->cmap, (pix_colors + idx), 1, 933 XFreeColors (xdisp, display->cmap, (pix_colors + idx), 1,
934 DisplayPlanes (display->display, display->screen)); 934 DisplayPlanes (xdisp, display->screen));
935 } 935 }
936# endif 936# endif
937 937
938 pix_colors_focused[idx] = xcol; 938 pix_colors_focused[idx] = xcol;
939 SET_PIXCOLOR (idx); 939 SET_PIXCOLOR (idx);
967 : pix_colors_focused[Color_fg]; 967 : pix_colors_focused[Color_fg];
968 xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) 968 xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg)
969 ? pix_colors_focused[Color_pointer_bg] 969 ? pix_colors_focused[Color_pointer_bg]
970 : pix_colors_focused[Color_bg]; 970 : pix_colors_focused[Color_bg];
971 971
972 XQueryColors (display->display, cmap, xcol, 2); 972 XQueryColors (xdisp, cmap, xcol, 2);
973 XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); 973 XRecolorCursor (xdisp, TermWin_cursor, xcol + 0, xcol + 1);
974} 974}
975 975
976/*----------------------------------------------------------------------*/ 976/*----------------------------------------------------------------------*/
977/* 977/*
978 * find if fg/bg matches any of the normal (low-intensity) colors 978 * find if fg/bg matches any of the normal (low-intensity) colors
1125{ 1125{
1126 XWindowAttributes wattr; 1126 XWindowAttributes wattr;
1127 1127
1128 if (newwidth == 0 || newheight == 0) 1128 if (newwidth == 0 || newheight == 0)
1129 { 1129 {
1130 XGetWindowAttributes (display->display, display->root, &wattr); 1130 XGetWindowAttributes (xdisp, display->root, &wattr);
1131 1131
1132 if (newwidth == 0) 1132 if (newwidth == 0)
1133 newwidth = wattr.width - szHint.base_width; 1133 newwidth = wattr.width - szHint.base_width;
1134 if (newheight == 0) 1134 if (newheight == 0)
1135 newheight = wattr.height - szHint.base_height; 1135 newheight = wattr.height - szHint.base_height;
1197 strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */ 1197 strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */
1198 1198
1199 if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ 1199 if ((p = strchr (server + 1, '@')) != NULL) /* first one only */
1200 *p = '\0'; 1200 *p = '\0';
1201 1201
1202 atom = XInternAtom (display->display, server, False); 1202 atom = XInternAtom (xdisp, server, False);
1203 win = XGetSelectionOwner (display->display, atom); 1203 win = XGetSelectionOwner (xdisp, atom);
1204 1204
1205 if (win != None) 1205 if (win != None)
1206 return True; 1206 return True;
1207 } 1207 }
1208 1208
1432 "*", 1432 "*",
1433 fheight, 1433 fheight,
1434 fheight + 1, fheight - 1, 1434 fheight + 1, fheight - 1,
1435 fheight - 2, fheight + 2); 1435 fheight - 2, fheight + 2);
1436 1436
1437 fs = XCreateFontSet (display->display, rs[Rs_imFont] ? rs[Rs_imFont] : pat, 1437 fs = XCreateFontSet (xdisp, rs[Rs_imFont] ? rs[Rs_imFont] : pat,
1438 &missing_charset_list, &missing_charset_count, &def_string); 1438 &missing_charset_list, &missing_charset_count, &def_string);
1439 1439
1440 if (missing_charset_list) 1440 if (missing_charset_list)
1441 XFreeStringList (missing_charset_list); 1441 XFreeStringList (missing_charset_list);
1442 1442
1518 status_attr ? XNStatusAttributes : NULL, 1518 status_attr ? XNStatusAttributes : NULL,
1519 status_attr, NULL); 1519 status_attr, NULL);
1520 1520
1521 if (preedit_attr) XFree (preedit_attr); 1521 if (preedit_attr) XFree (preedit_attr);
1522 if (status_attr) XFree (status_attr); 1522 if (status_attr) XFree (status_attr);
1523 if (fs) XFreeFontSet (display->display, fs); 1523 if (fs) XFreeFontSet (xdisp, fs);
1524 1524
1525 if (Input_Context == NULL) 1525 if (Input_Context == NULL)
1526 { 1526 {
1527 rxvt_warn ("failed to create input context, continuing without XIM.\n"); 1527 rxvt_warn ("failed to create input context, continuing without XIM.\n");
1528 im_destroy (); 1528 im_destroy ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines