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

118 118
119 delete TermWin.fontset; 119 delete TermWin.fontset;
120 120
121 if (display) 121 if (display)
122 { 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
123 if (TermWin.parent[0]) 130 if (TermWin.parent[0])
124 XDestroyWindow (display->display, TermWin.parent[0]); 131 XDestroyWindow (display->display, TermWin.parent[0]);
125#if defined(MENUBAR) && (MENUBAR_MAX > 1)
126 if (menuBar.win)
127 XDestroyWindow (display->display, menuBar.win);
128 delete menuBar.drawable;
129#endif
130 } 132 }
131 133
132 // TODO: free pixcolours, colours should become part of rxvt_display 134 // TODO: free pixcolours, colours should become part of rxvt_display
133 135
134 delete PixColors; 136 delete PixColors;
383 385
384 p = malloc (size); 386 p = malloc (size);
385 if (p) 387 if (p)
386 return p; 388 return p;
387 389
388 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 390 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
389 rxvt_clean_exit (); 391 rxvt_clean_exit ();
390 exit (EXIT_FAILURE); 392 exit (EXIT_FAILURE);
391 /* NOTREACHED */ 393 /* NOTREACHED */
392} 394}
393 395
399 401
400 p = calloc (number, size); 402 p = calloc (number, size);
401 if (p) 403 if (p)
402 return p; 404 return p;
403 405
404 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 406 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
405 rxvt_clean_exit (); 407 rxvt_clean_exit ();
406 exit (EXIT_FAILURE); 408 exit (EXIT_FAILURE);
407 /* NOTREACHED */ 409 /* NOTREACHED */
408} 410}
409 411
418 else 420 else
419 p = malloc (size); 421 p = malloc (size);
420 if (p) 422 if (p)
421 return p; 423 return p;
422 424
423 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting"); 425 fprintf (stderr, RESNAME ": memory allocation failure. Aborting");
424 rxvt_clean_exit (); 426 rxvt_clean_exit ();
425 exit (EXIT_FAILURE); 427 exit (EXIT_FAILURE);
426 /* NOTREACHED */ 428 /* NOTREACHED */
427} 429}
428 430
737 } 739 }
738 else 740 else
739 { 741 {
740 rxvt_fontset *fs = new rxvt_fontset (this); 742 rxvt_fontset *fs = new rxvt_fontset (this);
741 743
742 if (fs && fs->populate (fontname)) 744 if (fs && fs->populate (fontname ? fontname : "fixed"))
743 { 745 {
744 delete TermWin.fontset; 746 delete TermWin.fontset;
745 TermWin.fontset = fs; 747 TermWin.fontset = fs;
746 TermWin.fwidth = fs->base_font ()->width; 748 TermWin.fwidth = fs->base_font ()->width;
747 TermWin.fheight = fs->base_font ()->height; 749 TermWin.fheight = fs->base_font ()->height;
748 TermWin.fbase = fs->base_font ()->ascent; 750 TermWin.fbase = fs->base_font ()->ascent;
749 751
750 // TODO: screen needs to be told about new fonts
751
752 if (TermWin.parent[0]) 752 if (TermWin.parent[0])
753 { 753 {
754 resize_all_windows (0, 0, 0); 754 resize_all_windows (0, 0, 0);
755 scr_remap_chars (); 755 scr_remap_chars ();
756 scr_touch (true); 756 scr_touch (true);
776rxvt_term::set_title (const char *str) 776rxvt_term::set_title (const char *str)
777{ 777{
778#ifndef SMART_WINDOW_TITLE 778#ifndef SMART_WINDOW_TITLE
779 XStoreName (display->display, TermWin.parent[0], str); 779 XStoreName (display->display, TermWin.parent[0], str);
780#else 780#else
781 char *name; 781 char *name;
782 782
783 if (XFetchName (display->display, TermWin.parent[0], &name) == 0) 783 if (XFetchName (display->display, TermWin.parent[0], &name) == 0)
784 name = NULL; 784 name = NULL;
785 if (name == NULL || STRCMP (name, str)) 785 if (name == NULL || STRCMP (name, str))
786 XStoreName (display->display, TermWin.parent[0], str); 786 XStoreName (display->display, TermWin.parent[0], str);
793rxvt_term::set_iconName (const char *str) 793rxvt_term::set_iconName (const char *str)
794{ 794{
795#ifndef SMART_WINDOW_TITLE 795#ifndef SMART_WINDOW_TITLE
796 XSetIconName (display->display, TermWin.parent[0], str); 796 XSetIconName (display->display, TermWin.parent[0], str);
797#else 797#else
798 char *name; 798 char *name;
799 799
800 if (XGetIconName (display->display, TermWin.parent[0], &name)) 800 if (XGetIconName (display->display, TermWin.parent[0], &name))
801 name = NULL; 801 name = NULL;
802 if (name == NULL || STRCMP (name, str)) 802 if (name == NULL || STRCMP (name, str))
803 XSetIconName (display->display, TermWin.parent[0], str); 803 XSetIconName (display->display, TermWin.parent[0], str);
808 808
809#ifdef XTERM_COLOR_CHANGE 809#ifdef XTERM_COLOR_CHANGE
810void 810void
811rxvt_term::set_window_color (int idx, const char *color) 811rxvt_term::set_window_color (int idx, const char *color)
812{ 812{
813 rxvt_color xcol; 813 rxvt_color xcol;
814 int i; 814 int i;
815 815
816 if (color == NULL || *color == '\0') 816 if (color == NULL || *color == '\0')
817 return; 817 return;
818 818
819 /* handle color aliases */ 819 /* handle color aliases */
1036 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); 1036 0, TermWin_TotalWidth (), menuBar_TotalHeight ());
1037 1037
1038 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, 1038 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x,
1039 window_vt_y, TermWin_TotalWidth (), 1039 window_vt_y, TermWin_TotalWidth (),
1040 TermWin_TotalHeight ()); 1040 TermWin_TotalHeight ());
1041 scr_clear (); 1041 scr_clear (height != old_height);
1042#ifdef XPM_BACKGROUND 1042#ifdef XPM_BACKGROUND
1043 resize_pixmap (); 1043 resize_pixmap ();
1044#endif 1044#endif
1045 1045
1046 } 1046 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines