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.33 by pcg, Fri Feb 13 13:28:17 2004 UTC vs.
Revision 1.39 by pcg, Sat Feb 21 22:14:00 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*;
2 * File: main.c 2 * File: main.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
11 * Copyright (c) 1997 mj olesen <olesen@me.QueensU.CA> 11 * Copyright (c) 1997 mj olesen <olesen@me.QueensU.CA>
12 * - extensive modifications 12 * - extensive modifications
13 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 13 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
14 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 14 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
15 * - extensive modifications 15 * - extensive modifications
16 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com>
16 * 17 *
17 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 19 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or 20 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version. 21 * (at your option) any later version.
90 text_blink_ev (this, &rxvt_term::text_blink_cb), 91 text_blink_ev (this, &rxvt_term::text_blink_cb),
91#endif 92#endif
92#ifdef POINTER_BLANK 93#ifdef POINTER_BLANK
93 pointer_ev (this, &rxvt_term::pointer_cb), 94 pointer_ev (this, &rxvt_term::pointer_cb),
94#endif 95#endif
96#ifdef USE_XIM
97 im_ev (this, &rxvt_term::im_cb),
98#endif
95 check_ev (this, &rxvt_term::check_cb), 99 check_ev (this, &rxvt_term::check_cb),
96 destroy_ev (this, &rxvt_term::destroy_cb), 100 destroy_ev (this, &rxvt_term::destroy_cb),
97 pty_ev (this, &rxvt_term::pty_cb), 101 pty_ev (this, &rxvt_term::pty_cb),
98 incr_ev (this, &rxvt_term::incr_cb), 102 incr_ev (this, &rxvt_term::incr_cb)
99#ifdef USE_XIM
100 im_ev (this, &rxvt_term::im_cb)
101#endif
102{ 103{
103 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; 104 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base;
104} 105}
105 106
106rxvt_term::~rxvt_term () 107rxvt_term::~rxvt_term ()
107{ 108{
108 if (cmd_fd >= 0) 109 if (cmd_fd >= 0)
109 close (cmd_fd); 110 close (cmd_fd);
111
112#ifndef NO_SETOWNER_TTYDEV
113 privileged_ttydev (RESTORE);
114#endif
115#ifdef UTMP_SUPPORT
116 privileged_utmp (RESTORE);
117#endif
118
119 delete TermWin.fontset;
120
121 if (display)
122 if (TermWin.parent[0])
123 XDestroyWindow (display->display, TermWin.parent[0]);
124
125 // TODO: free pixcolours, colours should become part of rxvt_display
126
127 delete PixColors;
128
129 displays.put (display);
110 130
111 scr_release (); 131 scr_release ();
112 132
113 free (env_windowid); 133 free (env_windowid);
114 free (env_display); 134 free (env_display);
115 free (env_term); 135 free (env_term);
116 free (env_colorfgbg); 136 free (env_colorfgbg);
117 free (locale); 137 free (locale);
118 free (codeset); 138 free (codeset);
119 139
120#ifndef NO_SETOWNER_TTYDEV
121 privileged_ttydev (RESTORE);
122#endif
123#ifdef UTMP_SUPPORT
124 privileged_utmp (RESTORE);
125#endif
126
127 // TODO: free pixcolours, colours should become part of rxvt_display
128
129 delete PixColors;
130 delete TermWin.fontset;
131
132 displays.put (display);
133
134 delete envv; 140 delete envv;
135 delete argv; 141 delete argv;
136} 142}
137 143
138void 144void
139rxvt_term::destroy () 145rxvt_term::destroy ()
140{ 146{
141 if (display) 147 if (display)
142 { 148 {
143 if (TermWin.parent[0])
144 XDestroyWindow (display->display, TermWin.parent[0]);
145
146 rootwin_ev.stop (display); 149 rootwin_ev.stop (display);
147 termwin_ev.stop (display); 150 termwin_ev.stop (display);
148 vt_ev.stop (display); 151 vt_ev.stop (display);
149
150#ifdef USE_XIM 152#ifdef USE_XIM
151 im_destroy (); 153 im_destroy ();
152 im_ev.stop (display); 154 im_ev.stop (display);
153#endif 155#endif
154#ifdef HAVE_SCROLLBARS 156#ifdef HAVE_SCROLLBARS
265#ifdef RXVT_GRAPHICS 267#ifdef RXVT_GRAPHICS
266 Gr_reset (); /* reset graphics */ 268 Gr_reset (); /* reset graphics */
267#endif 269#endif
268 270
269#if 0 271#if 0
270#ifdef DEBUG_X
271 XSynchronize (display->display, True); 272 XSynchronize (display->display, True);
272#endif
273#endif 273#endif
274 274
275#ifdef HAVE_SCROLLBARS 275#ifdef HAVE_SCROLLBARS
276 if (Options & Opt_scrollBar) 276 if (Options & Opt_scrollBar)
277 resize_scrollbar (); /* create and map scrollbar */ 277 resize_scrollbar (); /* create and map scrollbar */
1315 if (Input_Context) 1315 if (Input_Context)
1316 return; 1316 return;
1317 1317
1318#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1318#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1319 if (rs[Rs_imLocale]) 1319 if (rs[Rs_imLocale])
1320 setlocale (LC_CTYPE, rs[Rs_imLocale]); 1320 SET_LOCALE (rs[Rs_imLocale]);
1321#endif 1321#endif
1322 1322
1323 p = rs[Rs_inputMethod]; 1323 p = rs[Rs_inputMethod];
1324 if (p && *p) 1324 if (p && *p)
1325 { 1325 {
1356 goto done; 1356 goto done;
1357 1357
1358done: 1358done:
1359#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1359#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1360 if (rs[Rs_imLocale]) 1360 if (rs[Rs_imLocale])
1361 setlocale (LC_CTYPE, locale); 1361 SET_LOCALE (locale);
1362#endif 1362#endif
1363} 1363}
1364 1364
1365void 1365void
1366rxvt_term::IMSetStatusPosition () 1366rxvt_term::IMSetStatusPosition ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines