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

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.121 by root, Wed Nov 30 21:05:39 2005 UTC vs.
Revision 1.122 by root, Sun Dec 18 00:59:42 2005 UTC

226 226
227 if (pix_colors == NULL) 227 if (pix_colors == NULL)
228 return false; 228 return false;
229 229
230#if defined(XPM_BACKGROUND) || defined(TRANSPARENT) 230#if defined(XPM_BACKGROUND) || defined(TRANSPARENT)
231 TermWin.pixmap = None; 231 pixmap = None;
232#endif 232#endif
233 233
234 MEvent.time = CurrentTime; 234 MEvent.time = CurrentTime;
235 MEvent.button = AnyButton; 235 MEvent.button = AnyButton;
236 options = DEFAULT_OPTIONS; 236 options = DEFAULT_OPTIONS;
237 want_refresh = 1; 237 want_refresh = 1;
238 priv_modes = SavedModes = PrivMode_Default; 238 priv_modes = SavedModes = PrivMode_Default;
239 TermWin.focus = 0; 239 focus = 0;
240 TermWin.ncol = 80; 240 ncol = 80;
241 TermWin.nrow = 24; 241 nrow = 24;
242 TermWin.int_bwidth = INTERNALBORDERWIDTH; 242 int_bwidth = INTERNALBORDERWIDTH;
243 TermWin.ext_bwidth = EXTERNALBORDERWIDTH; 243 ext_bwidth = EXTERNALBORDERWIDTH;
244 TermWin.lineSpace = LINESPACE; 244 lineSpace = LINESPACE;
245 TermWin.saveLines = SAVELINES; 245 saveLines = SAVELINES;
246 numpix_colors = TOTAL_COLORS; 246 numpix_colors = TOTAL_COLORS;
247 247
248 refresh_limit = 1; 248 refresh_limit = 1;
249 refresh_type = SLOW_REFRESH; 249 refresh_type = SLOW_REFRESH;
250 prev_nrow = prev_ncol = 0; 250 prev_nrow = prev_ncol = 0;
369 if (!rs[Rs_iconName]) 369 if (!rs[Rs_iconName])
370 rs[Rs_iconName] = rs[Rs_name]; 370 rs[Rs_iconName] = rs[Rs_name];
371 } 371 }
372 372
373 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) 373 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0)
374 TermWin.saveLines = BOUND_POSITIVE_INT16 (i); 374 saveLines = BOUND_POSITIVE_INT16 (i);
375 375
376#if ENABLE_FRILLS 376#if ENABLE_FRILLS
377 if (rs[Rs_int_bwidth] && (i = atoi (rs[Rs_int_bwidth])) >= 0) 377 if (rs[Rs_int_bwidth] && (i = atoi (rs[Rs_int_bwidth])) >= 0)
378 TermWin.int_bwidth = min (i, 100); /* arbitrary limit */ 378 int_bwidth = min (i, 100); /* arbitrary limit */
379 if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0) 379 if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0)
380 TermWin.ext_bwidth = min (i, 100); /* arbitrary limit */ 380 ext_bwidth = min (i, 100); /* arbitrary limit */
381 if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0) 381 if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0)
382 TermWin.lineSpace = min (i, 100); /* arbitrary limit */ 382 lineSpace = min (i, 100); /* arbitrary limit */
383#endif 383#endif
384 384
385#ifdef POINTER_BLANK 385#ifdef POINTER_BLANK
386 if (rs[Rs_pointerBlankDelay] && (i = atoi (rs[Rs_pointerBlankDelay])) >= 0) 386 if (rs[Rs_pointerBlankDelay] && (i = atoi (rs[Rs_pointerBlankDelay])) >= 0)
387 pointerBlankDelay = i; 387 pointerBlankDelay = i;
388 else 388 else
389 pointerBlankDelay = 2; 389 pointerBlankDelay = 2;
390#endif 390#endif
391 391
392 /* no point having a scrollbar without having any scrollback! */ 392 /* no point having a scrollbar without having any scrollback! */
393 if (!TermWin.saveLines) 393 if (!saveLines)
394 options &= ~Opt_scrollBar; 394 options &= ~Opt_scrollBar;
395 395
396#ifdef PRINTPIPE 396#ifdef PRINTPIPE
397 if (!rs[Rs_print_pipe]) 397 if (!rs[Rs_print_pipe])
398 rs[Rs_print_pipe] = PRINTPIPE; 398 rs[Rs_print_pipe] = PRINTPIPE;
518 env_display = (char *)rxvt_malloc ((i + 9) * sizeof (char)); 518 env_display = (char *)rxvt_malloc ((i + 9) * sizeof (char));
519 519
520 sprintf (env_display, "DISPLAY=%s", val); 520 sprintf (env_display, "DISPLAY=%s", val);
521 521
522 /* avoiding the math library: 522 /* avoiding the math library:
523 * i = (int) (ceil (log10 ((unsigned int)TermWin.parent[0]))) */ 523 * i = (int) (ceil (log10 ((unsigned int)parent[0]))) */
524 for (i = 0, u = (unsigned int)TermWin.parent[0]; u; u /= 10, i++) 524 for (i = 0, u = (unsigned int)parent[0]; u; u /= 10, i++)
525 ; 525 ;
526 MAX_IT (i, 1); 526 MAX_IT (i, 1);
527 env_windowid = (char *)rxvt_malloc ((i + 10) * sizeof (char)); 527 env_windowid = (char *)rxvt_malloc ((i + 10) * sizeof (char));
528 528
529 sprintf (env_windowid, "WINDOWID=%u", 529 sprintf (env_windowid, "WINDOWID=%u",
530 (unsigned int)TermWin.parent[0]); 530 (unsigned int)parent[0]);
531 531
532 /* add entries to the environment: 532 /* add entries to the environment:
533 * @ DISPLAY: in case we started with -display 533 * @ DISPLAY: in case we started with -display
534 * @ WINDOWID: X window id number of the window 534 * @ WINDOWID: X window id number of the window
535 * @ COLORTERM: terminal sub-name and also indicates its color 535 * @ COLORTERM: terminal sub-name and also indicates its color
984 if (!XGetWindowAttributes (disp, parent, &wattr)) 984 if (!XGetWindowAttributes (disp, parent, &wattr))
985 rxvt_fatal ("invalid window-id specified with -embed, aborting.\n"); 985 rxvt_fatal ("invalid window-id specified with -embed, aborting.\n");
986 986
987 window_calc (wattr.width, wattr.height); 987 window_calc (wattr.width, wattr.height);
988 } 988 }
989
990#endif 989#endif
990
991 window_calc (0, 0); 991 window_calc (0, 0);
992 992
993 /* sub-window placement & size in rxvt_resize_subwindows () */ 993 /* sub-window placement & size in rxvt_resize_subwindows () */
994#ifdef PREFER_24BIT 994#ifdef PREFER_24BIT
995 attributes.background_pixel = pix_colors_focused[Color_border]; 995 attributes.background_pixel = pix_colors_focused[Color_border];
996 attributes.border_pixel = pix_colors_focused[Color_border]; 996 attributes.border_pixel = pix_colors_focused[Color_border];
997 attributes.colormap = display->cmap; 997 attributes.colormap = display->cmap;
998 top = XCreateWindow (disp, parent, 998 top = XCreateWindow (disp, parent,
999 szHint.x, szHint.y, 999 szHint.x, szHint.y,
1000 szHint.width, szHint.height, 1000 szHint.width, szHint.height,
1001 TermWin.ext_bwidth, 1001 ext_bwidth,
1002 display->depth, InputOutput, 1002 display->depth, InputOutput,
1003 display->visual, 1003 display->visual,
1004 CWColormap | CWBackPixel | CWBorderPixel, &attributes); 1004 CWColormap | CWBackPixel | CWBorderPixel, &attributes);
1005#else 1005#else
1006 top = XCreateSimpleWindow (disp, parent, 1006 top = XCreateSimpleWindow (disp, parent,
1007 szHint.x, szHint.y, 1007 szHint.x, szHint.y,
1008 szHint.width, szHint.height, 1008 szHint.width, szHint.height,
1009 TermWin.ext_bwidth, 1009 ext_bwidth,
1010 pix_colors_focused[Color_border], 1010 pix_colors_focused[Color_border],
1011 pix_colors_focused[Color_border]); 1011 pix_colors_focused[Color_border]);
1012#endif 1012#endif
1013 1013
1014 TermWin.parent[0] = top; 1014 this->parent[0] = top;
1015 1015
1016 old_width = szHint.width; 1016 old_width = szHint.width;
1017 old_height = szHint.height; 1017 old_height = szHint.height;
1018 1018
1019 process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); 1019 process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST);
1072 /* cursor (menuBar/scrollBar): Black-on-White */ 1072 /* cursor (menuBar/scrollBar): Black-on-White */
1073 leftptr_cursor = XCreateFontCursor (disp, XC_left_ptr); 1073 leftptr_cursor = XCreateFontCursor (disp, XC_left_ptr);
1074#endif 1074#endif
1075 1075
1076 /* the vt window */ 1076 /* the vt window */
1077 TermWin.vt = XCreateSimpleWindow (disp, top, 1077 vt = XCreateSimpleWindow (disp, top,
1078 window_vt_x, 1078 window_vt_x,
1079 window_vt_y, 1079 window_vt_y,
1080 TermWin_TotalWidth (), 1080 TermWin_TotalWidth (),
1081 TermWin_TotalHeight (), 1081 TermWin_TotalHeight (),
1082 0, 1082 0,
1083 pix_colors_focused[Color_fg], 1083 pix_colors_focused[Color_fg],
1084 pix_colors_focused[Color_bg]); 1084 pix_colors_focused[Color_bg]);
1085#ifdef DEBUG_X 1085#ifdef DEBUG_X
1086 XStoreName (disp, TermWin.vt, "vt window"); 1086 XStoreName (disp, vt, "vt window");
1087#endif 1087#endif
1088 1088
1089 attributes.bit_gravity = NorthWestGravity; 1089 attributes.bit_gravity = NorthWestGravity;
1090 XChangeWindowAttributes (disp, TermWin.vt, CWBitGravity, &attributes); 1090 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes);
1091 1091
1092 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1092 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1093 1093
1094#ifdef POINTER_BLANK 1094#ifdef POINTER_BLANK
1095 if (options & Opt_pointerBlank) 1095 if (options & Opt_pointerBlank)
1096 vt_emask |= PointerMotionMask; 1096 vt_emask |= PointerMotionMask;
1097 else 1097 else
1098#endif 1098#endif
1099 vt_emask |= Button1MotionMask | Button3MotionMask; 1099 vt_emask |= Button1MotionMask | Button3MotionMask;
1100 1100
1101 XSelectInput (disp, TermWin.vt, vt_emask); 1101 XSelectInput (disp, vt, vt_emask);
1102 vt_ev.start (display, TermWin.vt); 1102 vt_ev.start (display, vt);
1103 1103
1104#if defined(MENUBAR) && (MENUBAR_MAX > 1) 1104#if defined(MENUBAR) && (MENUBAR_MAX > 1)
1105 if (menuBar_height ()) 1105 if (menuBar_height ())
1106 { 1106 {
1107 menuBar.win = XCreateSimpleWindow (disp, top, 1107 menuBar.win = XCreateSimpleWindow (disp, top,
1146 1146
1147 /* graphics context for the vt window */ 1147 /* graphics context for the vt window */
1148 gcvalue.foreground = pix_colors[Color_fg]; 1148 gcvalue.foreground = pix_colors[Color_fg];
1149 gcvalue.background = pix_colors[Color_bg]; 1149 gcvalue.background = pix_colors[Color_bg];
1150 gcvalue.graphics_exposures = 1; 1150 gcvalue.graphics_exposures = 1;
1151 TermWin.gc = XCreateGC (disp, TermWin.vt, 1151 gc = XCreateGC (disp, vt,
1152 GCForeground | GCBackground | GCGraphicsExposures, 1152 GCForeground | GCBackground | GCGraphicsExposures,
1153 &gcvalue); 1153 &gcvalue);
1154 1154
1155 TermWin.drawable = new rxvt_drawable (display, TermWin.vt); 1155 drawable = new rxvt_drawable (display, vt);
1156 1156
1157#if defined(MENUBAR) || defined(RXVT_SCROLLBAR) 1157#if defined(MENUBAR) || defined(RXVT_SCROLLBAR)
1158 gcvalue.foreground = pix_colors[Color_topShadow]; 1158 gcvalue.foreground = pix_colors[Color_topShadow];
1159 topShadowGC = XCreateGC (disp, TermWin.vt, GCForeground, &gcvalue); 1159 topShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
1160 gcvalue.foreground = pix_colors[Color_bottomShadow]; 1160 gcvalue.foreground = pix_colors[Color_bottomShadow];
1161 botShadowGC = XCreateGC (disp, TermWin.vt, GCForeground, &gcvalue); 1161 botShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
1162 gcvalue.foreground = pix_colors[ (display->depth <= 2 ? Color_fg : Color_scroll)]; 1162 gcvalue.foreground = pix_colors[ (display->depth <= 2 ? Color_fg : Color_scroll)];
1163 scrollbarGC = XCreateGC (disp, TermWin.vt, GCForeground, &gcvalue); 1163 scrollbarGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
1164#endif 1164#endif
1165 1165
1166#ifdef OFF_FOCUS_FADING 1166#ifdef OFF_FOCUS_FADING
1167 // initially we are in unfocused state 1167 // initially we are in unfocused state
1168 if (rs[Rs_fade]) 1168 if (rs[Rs_fade])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines