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.135 by root, Sun Feb 13 11:07:57 2005 UTC vs.
Revision 1.145 by root, Thu Aug 11 02:05:07 2005 UTC

30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 *---------------------------------------------------------------------*/ 31 *---------------------------------------------------------------------*/
32 32
33#include "../config.h" /* NECESSARY */ 33#include "../config.h" /* NECESSARY */
34#include "rxvt.h" /* NECESSARY */ 34#include "rxvt.h" /* NECESSARY */
35#include "main.intpro" /* PROTOS for internal routines */
36 35
37#include <csignal> 36#include <csignal>
38#include <cstring> 37#include <cstring>
39 38
40#ifdef TTY_GID_SUPPORT 39#ifdef TTY_GID_SUPPORT
260 } 259 }
261 260
262 // TODO: free pixcolours, colours should become part of rxvt_display 261 // TODO: free pixcolours, colours should become part of rxvt_display
263 262
264 delete pix_colors_focused; 263 delete pix_colors_focused;
265#ifdef OFF_FOCUS_FADING 264#if OFF_FOCUS_FADING
266 delete pix_colors_unfocused; 265 delete pix_colors_unfocused;
267#endif 266#endif
268 267
269 displays.put (display); 268 displays.put (display);
270 269
586 rxvt_fatal ("memory allocation failure. aborting.\n"); 585 rxvt_fatal ("memory allocation failure. aborting.\n");
587 586
588 return p; 587 return p;
589} 588}
590 589
591/* INTPROTO */
592void * 590void *
593rxvt_calloc (size_t number, size_t size) 591rxvt_calloc (size_t number, size_t size)
594{ 592{
595 void *p = calloc (number, size); 593 void *p = calloc (number, size);
596 594
598 rxvt_fatal ("memory allocation failure. aborting.\n"); 596 rxvt_fatal ("memory allocation failure. aborting.\n");
599 597
600 return p; 598 return p;
601} 599}
602 600
603/* INTPROTO */
604void * 601void *
605rxvt_realloc (void *ptr, size_t size) 602rxvt_realloc (void *ptr, size_t size)
606{ 603{
607 void *p = realloc (ptr, size); 604 void *p = realloc (ptr, size);
608 605
712 if (!parsed_geometry) 709 if (!parsed_geometry)
713 { 710 {
714 parsed_geometry = 1; 711 parsed_geometry = 1;
715 if (rs[Rs_geometry]) 712 if (rs[Rs_geometry])
716 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); 713 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h);
714
717 if (flags & WidthValue) 715 if (flags & WidthValue)
718 { 716 {
719 TermWin.ncol = BOUND_POSITIVE_INT16 (w); 717 TermWin.ncol = BOUND_POSITIVE_INT16 (w);
720 szHint.flags |= USSize; 718 szHint.flags |= USSize;
721 } 719 }
720
722 if (flags & HeightValue) 721 if (flags & HeightValue)
723 { 722 {
724 TermWin.nrow = BOUND_POSITIVE_INT16 (h); 723 TermWin.nrow = BOUND_POSITIVE_INT16 (h);
725 szHint.flags |= USSize; 724 szHint.flags |= USSize;
726 } 725 }
726
727 if (flags & XValue) 727 if (flags & XValue)
728 { 728 {
729 szHint.x = x; 729 szHint.x = x;
730 szHint.flags |= USPosition; 730 szHint.flags |= USPosition;
731 if (flags & XNegative) 731 if (flags & XNegative)
732 { 732 {
733 recalc_x = 1; 733 recalc_x = 1;
734 szHint.win_gravity = NorthEastGravity; 734 szHint.win_gravity = NorthEastGravity;
735 } 735 }
736 } 736 }
737
737 if (flags & YValue) 738 if (flags & YValue)
738 { 739 {
739 szHint.y = y; 740 szHint.y = y;
740 szHint.flags |= USPosition; 741 szHint.flags |= USPosition;
741 if (flags & YNegative) 742 if (flags & YNegative)
840 (void)ioctl (pty.pty, TIOCSWINSZ, &ws); 841 (void)ioctl (pty.pty, TIOCSWINSZ, &ws);
841 842
842#if 0 843#if 0
843 // TIOCSWINSZ⎈ is supposed to do this automatically and correctly 844 // TIOCSWINSZ⎈ is supposed to do this automatically and correctly
844 if (cmd_pid) /* force through to the command */ 845 if (cmd_pid) /* force through to the command */
845 kill (cmd_pid, SIGWINCH); 846 kill (-cmd_pid, SIGWINCH);
846#endif 847#endif
847} 848}
848 849
849/*----------------------------------------------------------------------*/ 850/*----------------------------------------------------------------------*/
850/* set_fonts () - load and set the various fonts 851/* set_fonts () - load and set the various fonts
954/* xterm sequences - title, iconName, color (exptl) */ 955/* xterm sequences - title, iconName, color (exptl) */
955void 956void
956rxvt_term::set_title (const char *str) 957rxvt_term::set_title (const char *str)
957{ 958{
958 set_string_property (XA_WM_NAME, str); 959 set_string_property (XA_WM_NAME, str);
959#if ENABLE_FRILLS 960#if ENABLE_EWMH
960 set_utf8_property (xa[XA_NET_WM_NAME], str); 961 set_utf8_property (xa[XA_NET_WM_NAME], str);
961#endif 962#endif
962} 963}
963 964
964void 965void
965rxvt_term::set_icon_name (const char *str) 966rxvt_term::set_icon_name (const char *str)
966{ 967{
967 set_string_property (XA_WM_ICON_NAME, str); 968 set_string_property (XA_WM_ICON_NAME, str);
968#if ENABLE_FRILLS 969#if ENABLE_EWMH
969 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); 970 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str);
970#endif 971#endif
971} 972}
972 973
973#ifdef XTERM_COLOR_CHANGE 974#ifdef XTERM_COLOR_CHANGE
989 { /* bright colors */ 990 { /* bright colors */
990 i -= 8; 991 i -= 8;
991# ifndef NO_BRIGHTCOLOR 992# ifndef NO_BRIGHTCOLOR
992 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; 993 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i];
993 SET_PIXCOLOR (idx); 994 SET_PIXCOLOR (idx);
994 goto Done; 995 goto done;
995# endif 996# endif
996 } 997 }
997 998
998 if (i >= 0 && i <= 7) 999 if (i >= 0 && i <= 7)
999 { /* normal colors */ 1000 { /* normal colors */
1000 pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; 1001 pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i];
1001 SET_PIXCOLOR (idx); 1002 SET_PIXCOLOR (idx);
1002 goto Done; 1003 goto done;
1003 } 1004 }
1004 } 1005 }
1005 1006
1006 if (!rXParseAllocColor (&xcol, color)) 1007 if (!rXParseAllocColor (&xcol, color))
1007 return; 1008 return;
1027 pix_colors_focused[idx] = xcol; 1028 pix_colors_focused[idx] = xcol;
1028 SET_PIXCOLOR (idx); 1029 SET_PIXCOLOR (idx);
1029 1030
1030 /* XSetWindowAttributes attr; */ 1031 /* XSetWindowAttributes attr; */
1031 /* Cursor cursor; */ 1032 /* Cursor cursor; */
1032Done: 1033done:
1034
1033#ifdef OFF_FOCUS_FADING 1035#if OFF_FOCUS_FADING
1034 if (rs[Rs_fade]) 1036 if (rs[Rs_fade])
1035 pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (display, atoi (rs[Rs_fade])); 1037 pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (display, atoi (rs[Rs_fade]), pix_colors[Color_fade]);
1036#endif 1038#endif
1037 1039
1038 /*TODO: handle Color_BD, scrollbar background, etc. */ 1040 /*TODO: handle Color_BD, scrollbar background, etc. */
1039 1041
1040 recolour_cursor (); 1042 recolour_cursor ();
1245 XWindowAttributes wattr; 1247 XWindowAttributes wattr;
1246 1248
1247 if (width == 0 || height == 0) 1249 if (width == 0 || height == 0)
1248 { 1250 {
1249 XGetWindowAttributes (display->display, display->root, &wattr); 1251 XGetWindowAttributes (display->display, display->root, &wattr);
1252
1250 if (width == 0) 1253 if (width == 0)
1251 width = wattr.width - szHint.base_width; 1254 width = wattr.width - szHint.base_width;
1252 if (height == 0) 1255 if (height == 0)
1253 height = wattr.height - szHint.base_height; 1256 height = wattr.height - szHint.base_height;
1254 } 1257 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines