1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

A zh-tw cursor movement friendly, wrapping clean BitchX.

This commit is contained in:
Clive Lin 2001-01-08 18:27:17 +00:00
parent 86d168e54a
commit 2be565a241
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=36952
6 changed files with 217 additions and 0 deletions

View File

@ -13,6 +13,7 @@
SUBDIR += bg5ps
SUBDIR += big5con
SUBDIR += big5fs
SUBDIR += bitchx
SUBDIR += c2t
SUBDIR += celvis
SUBDIR += chinput

22
chinese/bitchx/Makefile Normal file
View File

@ -0,0 +1,22 @@
# New ports collection makefile for: BitchX
# Date created: Mon Jan 8 2001
# Whom: clive
#
# $FreeBSD$
#
MASTERDIR= ${.CURDIR}/../../irc/bitchx
EXTRA_PATCHES= ${.CURDIR}/files/patch-source::input.c \
${.CURDIR}/files/patch-include::config.h \
${.CURDIR}/files/patch-source::screen.c
WITH_LATIN= yes
.include "${MASTERDIR}/Makefile"
PORTNAME= BitchX
PKGNAMEPREFIX:= ${PKGNAMEPREFIX}tw-
CATEGORIES= chinese irc
MAINTAINER= clive@FreeBSD.org

View File

@ -0,0 +1,42 @@
--- include/config.h.orig Tue Jan 9 01:51:42 2001
+++ include/config.h Tue Jan 9 02:03:44 2001
@@ -52,7 +52,7 @@
* have a continuation char.
*/
#define DEFAULT_SERVER "[ODNet] "\
- "irc.bitchx.com "\
+ "irc.taiwan.com "\
"[efnet] "\
"irc.total.net "\
"ircd.c-com.net "\
@@ -479,7 +479,7 @@
#define DEFAULT_HTTP_GRAB OFF
#define DEFAULT_HELP_WINDOW OFF
-#define DEFAULT_NICK_COMPLETION ON
+#define DEFAULT_NICK_COMPLETION OFF
#define DEFAULT_NICK_COMPLETION_LEN 2
#define DEFAULT_NICK_COMPLETION_TYPE 0 /* 0 1 2 */
#define DEFAULT_NOTIFY ON
@@ -514,9 +514,9 @@
#define DEFAULT_AINV 0
#define DEFAULT_ANNOY_KICK OFF
#define DEFAULT_AOP_VAR OFF
-#define DEFAULT_AUTO_AWAY ON
-#define DEFAULT_KICK_OPS ON
-#define DEFAULT_AUTO_REJOIN ON
+#define DEFAULT_AUTO_AWAY OFF
+#define DEFAULT_KICK_OPS OFF
+#define DEFAULT_AUTO_REJOIN OFF
#define DEFAULT_DEOPFLOOD ON
#if defined(__EMXPM__) || defined(WIN32)
#define DEFAULT_CODEPAGE 437
@@ -757,7 +757,7 @@
#endif
#undef PARANOID /* #define this if your paranoid about dcc hijacking */
-#undef WANT_CHAN_NICK_SERV /* do we want to include some chan/nick/oper server commands */
+#define WANT_CHAN_NICK_SERV /* do we want to include some chan/nick/oper server commands */
/* new epic stuff */
#define OLD_STATUS_S_EXPANDO_BEHAVIOR

View File

@ -0,0 +1,118 @@
--- source/input.c~ Mon Jan 8 15:06:30 2001
+++ source/input.c Mon Jan 8 01:09:28 2001
@@ -89,6 +89,7 @@
#define MIN_CHAR INPUT_BUFFER[MIN_POS]
#define PREV_CHAR INPUT_BUFFER[THIS_POS-1]
#define NEXT_CHAR INPUT_BUFFER[THIS_POS+1]
+#define NTH_CHAR(offset) INPUT_BUFFER[THIS_POS+(offset)]
#define ADD_TO_INPUT(x) strmcat(INPUT_BUFFER, (x), INPUT_BUFFER_SIZE);
#define INPUT_ONSCREEN current_screen->input_visible
#define INPUT_VISIBLE INPUT_BUFFER[INPUT_ONSCREEN]
@@ -473,6 +474,13 @@
{
if (THIS_CHAR)
{
+#ifdef WANT_BIG5
+ if (NEXT_CHAR && is_big5(THIS_CHAR,NEXT_CHAR) )
+ {
+ THIS_POS++;
+ term_cursor_right();
+ }
+#endif /* WANT_BIG5 */
THIS_POS++;
term_cursor_right();
}
@@ -483,6 +491,13 @@
{
THIS_POS--;
term_cursor_left();
+#ifdef WANT_BIG5
+ if (is_big5(PREV_CHAR,THIS_CHAR))
+ {
+ THIS_POS--;
+ term_cursor_left();
+ }
+#endif /* WANT_BIG5 */
}
}
update_input(NO_UPDATE);
@@ -577,15 +592,33 @@
BUILT_IN_KEYBINDING(input_delete_character)
{
int pos;
+#ifdef WANT_BIG5
+ int count=1 ;
+ int big5_delete=0 ;
+#endif
cursor_to_input();
in_completion = STATE_NORMAL;
if (!THIS_CHAR)
return;
+#ifdef WANT_BIG5
+ if ((THIS_CHAR && NEXT_CHAR) && is_big5(THIS_CHAR, NEXT_CHAR))
+ {
+ ov_strcpy(&THIS_CHAR, &NTH_CHAR(2));
+ big5_delete=1 ;
+ }
+ else
+ ov_strcpy(&THIS_CHAR, &NEXT_CHAR);
+#else
ov_strcpy(&THIS_CHAR, &NEXT_CHAR);
+#endif /* WANT_BIG5 */
if (!(termfeatures & TERM_CAN_DELETE))
update_input(UPDATE_FROM_CURSOR);
else
{
+#ifdef WANT_BIG5
+ if (big5_delete) count = 2 ;
+ while ( count -- > 0) {
+#endif
term_delete(1);
pos = INPUT_ONSCREEN + last_input_screen->co - 1;
if (pos < strlen(INPUT_BUFFER))
@@ -594,6 +627,9 @@
term_putchar(INPUT_BUFFER[pos]);
term_move_cursor(INPUT_CURSOR, INPUT_LINE);
}
+#ifdef WANT_BIG5
+ } /* while -- > 0 */
+#endif /* WANT_BIG5 */
update_input(NO_UPDATE);
}
}
@@ -607,6 +643,14 @@
char *ptr = NULL;
int pos;
+#ifdef WANT_BIG5
+ int count=1 ;
+#endif
+#ifdef WANT_BIG5
+ if ( *(&PREV_CHAR-sizeof(char)) && (is_big5(*(&PREV_CHAR-sizeof(char)),PREV_CHAR)))
+ count=2 ;
+ while (count-->0) {
+#endif
ptr = LOCAL_COPY(&THIS_CHAR);
strcpy(&(PREV_CHAR), ptr);
THIS_POS--;
@@ -643,6 +687,9 @@
update_input(UPDATE_FROM_CURSOR);
#endif
}
+#ifdef WANT_BIG5
+ } /* while (count-- > 0)*/
+#endif
}
if (THIS_POS == MIN_POS)
HOLDLAST = NULL;
@@ -681,6 +728,10 @@
{
cursor_to_input();
THIS_POS = strlen(INPUT_BUFFER);
+#ifdef WANT_BIG5
+ if (is_big5(PREV_CHAR,THIS_CHAR))
+ THIS_POS-- ;
+#endif
update_input(UPDATE_JUST_CURSOR);
}

View File

@ -0,0 +1,33 @@
--- source/screen.c~ Mon Jan 8 15:06:18 2001
+++ source/screen.c Mon Jan 8 15:05:53 2001
@@ -548,6 +548,15 @@
default:
{
+#ifdef WANT_BIG5
+ if (is_big5((char)*ptr,(char)*(ptr+1)))
+ {
+ buffer[pos++] = *ptr++;
+ col++ ;
+ if ( col + 2 >= max_cols )
+ word_break = pos-1 ;
+ }
+#endif
if (*ptr == ' ' || strchr(words, *ptr))
{
if (indent == 0)
@@ -586,7 +595,14 @@
if (!word_break || (flags & PREPARE_NOWRAP))
word_break = max_cols /*pos - 1*/;
else if (col > max_cols)
+#ifdef WANT_BIG5
+ if (is_big5((char)buffer[pos-2], (char)buffer[pos-1]))
+ word_break = pos -2 ;
+ else
+ word_break = pos -1 ;
+#else
word_break = pos - 1;
+#endif
/*
* XXXX Massive hackwork here.

View File

@ -0,0 +1 @@
A zh-tw cursor movement friendly, wrapping clean BitchX