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