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.43 by pcg, Tue Feb 24 00:02:44 2004 UTC vs.
Revision 1.48 by pcg, Wed Mar 3 04:07:52 2004 UTC

117#endif 117#endif
118 118
119 delete TermWin.fontset; 119 delete TermWin.fontset;
120 120
121 if (display) 121 if (display)
122 {
123#if defined(MENUBAR) && (MENUBAR_MAX > 1)
124 delete menuBar.drawable;
125 //if (menuBar.win)
126 // XDestroyWindow (display->display, menuBar.win);
127#endif
128 delete TermWin.drawable;
129 // destroy all windows
122 if (TermWin.parent[0]) 130 if (TermWin.parent[0])
123 XDestroyWindow (display->display, TermWin.parent[0]); 131 XDestroyWindow (display->display, TermWin.parent[0]);
132 }
124 133
125 // TODO: free pixcolours, colours should become part of rxvt_display 134 // TODO: free pixcolours, colours should become part of rxvt_display
126 135
127 delete PixColors; 136 delete PixColors;
128 137
249 258
250 const char **cmd_argv = init_resources (argc, argv); 259 const char **cmd_argv = init_resources (argc, argv);
251 260
252 set_locale (""); 261 set_locale ("");
253 262
254#if (MENUBAR_MAX) 263#if MENUBAR_MAX
255 menubar_read (rs[Rs_menu]); 264 menubar_read (rs[Rs_menu]);
256#endif 265#endif
257#ifdef HAVE_SCROLLBARS 266#ifdef HAVE_SCROLLBARS
258 if (Options & Opt_scrollBar) 267 if (Options & Opt_scrollBar)
259 scrollBar.setIdle (); /* set existence for size calculations */ 268 scrollBar.setIdle (); /* set existence for size calculations */
376 385
377 p = malloc (size); 386 p = malloc (size);
378 if (p) 387 if (p)
379 return p; 388 return p;
380 389
381 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 390 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
382 rxvt_clean_exit (); 391 rxvt_clean_exit ();
383 exit (EXIT_FAILURE); 392 exit (EXIT_FAILURE);
384 /* NOTREACHED */ 393 /* NOTREACHED */
385} 394}
386 395
392 401
393 p = calloc (number, size); 402 p = calloc (number, size);
394 if (p) 403 if (p)
395 return p; 404 return p;
396 405
397 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 406 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
398 rxvt_clean_exit (); 407 rxvt_clean_exit ();
399 exit (EXIT_FAILURE); 408 exit (EXIT_FAILURE);
400 /* NOTREACHED */ 409 /* NOTREACHED */
401} 410}
402 411
411 else 420 else
412 p = malloc (size); 421 p = malloc (size);
413 if (p) 422 if (p)
414 return p; 423 return p;
415 424
416 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 425 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
417 rxvt_clean_exit (); 426 rxvt_clean_exit ();
418 exit (EXIT_FAILURE); 427 exit (EXIT_FAILURE);
419 /* NOTREACHED */ 428 /* NOTREACHED */
420} 429}
421 430
730 } 739 }
731 else 740 else
732 { 741 {
733 rxvt_fontset *fs = new rxvt_fontset (this); 742 rxvt_fontset *fs = new rxvt_fontset (this);
734 743
735 if (fs && fs->populate (fontname)) 744 if (fs && fs->populate (fontname ? fontname : "fixed"))
736 { 745 {
737 delete TermWin.fontset; 746 delete TermWin.fontset;
738 TermWin.fontset = fs; 747 TermWin.fontset = fs;
739 TermWin.fwidth = fs->base_font ()->width; 748 TermWin.fwidth = fs->base_font ()->width;
740 TermWin.fheight = fs->base_font ()->height; 749 TermWin.fheight = fs->base_font ()->height;
741 TermWin.fbase = fs->base_font ()->ascent; 750 TermWin.fbase = fs->base_font ()->ascent;
742 751
743 // TODO: screen needs to be told about new fonts
744
745 if (TermWin.parent[0]) 752 if (TermWin.parent[0])
746 { 753 {
747 resize_all_windows (0, 0, 0); 754 resize_all_windows (0, 0, 0);
748 scr_remap_chars (); 755 scr_remap_chars ();
749 scr_touch (true); 756 scr_touch (true);
769rxvt_term::set_title (const char *str) 776rxvt_term::set_title (const char *str)
770{ 777{
771#ifndef SMART_WINDOW_TITLE 778#ifndef SMART_WINDOW_TITLE
772 XStoreName (display->display, TermWin.parent[0], str); 779 XStoreName (display->display, TermWin.parent[0], str);
773#else 780#else
774 char *name; 781 char *name;
775 782
776 if (XFetchName (display->display, TermWin.parent[0], &name) == 0) 783 if (XFetchName (display->display, TermWin.parent[0], &name) == 0)
777 name = NULL; 784 name = NULL;
778 if (name == NULL || STRCMP (name, str)) 785 if (name == NULL || STRCMP (name, str))
779 XStoreName (display->display, TermWin.parent[0], str); 786 XStoreName (display->display, TermWin.parent[0], str);
786rxvt_term::set_iconName (const char *str) 793rxvt_term::set_iconName (const char *str)
787{ 794{
788#ifndef SMART_WINDOW_TITLE 795#ifndef SMART_WINDOW_TITLE
789 XSetIconName (display->display, TermWin.parent[0], str); 796 XSetIconName (display->display, TermWin.parent[0], str);
790#else 797#else
791 char *name; 798 char *name;
792 799
793 if (XGetIconName (display->display, TermWin.parent[0], &name)) 800 if (XGetIconName (display->display, TermWin.parent[0], &name))
794 name = NULL; 801 name = NULL;
795 if (name == NULL || STRCMP (name, str)) 802 if (name == NULL || STRCMP (name, str))
796 XSetIconName (display->display, TermWin.parent[0], str); 803 XSetIconName (display->display, TermWin.parent[0], str);
801 808
802#ifdef XTERM_COLOR_CHANGE 809#ifdef XTERM_COLOR_CHANGE
803void 810void
804rxvt_term::set_window_color (int idx, const char *color) 811rxvt_term::set_window_color (int idx, const char *color)
805{ 812{
806 rxvt_color xcol; 813 rxvt_color xcol;
807 int i; 814 int i;
808 815
809 if (color == NULL || *color == '\0') 816 if (color == NULL || *color == '\0')
810 return; 817 return;
811 818
812 /* handle color aliases */ 819 /* handle color aliases */
1029 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); 1036 0, TermWin_TotalWidth (), menuBar_TotalHeight ());
1030 1037
1031 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, 1038 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x,
1032 window_vt_y, TermWin_TotalWidth (), 1039 window_vt_y, TermWin_TotalWidth (),
1033 TermWin_TotalHeight ()); 1040 TermWin_TotalHeight ());
1034 scr_clear (); 1041 scr_clear (height != old_height);
1035#ifdef XPM_BACKGROUND 1042#ifdef XPM_BACKGROUND
1036 resize_pixmap (); 1043 resize_pixmap ();
1037#endif 1044#endif
1038 1045
1039 } 1046 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines