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 | |
106 | rxvt_term::~rxvt_term () |
107 | rxvt_term::~rxvt_term () |
… | |
… | |
261 | create_windows (argc, argv); |
262 | create_windows (argc, argv); |
262 | |
263 | |
263 | init_xlocale (); |
264 | init_xlocale (); |
264 | |
265 | |
265 | scr_reset (); /* initialize screen */ |
266 | scr_reset (); /* initialize screen */ |
266 | #ifdef RXVT_GRAPHICS |
|
|
267 | Gr_reset (); /* reset graphics */ |
|
|
268 | #endif |
|
|
269 | |
267 | |
270 | #if 1 |
268 | #if 0 |
271 | XSynchronize (display->display, True); |
269 | XSynchronize (display->display, True); |
272 | #endif |
270 | #endif |
273 | |
271 | |
274 | #ifdef HAVE_SCROLLBARS |
272 | #ifdef HAVE_SCROLLBARS |
275 | if (Options & Opt_scrollBar) |
273 | if (Options & Opt_scrollBar) |
… | |
… | |
717 | * init = 1 - initialize |
715 | * init = 1 - initialize |
718 | * |
716 | * |
719 | * fontname == FONT_UP - switch to bigger font |
717 | * fontname == FONT_UP - switch to bigger font |
720 | * fontname == FONT_DN - switch to smaller font |
718 | * fontname == FONT_DN - switch to smaller font |
721 | */ |
719 | */ |
722 | void |
720 | bool |
723 | rxvt_term::change_font (int init, const char *fontname) |
721 | rxvt_term::change_font (const char *fontname) |
724 | {} |
722 | { |
|
|
723 | if (fontname == FONT_UP) |
|
|
724 | { |
|
|
725 | // TODO |
|
|
726 | } |
|
|
727 | else if (fontname == FONT_DN) |
|
|
728 | { |
|
|
729 | // TODO |
|
|
730 | } |
|
|
731 | else |
|
|
732 | { |
|
|
733 | rxvt_fontset *fs = new rxvt_fontset (this); |
725 | |
734 | |
726 | void |
735 | if (fs && fs->populate (fontname)) |
|
|
736 | { |
|
|
737 | delete TermWin.fontset; |
|
|
738 | TermWin.fontset = fs; |
|
|
739 | TermWin.fwidth = fs->base_font ()->width; |
|
|
740 | TermWin.fheight = fs->base_font ()->height; |
|
|
741 | TermWin.fbase = fs->base_font ()->ascent; |
|
|
742 | |
|
|
743 | // TODO: screen needs to be told about new fonts |
|
|
744 | |
|
|
745 | return true; |
|
|
746 | } |
|
|
747 | } |
|
|
748 | |
|
|
749 | return false; |
|
|
750 | } |
|
|
751 | |
|
|
752 | bool |
727 | rxvt_term::font_up_down (int n, int direction) |
753 | rxvt_term::font_up_down (int n, int direction) |
728 | {} |
754 | { |
|
|
755 | return false; |
|
|
756 | } |
729 | |
757 | |
730 | /*----------------------------------------------------------------------*/ |
758 | /*----------------------------------------------------------------------*/ |
731 | /*----------------------------------------------------------------------*/ |
759 | /*----------------------------------------------------------------------*/ |
732 | /* xterm sequences - title, iconName, color (exptl) */ |
760 | /* xterm sequences - title, iconName, color (exptl) */ |
733 | void |
761 | void |
… | |
… | |
994 | 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); |
1022 | 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); |
995 | |
1023 | |
996 | XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, |
1024 | XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, |
997 | window_vt_y, TermWin_TotalWidth (), |
1025 | window_vt_y, TermWin_TotalWidth (), |
998 | TermWin_TotalHeight ()); |
1026 | 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 (); |
1027 | scr_clear (); |
1005 | #ifdef XPM_BACKGROUND |
1028 | #ifdef XPM_BACKGROUND |
1006 | resize_pixmap (); |
1029 | resize_pixmap (); |
1007 | #endif |
1030 | #endif |
1008 | |
1031 | |
… | |
… | |
1314 | if (Input_Context) |
1337 | if (Input_Context) |
1315 | return; |
1338 | return; |
1316 | |
1339 | |
1317 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1340 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1318 | if (rs[Rs_imLocale]) |
1341 | if (rs[Rs_imLocale]) |
1319 | setlocale (LC_CTYPE, rs[Rs_imLocale]); |
1342 | SET_LOCALE (rs[Rs_imLocale]); |
1320 | #endif |
1343 | #endif |
1321 | |
1344 | |
1322 | p = rs[Rs_inputMethod]; |
1345 | p = rs[Rs_inputMethod]; |
1323 | if (p && *p) |
1346 | if (p && *p) |
1324 | { |
1347 | { |
… | |
… | |
1355 | goto done; |
1378 | goto done; |
1356 | |
1379 | |
1357 | done: |
1380 | done: |
1358 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1381 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1359 | if (rs[Rs_imLocale]) |
1382 | if (rs[Rs_imLocale]) |
1360 | setlocale (LC_CTYPE, locale); |
1383 | SET_LOCALE (locale); |
1361 | #endif |
1384 | #endif |
1362 | } |
1385 | } |
1363 | |
1386 | |
1364 | void |
1387 | void |
1365 | rxvt_term::IMSetStatusPosition () |
1388 | rxvt_term::IMSetStatusPosition () |