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.119 by root, Mon Dec 13 01:29:03 2004 UTC vs.
Revision 1.128 by root, Mon Jan 17 00:59:23 2005 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#include <cstring>
38 39
39#ifdef TTY_GID_SUPPORT 40#ifdef TTY_GID_SUPPORT
40# include <grp.h> 41# include <grp.h>
41#endif 42#endif
42 43
43#ifdef HAVE_TERMIOS_H 44#ifdef HAVE_TERMIOS_H
44# include <termios.h> 45# include <termios.h>
45#endif 46#endif
46 47
47#include <cstring> 48#ifdef KEYSYM_RESOURCE
49# include "keyboard.h"
50#endif
48 51
49vector<rxvt_term *> rxvt_term::termlist; 52vector<rxvt_term *> rxvt_term::termlist;
50 53
51static char curlocale[128]; 54static char curlocale[128];
52 55
168 incr_ev (this, &rxvt_term::incr_cb) 171 incr_ev (this, &rxvt_term::incr_cb)
169{ 172{
170 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; 173 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base;
171 174
172 termlist.push_back (this); 175 termlist.push_back (this);
176
177#ifdef KEYSYM_RESOURCE
178 keyboard = new keyboard_manager;
179
180 if (!keyboard)
181 rxvt_fatal ("out of memory, aborting.\n");
182#endif
173} 183}
174 184
175rxvt_term::~rxvt_term () 185rxvt_term::~rxvt_term ()
176{ 186{
177 termlist.erase (find (termlist.begin (), termlist.end(), this)); 187 termlist.erase (find (termlist.begin (), termlist.end(), this));
259 free (env_windowid); 269 free (env_windowid);
260 free (env_display); 270 free (env_display);
261 free (env_term); 271 free (env_term);
262 free (env_colorfgbg); 272 free (env_colorfgbg);
263 free (locale); 273 free (locale);
274 free (v_buffer);
264 free (incr_buf); 275 free (incr_buf);
265 276
266 delete envv; 277 delete envv;
267 delete argv; 278 delete argv;
279
280#ifdef KEYSYM_RESOURCE
281 delete keyboard;
282#endif
268} 283}
269 284
270void 285void
271rxvt_term::destroy () 286rxvt_term::destroy ()
272{ 287{
330bool 345bool
331rxvt_term::init (int argc, const char *const *argv) 346rxvt_term::init (int argc, const char *const *argv)
332{ 347{
333 SET_R (this); 348 SET_R (this);
334 349
350 set_locale ("");
351
335 if (!init_vars ()) 352 if (!init_vars ())
336 return false; 353 return false;
337 354
338 init_secondary (); 355 init_secondary ();
339 356
340 const char **cmd_argv = init_resources (argc, argv); 357 const char **cmd_argv = init_resources (argc, argv);
341 358
342 set_locale (""); 359#ifdef KEYSYM_RESOURCE
360 keyboard->register_done ();
361#endif
343 362
344#if MENUBAR_MAX 363#if MENUBAR_MAX
345 menubar_read (rs[Rs_menu]); 364 menubar_read (rs[Rs_menu]);
346#endif 365#endif
347#ifdef HAVE_SCROLLBARS 366#ifdef HAVE_SCROLLBARS
380 XMapWindow (display->display, TermWin.parent[0]); 399 XMapWindow (display->display, TermWin.parent[0]);
381 400
382 set_colorfgbg (); 401 set_colorfgbg ();
383 402
384 init_command (cmd_argv); 403 init_command (cmd_argv);
404
405 free (cmd_argv);
385 406
386 pty_ev.start (pty.pty, EVENT_READ); 407 pty_ev.start (pty.pty, EVENT_READ);
387 408
388 check_ev.start (); 409 check_ev.start ();
389 410
781 802
782 delete TermWin.fontset[0]; 803 delete TermWin.fontset[0];
783 TermWin.fontset[0] = fs; 804 TermWin.fontset[0] = fs;
784 805
785 prop = (*fs)[1]->properties (); 806 prop = (*fs)[1]->properties ();
807 prop.height += TermWin.lineSpace;
786 fs->set_prop (prop); 808 fs->set_prop (prop);
787 809
788 TermWin.fwidth = prop.width; 810 TermWin.fwidth = prop.width;
789 TermWin.fheight = prop.height; 811 TermWin.fheight = prop.height;
790 TermWin.fweight = prop.weight; 812 TermWin.fweight = prop.weight;
859void 881void
860rxvt_term::set_title (const char *str) 882rxvt_term::set_title (const char *str)
861{ 883{
862 set_string_property (XA_WM_NAME, str); 884 set_string_property (XA_WM_NAME, str);
863#if ENABLE_FRILLS 885#if ENABLE_FRILLS
864 set_utf8_property (display->atom ("_NET_WM_NAME"), str); 886 set_utf8_property (xa[XA_NET_WM_NAME], str);
865#endif 887#endif
866} 888}
867 889
868void 890void
869rxvt_term::set_icon_name (const char *str) 891rxvt_term::set_icon_name (const char *str)
870{ 892{
871 set_string_property (XA_WM_ICON_NAME, str); 893 set_string_property (XA_WM_ICON_NAME, str);
872#if ENABLE_FRILLS 894#if ENABLE_FRILLS
873 set_utf8_property (display->atom ("_NET_WM_ICON_NAME"), str); 895 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str);
874#endif 896#endif
875} 897}
876 898
877#ifdef XTERM_COLOR_CHANGE 899#ifdef XTERM_COLOR_CHANGE
878void 900void
997 1019
998 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); 1020 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr);
999} 1021}
1000 1022
1001/*----------------------------------------------------------------------*/ 1023/*----------------------------------------------------------------------*/
1002/*
1003 * Colour determination for low colour displays, routine from
1004 * Hans de Goede <hans@highrise.nl>
1005 */
1006 1024
1007int 1025int
1008rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour) 1026rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour)
1009{ 1027{
1010 if (!screen_in_out->set (display, colour)) 1028 if (!screen_in_out->set (display, colour))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines