… | |
… | |
80 | vt_ev (this, &rxvt_term::x_cb), |
80 | vt_ev (this, &rxvt_term::x_cb), |
81 | #ifdef HAVE_SCROLLBARS |
81 | #ifdef HAVE_SCROLLBARS |
82 | scrollbar_ev (this, &rxvt_term::x_cb), |
82 | scrollbar_ev (this, &rxvt_term::x_cb), |
83 | #endif |
83 | #endif |
84 | #ifdef MENUBAR |
84 | #ifdef MENUBAR |
85 | menubar_ev (this, &rxvt_term::x_cb), fixme |
85 | menubar_ev (this, &rxvt_term::x_cb), |
86 | #endif |
86 | #endif |
87 | #ifdef CURSOR_BLINK |
87 | #ifdef CURSOR_BLINK |
88 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
88 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
89 | #endif |
89 | #endif |
90 | #ifdef TEXT_BLINK |
90 | #ifdef TEXT_BLINK |
… | |
… | |
117 | #endif |
117 | #endif |
118 | |
118 | |
119 | delete TermWin.fontset; |
119 | delete TermWin.fontset; |
120 | |
120 | |
121 | 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 |
122 | if (TermWin.parent[0]) |
130 | if (TermWin.parent[0]) |
123 | XDestroyWindow (display->display, TermWin.parent[0]); |
131 | XDestroyWindow (display->display, TermWin.parent[0]); |
|
|
132 | } |
124 | |
133 | |
125 | // TODO: free pixcolours, colours should become part of rxvt_display |
134 | // TODO: free pixcolours, colours should become part of rxvt_display |
126 | |
135 | |
127 | delete PixColors; |
136 | delete PixColors; |
128 | |
137 | |
… | |
… | |
249 | |
258 | |
250 | const char **cmd_argv = init_resources (argc, argv); |
259 | const char **cmd_argv = init_resources (argc, argv); |
251 | |
260 | |
252 | set_locale (""); |
261 | set_locale (""); |
253 | |
262 | |
254 | #if (MENUBAR_MAX) |
263 | #if MENUBAR_MAX |
255 | menubar_read (rs[Rs_menu]); |
264 | menubar_read (rs[Rs_menu]); |
256 | #endif |
265 | #endif |
257 | #ifdef HAVE_SCROLLBARS |
266 | #ifdef HAVE_SCROLLBARS |
258 | if (Options & Opt_scrollBar) |
267 | if (Options & Opt_scrollBar) |
259 | scrollBar.setIdle (); /* set existence for size calculations */ |
268 | scrollBar.setIdle (); /* set existence for size calculations */ |
… | |
… | |
262 | create_windows (argc, argv); |
271 | create_windows (argc, argv); |
263 | |
272 | |
264 | init_xlocale (); |
273 | init_xlocale (); |
265 | |
274 | |
266 | scr_reset (); /* initialize screen */ |
275 | scr_reset (); /* initialize screen */ |
267 | #ifdef RXVT_GRAPHICS |
|
|
268 | Gr_reset (); /* reset graphics */ |
|
|
269 | #endif |
|
|
270 | |
276 | |
271 | #if 0 |
277 | #if 0 |
272 | XSynchronize (display->display, True); |
278 | XSynchronize (display->display, True); |
273 | #endif |
279 | #endif |
274 | |
280 | |
275 | #ifdef HAVE_SCROLLBARS |
281 | #ifdef HAVE_SCROLLBARS |
276 | if (Options & Opt_scrollBar) |
282 | if (Options & Opt_scrollBar) |
277 | resize_scrollbar (); /* create and map scrollbar */ |
283 | resize_scrollbar (); /* create and map scrollbar */ |
278 | #endif |
284 | #endif |
279 | #if (MENUBAR_MAX) |
285 | #if (MENUBAR_MAX) |
280 | if (menubar_visible (r)) |
286 | if (menubar_visible ()) |
281 | XMapWindow (display->display, menuBar.win); |
287 | XMapWindow (display->display, menuBar.win); |
282 | #endif |
288 | #endif |
283 | #ifdef TRANSPARENT |
289 | #ifdef TRANSPARENT |
284 | if (Options & Opt_transparent) |
290 | if (Options & Opt_transparent) |
285 | { |
291 | { |
… | |
… | |
718 | * init = 1 - initialize |
724 | * init = 1 - initialize |
719 | * |
725 | * |
720 | * fontname == FONT_UP - switch to bigger font |
726 | * fontname == FONT_UP - switch to bigger font |
721 | * fontname == FONT_DN - switch to smaller font |
727 | * fontname == FONT_DN - switch to smaller font |
722 | */ |
728 | */ |
723 | void |
729 | bool |
724 | rxvt_term::change_font (int init, const char *fontname) |
730 | rxvt_term::change_font (const char *fontname) |
725 | {} |
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); |
726 | |
743 | |
727 | void |
744 | if (fs && fs->populate (fontname ? fontname : "fixed")) |
|
|
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 | 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 | |
|
|
766 | bool |
728 | rxvt_term::font_up_down (int n, int direction) |
767 | rxvt_term::font_up_down (int n, int direction) |
729 | {} |
768 | { |
|
|
769 | return false; |
|
|
770 | } |
730 | |
771 | |
731 | /*----------------------------------------------------------------------*/ |
772 | /*----------------------------------------------------------------------*/ |
732 | /*----------------------------------------------------------------------*/ |
773 | /*----------------------------------------------------------------------*/ |
733 | /* xterm sequences - title, iconName, color (exptl) */ |
774 | /* xterm sequences - title, iconName, color (exptl) */ |
734 | void |
775 | void |
735 | rxvt_term::set_title (const char *str) |
776 | rxvt_term::set_title (const char *str) |
736 | { |
777 | { |
737 | #ifndef SMART_WINDOW_TITLE |
778 | #ifndef SMART_WINDOW_TITLE |
738 | XStoreName (display->display, TermWin.parent[0], str); |
779 | XStoreName (display->display, TermWin.parent[0], str); |
739 | #else |
780 | #else |
740 | char *name; |
781 | char *name; |
741 | |
782 | |
742 | if (XFetchName (display->display, TermWin.parent[0], &name) == 0) |
783 | if (XFetchName (display->display, TermWin.parent[0], &name) == 0) |
743 | name = NULL; |
784 | name = NULL; |
744 | if (name == NULL || STRCMP (name, str)) |
785 | if (name == NULL || STRCMP (name, str)) |
745 | XStoreName (display->display, TermWin.parent[0], str); |
786 | XStoreName (display->display, TermWin.parent[0], str); |
… | |
… | |
752 | rxvt_term::set_iconName (const char *str) |
793 | rxvt_term::set_iconName (const char *str) |
753 | { |
794 | { |
754 | #ifndef SMART_WINDOW_TITLE |
795 | #ifndef SMART_WINDOW_TITLE |
755 | XSetIconName (display->display, TermWin.parent[0], str); |
796 | XSetIconName (display->display, TermWin.parent[0], str); |
756 | #else |
797 | #else |
757 | char *name; |
798 | char *name; |
758 | |
799 | |
759 | if (XGetIconName (display->display, TermWin.parent[0], &name)) |
800 | if (XGetIconName (display->display, TermWin.parent[0], &name)) |
760 | name = NULL; |
801 | name = NULL; |
761 | if (name == NULL || STRCMP (name, str)) |
802 | if (name == NULL || STRCMP (name, str)) |
762 | XSetIconName (display->display, TermWin.parent[0], str); |
803 | XSetIconName (display->display, TermWin.parent[0], str); |
… | |
… | |
767 | |
808 | |
768 | #ifdef XTERM_COLOR_CHANGE |
809 | #ifdef XTERM_COLOR_CHANGE |
769 | void |
810 | void |
770 | rxvt_term::set_window_color (int idx, const char *color) |
811 | rxvt_term::set_window_color (int idx, const char *color) |
771 | { |
812 | { |
772 | rxvt_color xcol; |
813 | rxvt_color xcol; |
773 | int i; |
814 | int i; |
774 | |
815 | |
775 | if (color == NULL || *color == '\0') |
816 | if (color == NULL || *color == '\0') |
776 | return; |
817 | return; |
777 | |
818 | |
778 | /* handle color aliases */ |
819 | /* handle color aliases */ |
… | |
… | |
995 | 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); |
1036 | 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); |
996 | |
1037 | |
997 | XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, |
1038 | XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, |
998 | window_vt_y, TermWin_TotalWidth (), |
1039 | window_vt_y, TermWin_TotalWidth (), |
999 | TermWin_TotalHeight ()); |
1040 | TermWin_TotalHeight ()); |
1000 | #ifdef RXVT_GRAPHICS |
|
|
1001 | if (old_height) |
|
|
1002 | Gr_Resize (old_width - szHint.base_width, |
|
|
1003 | old_height - szHint.base_height); |
|
|
1004 | #endif |
|
|
1005 | scr_clear (); |
1041 | scr_clear (); |
1006 | #ifdef XPM_BACKGROUND |
1042 | #ifdef XPM_BACKGROUND |
1007 | resize_pixmap (); |
1043 | resize_pixmap (); |
1008 | #endif |
1044 | #endif |
1009 | |
1045 | |