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.116 by root, Sun Nov 21 19:04:07 2004 UTC vs.
Revision 1.123 by root, Mon Dec 20 16:44:31 2004 UTC

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 */ 35#include "main.intpro" /* PROTOS for internal routines */
36 36
37#include <signal.h> 37#include <csignal>
38 38
39#ifdef TTY_GID_SUPPORT 39#ifdef TTY_GID_SUPPORT
40# include <grp.h> 40# include <grp.h>
41#endif 41#endif
42 42
259 free (env_windowid); 259 free (env_windowid);
260 free (env_display); 260 free (env_display);
261 free (env_term); 261 free (env_term);
262 free (env_colorfgbg); 262 free (env_colorfgbg);
263 free (locale); 263 free (locale);
264#if 0 264 free (v_buffer);
265 free (codeset); 265 free (incr_buf);
266#endif
267 266
268 delete envv; 267 delete envv;
269 delete argv; 268 delete argv;
270} 269}
271 270
355 354
356 init_xlocale (); 355 init_xlocale ();
357 356
358 scr_reset (); /* initialize screen */ 357 scr_reset (); /* initialize screen */
359 358
360#if 1 359#if 0
361 XSynchronize (display->display, True); 360 XSynchronize (display->display, True);
362#endif 361#endif
363 362
364#ifdef HAVE_SCROLLBARS 363#ifdef HAVE_SCROLLBARS
365 if (options & Opt_scrollBar) 364 if (options & Opt_scrollBar)
831 } 830 }
832 831
833 return true; 832 return true;
834} 833}
835 834
835void rxvt_term::set_string_property (Atom prop, const char *str, int len)
836{
837 // TODO: SMART_WINDOW_TITLE
838 XChangeProperty (display->display, TermWin.parent[0],
839 prop, XA_STRING, 8, PropModeReplace,
840 (const unsigned char *)str, len >= 0 ? len : strlen (str));
841}
842
843void rxvt_term::set_utf8_property (Atom prop, const char *str, int len)
844{
845 // TODO: SMART_WINDOW_TITLE
846 wchar_t *ws = rxvt_mbstowcs (str, len);
847 char *s = rxvt_wcstoutf8 (ws);
848
849 XChangeProperty (display->display, TermWin.parent[0],
850 prop, xa[XA_UTF8_STRING], 8, PropModeReplace,
851 (const unsigned char *)s, strlen (s));
852
853 free (s);
854 free (ws);
855}
856
836/*----------------------------------------------------------------------*/ 857/*----------------------------------------------------------------------*/
837/*----------------------------------------------------------------------*/ 858/*----------------------------------------------------------------------*/
838/* xterm sequences - title, iconName, color (exptl) */ 859/* xterm sequences - title, iconName, color (exptl) */
839void 860void
840rxvt_term::set_title (const char *str) 861rxvt_term::set_title (const char *str)
841{ 862{
842#ifdef SMART_WINDOW_TITLE 863 set_string_property (XA_WM_NAME, str);
843 char *name; 864#if ENABLE_FRILLS
844 865 set_utf8_property (xa[XA_NET_WM_NAME], str);
845 if (!XFetchName (display->display, TermWin.parent[0], &name))
846 name = NULL;
847
848 if (name == NULL || strcmp (name, str))
849#endif
850 XStoreName (display->display, TermWin.parent[0], str);
851
852#ifdef SMART_WINDOW_TITLE
853 if (name)
854 XFree (name);
855#endif 866#endif
856} 867}
857 868
858void 869void
859rxvt_term::set_icon_name (const char *str) 870rxvt_term::set_icon_name (const char *str)
860{ 871{
861#ifdef SMART_WINDOW_TITLE 872 set_string_property (XA_WM_ICON_NAME, str);
862 char *name; 873#if ENABLE_FRILLS
863 874 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str);
864 if (!XGetIconName (display->display, TermWin.parent[0], &name))
865 name = NULL;
866
867 if (name == NULL || strcmp (name, str))
868#endif
869 XSetIconName (display->display, TermWin.parent[0], str);
870
871#ifdef SMART_WINDOW_TITLE
872 if (name)
873 XFree (name);
874#endif 875#endif
875} 876}
876 877
877#ifdef XTERM_COLOR_CHANGE 878#ifdef XTERM_COLOR_CHANGE
878void 879void
997 998
998 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); 999 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr);
999} 1000}
1000 1001
1001/*----------------------------------------------------------------------*/ 1002/*----------------------------------------------------------------------*/
1002/*
1003 * Colour determination for low colour displays, routine from
1004 * Hans de Goede <hans@highrise.nl>
1005 */
1006 1003
1007int 1004int
1008rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour) 1005rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour)
1009{ 1006{
1010 if (!screen_in_out->set (display, colour)) 1007 if (!screen_in_out->set (display, colour))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines