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.36 by pcg, Sat Feb 21 20:33:40 2004 UTC vs.
Revision 1.44 by pcg, Tue Feb 24 16:25:44 2004 UTC

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.
79 vt_ev (this, &rxvt_term::x_cb), 80 vt_ev (this, &rxvt_term::x_cb),
80#ifdef HAVE_SCROLLBARS 81#ifdef HAVE_SCROLLBARS
81 scrollbar_ev (this, &rxvt_term::x_cb), 82 scrollbar_ev (this, &rxvt_term::x_cb),
82#endif 83#endif
83#ifdef MENUBAR 84#ifdef MENUBAR
84 menubar_ev (this, &rxvt_term::x_cb), fixme 85 menubar_ev (this, &rxvt_term::x_cb),
85#endif 86#endif
86#ifdef CURSOR_BLINK 87#ifdef CURSOR_BLINK
87 cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), 88 cursor_blink_ev (this, &rxvt_term::cursor_blink_cb),
88#endif 89#endif
89#ifdef TEXT_BLINK 90#ifdef TEXT_BLINK
116#endif 117#endif
117 118
118 delete TermWin.fontset; 119 delete TermWin.fontset;
119 120
120 if (display) 121 if (display)
122 {
121 if (TermWin.parent[0]) 123 if (TermWin.parent[0])
122 XDestroyWindow (display->display, TermWin.parent[0]); 124 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 }
123 131
124 // TODO: free pixcolours, colours should become part of rxvt_display 132 // TODO: free pixcolours, colours should become part of rxvt_display
125 133
126 delete PixColors; 134 delete PixColors;
127 135
248 256
249 const char **cmd_argv = init_resources (argc, argv); 257 const char **cmd_argv = init_resources (argc, argv);
250 258
251 set_locale (""); 259 set_locale ("");
252 260
253#if (MENUBAR_MAX) 261#if MENUBAR_MAX
254 menubar_read (rs[Rs_menu]); 262 menubar_read (rs[Rs_menu]);
255#endif 263#endif
256#ifdef HAVE_SCROLLBARS 264#ifdef HAVE_SCROLLBARS
257 if (Options & Opt_scrollBar) 265 if (Options & Opt_scrollBar)
258 scrollBar.setIdle (); /* set existence for size calculations */ 266 scrollBar.setIdle (); /* set existence for size calculations */
261 create_windows (argc, argv); 269 create_windows (argc, argv);
262 270
263 init_xlocale (); 271 init_xlocale ();
264 272
265 scr_reset (); /* initialize screen */ 273 scr_reset (); /* initialize screen */
266#ifdef RXVT_GRAPHICS
267 Gr_reset (); /* reset graphics */
268#endif
269 274
270#if 1 275#if 0
271 XSynchronize (display->display, True); 276 XSynchronize (display->display, True);
272#endif 277#endif
273 278
274#ifdef HAVE_SCROLLBARS 279#ifdef HAVE_SCROLLBARS
275 if (Options & Opt_scrollBar) 280 if (Options & Opt_scrollBar)
276 resize_scrollbar (); /* create and map scrollbar */ 281 resize_scrollbar (); /* create and map scrollbar */
277#endif 282#endif
278#if (MENUBAR_MAX) 283#if (MENUBAR_MAX)
279 if (menubar_visible (r)) 284 if (menubar_visible ())
280 XMapWindow (display->display, menuBar.win); 285 XMapWindow (display->display, menuBar.win);
281#endif 286#endif
282#ifdef TRANSPARENT 287#ifdef TRANSPARENT
283 if (Options & Opt_transparent) 288 if (Options & Opt_transparent)
284 { 289 {
717 * init = 1 - initialize 722 * init = 1 - initialize
718 * 723 *
719 * fontname == FONT_UP - switch to bigger font 724 * fontname == FONT_UP - switch to bigger font
720 * fontname == FONT_DN - switch to smaller font 725 * fontname == FONT_DN - switch to smaller font
721 */ 726 */
722void 727bool
723rxvt_term::change_font (int init, const char *fontname) 728rxvt_term::change_font (const char *fontname)
724{} 729{
730 if (fontname == FONT_UP)
731 {
732 // TODO
733 }
734 else if (fontname == FONT_DN)
735 {
736 // TODO
737 }
738 else
739 {
740 rxvt_fontset *fs = new rxvt_fontset (this);
725 741
726void 742 if (fs && fs->populate (fontname))
743 {
744 delete TermWin.fontset;
745 TermWin.fontset = fs;
746 TermWin.fwidth = fs->base_font ()->width;
747 TermWin.fheight = fs->base_font ()->height;
748 TermWin.fbase = fs->base_font ()->ascent;
749
750 // TODO: screen needs to be told about new fonts
751
752 if (TermWin.parent[0])
753 {
754 resize_all_windows (0, 0, 0);
755 scr_remap_chars ();
756 scr_touch (true);
757 }
758
759 return true;
760 }
761 }
762
763 return false;
764}
765
766bool
727rxvt_term::font_up_down (int n, int direction) 767rxvt_term::font_up_down (int n, int direction)
728{} 768{
769 return false;
770}
729 771
730/*----------------------------------------------------------------------*/ 772/*----------------------------------------------------------------------*/
731/*----------------------------------------------------------------------*/ 773/*----------------------------------------------------------------------*/
732/* xterm sequences - title, iconName, color (exptl) */ 774/* xterm sequences - title, iconName, color (exptl) */
733void 775void
994 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); 1036 0, TermWin_TotalWidth (), menuBar_TotalHeight ());
995 1037
996 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, 1038 XMoveResizeWindow (display->display, TermWin.vt, window_vt_x,
997 window_vt_y, TermWin_TotalWidth (), 1039 window_vt_y, TermWin_TotalWidth (),
998 TermWin_TotalHeight ()); 1040 TermWin_TotalHeight ());
999#ifdef RXVT_GRAPHICS
1000 if (old_height)
1001 Gr_Resize (old_width - szHint.base_width,
1002 old_height - szHint.base_height);
1003#endif
1004 scr_clear (); 1041 scr_clear ();
1005#ifdef XPM_BACKGROUND 1042#ifdef XPM_BACKGROUND
1006 resize_pixmap (); 1043 resize_pixmap ();
1007#endif 1044#endif
1008 1045
1314 if (Input_Context) 1351 if (Input_Context)
1315 return; 1352 return;
1316 1353
1317#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1354#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1318 if (rs[Rs_imLocale]) 1355 if (rs[Rs_imLocale])
1319 rxvt_set_locale (rs[Rs_imLocale]); 1356 SET_LOCALE (rs[Rs_imLocale]);
1320#endif 1357#endif
1321 1358
1322 p = rs[Rs_inputMethod]; 1359 p = rs[Rs_inputMethod];
1323 if (p && *p) 1360 if (p && *p)
1324 { 1361 {
1355 goto done; 1392 goto done;
1356 1393
1357done: 1394done:
1358#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1395#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1359 if (rs[Rs_imLocale]) 1396 if (rs[Rs_imLocale])
1360 rxvt_set_locale (locale); 1397 SET_LOCALE (locale);
1361#endif 1398#endif
1362} 1399}
1363 1400
1364void 1401void
1365rxvt_term::IMSetStatusPosition () 1402rxvt_term::IMSetStatusPosition ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines