From 94ea5bd145afb4b59e2e14f0996413c07779f829 Mon Sep 17 00:00:00 2001 From: pcg Date: Sun, 22 Feb 2004 10:37:53 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 4 ++++ doc/rxvt.1 | 29 ++++++++--------------------- doc/rxvt.tbl | 29 ++++++++--------------------- src/command.C | 3 ++- src/init.C | 2 +- src/main.C | 7 +++++++ src/rxvt.h | 32 ++++++++++++++++++++------------ src/screen.C | 23 +++++++++++++++++++++++ 8 files changed, 73 insertions(+), 56 deletions(-) diff --git a/Changes b/Changes index 7d18cb57..bafc4c01 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,10 @@ keysyms that also have string translations, when not --enable-xim. reported by joel reed. - countless minor bugfixes. + - re-enabled esc-seq. for font-switching (\033 ] 50 ; \007). + - fix bug in locale-handling that kept the correct locale from + being selected. + - implemented esc-seq. to switch locales (\033 ] 9 ; \007). - removed greek support. 1.8 Mon Feb 2 20:09:18 CET 2004 diff --git a/doc/rxvt.1 b/doc/rxvt.1 index e7449990..80c33b91 100644 --- a/doc/rxvt.1 +++ b/doc/rxvt.1 @@ -84,11 +84,6 @@ unicode characters\&. The first font defines the cell size for characters, pther fonts might be smaller, but not larger\&. A reasonable default list is appended\&. resource \fBfont\fP\&. -.IP "\fB-grk\fP \fImode\fP" -Compile \fIGreek\fP: Greek keyboard translation; -\fBiso\fP: ISO-8859 mapping\&. -\fBibm\fP: IBM-437 mapping; -resource \fBgreek_keyboard\fP\&. .IP "\fB-name\fP \fIname\fP" Specify the application name under which resources are to be obtained, rather than the default executable file name\&. @@ -293,15 +288,6 @@ unicode characters\&. The first font defines the cell size for characters, pther fonts might be smaller, but not larger\&. A reasonable default list is appended\&. option \fB-fn\fP\&. -.IP "\fBgreek_keyboard:\fP \fImode\fP" -Set the Greek keyboard translation mode to be used; -\fBiso\fP: ISO-8859 mapping (elot-928) [default]\&. -\fBibm\fP: IBM-437 mapping (DOS codepage 737); -option \fB-grk\fP\&. -.IP "\fBgreektoggle_key:\fP \fIkeysym\fP" -Set the key to toggle keyboard input between no translation and -Greek translation [default \fBMode_switch\fP]\&. -For more details, see the distributed file \fBREADME\&.greek\fP\&. .IP "\fBselectstyle:\fP \fImode\fP" Set mouse selection style to \fBold\fP which is 2\&.20, \fBoldword\fP which is xterm style with 2\&.20 old word selection, or anything else which @@ -520,10 +506,6 @@ seen via the \fIwho(1)\fP command, and can accept messages\&. To allow this feature, \fBrxvt\fP must be installed setuid root on some systems\&. .SH "COLORS AND GRAPHICS" .PP -If graphics support was enabled at compile-time, \fBrxvt\fP can be queried -with ANSI escape sequences and can address individual pixels instead of -text characters\&. Note the graphics support is still considered beta code\&. -.PP In addition to the default foreground and background colours, \fBrxvt\fP can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same)\&. @@ -1076,7 +1058,7 @@ University of Kent, 1992, wrote the original Xvt\&. .IP "Rob Nation " very heavily modified Xvt and came up with Rxvt .IP "Angelo Haritsis " -wrote the Greek Keyboard Input +wrote the Greek Keyboard Input (no longer in code) .IP "mj olesen " Wrote the menu system\&. .br @@ -1084,6 +1066,11 @@ Project Coordinator (changes\&.txt 2\&.11 to 2\&.21) .IP "Oezguer Kesim " Project Coordinator (changes\&.txt 2\&.21a to 2\&.4\&.5) .IP "Geoff Wing " -Rewrote screen display and text selection routines\&. +Rewrote screen display and text selection routines\&. +Project Coordinator (changes\&.txt 2\&.4\&.6 - rxvt-unicode) +.IP "Marc Alexander Lehman " +Rewrote most of the display code and internal character handling +to store text in unicode\&. Numerous other fixes and extensions\&. .br -Project Coordinator (changes\&.txt 2\&.4\&.6 - ) +Project Coordinator (Changes 1\&.0 - ) +.PP diff --git a/doc/rxvt.tbl b/doc/rxvt.tbl index 372d01e2..763b684f 100644 --- a/doc/rxvt.tbl +++ b/doc/rxvt.tbl @@ -81,11 +81,6 @@ unicode characters\&. The first font defines the cell size for characters, pther fonts might be smaller, but not larger\&. A reasonable default list is appended\&. resource \fBfont\fP\&. -.IP "\fB-grk\fP \fImode\fP" -Compile \fIGreek\fP: Greek keyboard translation; -\fBiso\fP: ISO-8859 mapping\&. -\fBibm\fP: IBM-437 mapping; -resource \fBgreek_keyboard\fP\&. .IP "\fB-name\fP \fIname\fP" Specify the application name under which resources are to be obtained, rather than the default executable file name\&. @@ -290,15 +285,6 @@ unicode characters\&. The first font defines the cell size for characters, pther fonts might be smaller, but not larger\&. A reasonable default list is appended\&. option \fB-fn\fP\&. -.IP "\fBgreek_keyboard:\fP \fImode\fP" -Set the Greek keyboard translation mode to be used; -\fBiso\fP: ISO-8859 mapping (elot-928) [default]\&. -\fBibm\fP: IBM-437 mapping (DOS codepage 737); -option \fB-grk\fP\&. -.IP "\fBgreektoggle_key:\fP \fIkeysym\fP" -Set the key to toggle keyboard input between no translation and -Greek translation [default \fBMode_switch\fP]\&. -For more details, see the distributed file \fBREADME\&.greek\fP\&. .IP "\fBselectstyle:\fP \fImode\fP" Set mouse selection style to \fBold\fP which is 2\&.20, \fBoldword\fP which is xterm style with 2\&.20 old word selection, or anything else which @@ -517,10 +503,6 @@ seen via the \fIwho(1)\fP command, and can accept messages\&. To allow this feature, \fBrxvt\fP must be installed setuid root on some systems\&. .SH "COLORS AND GRAPHICS" .PP -If graphics support was enabled at compile-time, \fBrxvt\fP can be queried -with ANSI escape sequences and can address individual pixels instead of -text characters\&. Note the graphics support is still considered beta code\&. -.PP In addition to the default foreground and background colours, \fBrxvt\fP can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same)\&. @@ -626,7 +608,7 @@ University of Kent, 1992, wrote the original Xvt\&. .IP "Rob Nation " very heavily modified Xvt and came up with Rxvt .IP "Angelo Haritsis " -wrote the Greek Keyboard Input +wrote the Greek Keyboard Input (no longer in code) .IP "mj olesen " Wrote the menu system\&. .br @@ -634,6 +616,11 @@ Project Coordinator (changes\&.txt 2\&.11 to 2\&.21) .IP "Oezguer Kesim " Project Coordinator (changes\&.txt 2\&.21a to 2\&.4\&.5) .IP "Geoff Wing " -Rewrote screen display and text selection routines\&. +Rewrote screen display and text selection routines\&. +Project Coordinator (changes\&.txt 2\&.4\&.6 - rxvt-unicode) +.IP "Marc Alexander Lehman " +Rewrote most of the display code and internal character handling +to store text in unicode\&. Numerous other fixes and extensions\&. .br -Project Coordinator (changes\&.txt 2\&.4\&.6 - ) +Project Coordinator (Changes 1\&.0 - ) +.PP diff --git a/src/command.C b/src/command.C index 4e0f9ff1..2adbcfc3 100644 --- a/src/command.C +++ b/src/command.C @@ -3077,7 +3077,8 @@ rxvt_term::xterm_seq (int op, const char *str, unsigned char resp __attribute__ change_font (str); break; case XTerm_locale: - /* TODO */ + set_locale (str); + im_cb (); break; #if 0 case XTerm_dumpscreen: /* no error notices */ diff --git a/src/init.C b/src/init.C index 914a357b..65b7228b 100644 --- a/src/init.C +++ b/src/init.C @@ -798,7 +798,7 @@ rxvt_term::set_locale (const char *locale) { #if HAVE_XSETLOCALE || HAVE_SETLOCALE free (this->locale); - this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); + this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); SET_LOCALE (this->locale); mbstate.reset (); #endif diff --git a/src/main.C b/src/main.C index 19ac20ee..e36e077a 100644 --- a/src/main.C +++ b/src/main.C @@ -742,6 +742,13 @@ rxvt_term::change_font (const char *fontname) // TODO: screen needs to be told about new fonts + if (TermWin.parent[0]) + { + resize_all_windows (0, 0, 0); + scr_remap_chars (); + scr_touch (true); + } + return true; } } diff --git a/src/rxvt.h b/src/rxvt.h index fd797327..da8440f1 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -271,11 +271,13 @@ struct mouse_event { * +---< SB_WIDTH_NEXT */ -#define NO_REFRESH 0 /* Window not visible at all! */ -#define FAST_REFRESH (1<<0) /* Fully exposed window */ -#define SLOW_REFRESH (1<<1) /* Partially exposed window */ -#define SMOOTH_REFRESH (1<<2) /* Do sync'ing to make it smooth */ -#define REFRESH_BOUNDS (1<<3) +enum { + NO_REFRESH = 0 , /* Window not visible at all! */ + FAST_REFRESH = 1<<0, /* Fully exposed window */ + SLOW_REFRESH = 1<<1, /* Partially exposed window */ + SMOOTH_REFRESH = 1<<2, /* Do sync'ing to make it smooth */ + REFRESH_BOUNDS = 1<<3 +}; #ifdef NO_SECONDARY_SCREEN # define NSCREENS 0 @@ -293,14 +295,18 @@ struct mouse_event { #define FONT_UP "#+" /* flags for rxvt_scr_gotorc () */ -#define C_RELATIVE 1 /* col movement is relative */ -#define R_RELATIVE 2 /* row movement is relative */ -#define RELATIVE (R_RELATIVE|C_RELATIVE) +enum { + C_RELATIVE = 1 , /* col movement is relative */ + R_RELATIVE = 2, /* row movement is relative */ + RELATIVE = 1 | 2 +}; /* modes for rxvt_scr_insdel_chars (), rxvt_scr_insdel_lines () */ -#define INSERT -1 /* don't change these values */ -#define DELETE +1 -#define ERASE +2 +enum { + INSERT = -1, /* don't change these values */ + DELETE = +1, + ERASE = +2 +}; /* modes for rxvt_scr_page () - scroll page. used by scrollbar window */ enum page_dirn { @@ -1150,6 +1156,8 @@ struct rxvt_term : rxvt_vars { void scr_erase_screen (int mode); void scr_touch (bool refresh); void scr_expose (int x, int y, int width, int height, bool refresh); + void scr_remap_chars (); + void scr_remap_chars (text_t *tp, rend_t *rp); /* autoconvert */ @@ -1162,7 +1170,7 @@ struct rxvt_term : rxvt_vars { void button_release (const XButtonEvent &ev); int check_our_parents (); #ifdef PRINTPIPE - FILE * popen_printer (); + FILE *popen_printer (); int pclose_printer (FILE *stream); #endif void process_print_pipe (); diff --git a/src/screen.C b/src/screen.C index 8b4763a9..7baf4fbb 100644 --- a/src/screen.C +++ b/src/screen.C @@ -2262,6 +2262,29 @@ rxvt_term::scr_refresh (unsigned char refresh_type) want_refresh = 0; /* screen is current */ } +void +rxvt_term::scr_remap_chars (text_t *tp, rend_t *rp) +{ + if (!rp || !tp) + return; + + for (int i = TermWin.ncol; i; i--, rp++, tp++) + *rp = SET_FONT (*rp, TermWin.fontset->find_font (*tp)); +} + +void +rxvt_term::scr_remap_chars () +{ + for (int i = TermWin.nrow + TermWin.saveLines; i--; ) + scr_remap_chars (screen.text[i], screen.rend[i]); + + for (int i = TermWin.nrow; i--; ) + { + scr_remap_chars (drawn_text[i], drawn_rend[i]); + scr_remap_chars (swap.text[i], swap.rend[i]); + } +} + /* ------------------------------------------------------------------------- */ void rxvt_term::scr_clear () -- 2.34.1