Skip site navigation (1)Skip section navigation (2)
Date:      18 Sep 1997 17:32:15 -0000
From:      vanilla@MinJe.com.TW
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/4571: New ports cn-ted-3.6a
Message-ID:  <19970918173215.13215.qmail@MinJe.com.TW>
Resent-Message-ID: <199709181740.KAA21855@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4571
>Category:       ports
>Synopsis:       New ports cn-ted-3.6a
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 18 10:40:00 PDT 1997
>Last-Modified:
>Originator:     Vanill I. Shu
>Organization:
Cray running FreeBSD
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:


>Description:

	ted is small & powerful text editor for X window
	the interface is like PE2 on DOS

	the version is support chinese
	and xcin(chinese input)..

>How-To-Repeat:


>Fix:
	
diff -bcrNp ted.orig/Makefile ted/Makefile
*** ted.orig/Makefile	Thu Jan  1 08:00:00 1970
--- ted/Makefile	Fri Sep 19 01:21:49 1997
***************
*** 0 ****
--- 1,24 ----
+ # New ports collection makefile for:	ted
+ # Version required:	3.6a
+ # Date Created:		18 Sep 1997
+ # Whom:			Vanilla I. Shu <vanilla@MinJe.com.TW>
+ #
+ # $Id$
+ #
+ 
+ DISTNAME=	ted3.6a
+ PKGNAME=	cn-ted-3.6a
+ CATEGORIES=	chinese editors
+ MASTER_SITES=	ftp://moon.csie.ntu.edu.tw/pub/X/ted/ \
+ 		ftp://ftp.x.org/contrib/editors/
+ EXTRACT_SUFX=	.tgz
+ 
+ MAINTAINER=	vanilla@MinJe.com.TW
+ 
+ USE_X11=	yes
+ WRKSRC=		${WRKDIR}/ted
+ 
+ pre-patch:
+ 	@${CP} -f ${WRKSRC}/Makefile.b5 ${WRKSRC}/Makefile
+ 
+ .include <bsd.port.mk>
diff -bcrNp ted.orig/files/md5 ted/files/md5
*** ted.orig/files/md5	Thu Jan  1 08:00:00 1970
--- ted/files/md5	Thu Sep 18 23:15:59 1997
***************
*** 0 ****
--- 1 ----
+ MD5 (ted3.6a.tgz) = 2914e6dc0e5b6c99bdf11ab724a679fa
diff -bcrNp ted.orig/patches/patch-aa ted/patches/patch-aa
*** ted.orig/patches/patch-aa	Thu Jan  1 08:00:00 1970
--- ted/patches/patch-aa	Fri Sep 19 01:23:02 1997
***************
*** 0 ****
--- 1,74 ----
+ *** Makefile.orig	Fri Sep 19 01:15:03 1997
+ --- Makefile	Fri Sep 19 01:18:22 1997
+ ***************
+ *** 1,5 ****
+   CHINESE=1
+ ! TEDDIR=/usr/local/lib/Ted
+   ########## GCC/Linux ......  ############
+   CC=gcc
+   CComp=GCC
+ --- 1,5 ----
+   CHINESE=1
+ ! TEDDIR=/usr/X11R6/lib/X11/ted
+   ########## GCC/Linux ......  ############
+   CC=gcc
+   CComp=GCC
+ *************** LDFLAGS= -L/usr/X11R6/lib
+ *** 27,41 ****
+   #SUNKBD=-DSUNKBD
+   ###########################
+   
+ ! CFLAGS = -O -DCHINESE=$(CHINESE) -I$(XINC) -DCComp=$(CComp) $(SUNKBD)
+   #CFLAGS = -g -DCHINESE=$(CHINESE) -I$(XINC) -DCComp=$(CComp) -DDEBUG $(SUNKBD)
+   
+   OBJS =	e.o x.o m.o f.o b.o edln.o xcp.o s.o u.o misc.o twin.o dir.o xkey.o \
+   	cwin.o filebrowse.o cli_xcin.o kwcomp.o
+   
+ ! all:	ted ref ctags
+   ted:	$(OBJS)
+ ! 	$(CC) -g $(OBJS) -o $@ $(LDFLAGS) -lX11
+   #	strip $@
+   	echo '*** Finish ***'
+   ref:
+ --- 27,41 ----
+   #SUNKBD=-DSUNKBD
+   ###########################
+   
+ ! CFLAGS += -DCHINESE=$(CHINESE) -I$(XINC) -DCComp=$(CComp) $(SUNKBD)
+   #CFLAGS = -g -DCHINESE=$(CHINESE) -I$(XINC) -DCComp=$(CComp) -DDEBUG $(SUNKBD)
+   
+   OBJS =	e.o x.o m.o f.o b.o edln.o xcp.o s.o u.o misc.o twin.o dir.o xkey.o \
+   	cwin.o filebrowse.o cli_xcin.o kwcomp.o
+   
+ ! all:	ted #ref ctags
+   ted:	$(OBJS)
+ ! 	$(CC) $(OBJS) -o $@ $(LDFLAGS) -lX11
+   #	strip $@
+   	echo '*** Finish ***'
+   ref:
+ *************** ctags:
+ *** 45,55 ****
+   	$(CC) $(CFLAGS) ctags.c -o $@
+   	strip $@
+   install:
+ ! 	cp ted ref ctags /usr/local/bin
+   	if [ ! -d $(TEDDIR) ]; then mkdir $(TEDDIR); fi
+ ! 	cp tedrc ted.help $(TEDDIR)
+ ! cli_xcin.o:
+ ! 	ln -s ../big5-pack/xcin/cli_xcin.o .
+   clean:
+   	rm -f $(OBJS) ted core *~ *_
+   clb5:
+ --- 45,56 ----
+   	$(CC) $(CFLAGS) ctags.c -o $@
+   	strip $@
+   install:
+ ! 	install -c -s -o root -g wheel -m 0755 ted /usr/X11R6/bin
+   	if [ ! -d $(TEDDIR) ]; then mkdir $(TEDDIR); fi
+ ! 	install -c -o root -g wheel -m 0555 tedrc $(TEDDIR)
+ ! 	install -c -o root -g wheel -m 0555 ted.help $(TEDDIR)
+ ! #cli_xcin.o:
+ ! #	ln -s ../big5-pack/xcin/cli_xcin.o .
+   clean:
+   	rm -f $(OBJS) ted core *~ *_
+   clb5:
diff -bcrNp ted.orig/patches/patch-ab ted/patches/patch-ab
*** ted.orig/patches/patch-ab	Thu Jan  1 08:00:00 1970
--- ted/patches/patch-ab	Thu Sep 18 23:23:54 1997
***************
*** 0 ****
--- 1,19 ----
+ *** xkey.c.orig	Thu Sep 18 23:23:06 1997
+ --- xkey.c	Thu Sep 18 23:23:45 1997
+ *************** if (cdtedrc && (fp=fopen(ftedrc,"r"))) {
+ *** 563,569 ****
+   if (fp=fopen(
+   	strcat(strcat(strcpy(tt,(char *)getenv("HOME")),"/.Ted/"),ftedrc), "r"
+   )) 	return fp;
+ ! if (fp=fopen(strcat(strcpy(uu,"/usr/local/lib/Ted/"),ftedrc),"r"))
+   	return fp;
+   if (!depth) {
+   	if (cdtedrc)
+ --- 563,569 ----
+   if (fp=fopen(
+   	strcat(strcat(strcpy(tt,(char *)getenv("HOME")),"/.Ted/"),ftedrc), "r"
+   )) 	return fp;
+ ! if (fp=fopen(strcat(strcpy(uu,"/usr/X11R6/lib/X11/ted/"),ftedrc),"r"))
+   	return fp;
+   if (!depth) {
+   	if (cdtedrc)
diff -bcrNp ted.orig/patches/patch-ac ted/patches/patch-ac
*** ted.orig/patches/patch-ac	Thu Jan  1 08:00:00 1970
--- ted/patches/patch-ac	Thu Sep 18 23:24:55 1997
***************
*** 0 ****
--- 1,21 ----
+ *** tedrc.orig	Thu Sep 18 23:24:10 1997
+ --- tedrc	Thu Sep 18 23:24:39 1997
+ *************** f [a-f12]	MergeTedrc("localtedrc")
+ *** 153,160 ****
+   f [s-f9]	ExeCmdFnameExt("make",".o")
+   ##		If the file is already open, switch to this file; otherwise
+   ##		load the file
+ ! f [f1]		RaiseOrLoad("/usr/local/lib/Ted/ted.help")
+ ! f [c-a][f1]	RaiseOrLoad("/usr/local/lib/Ted/tedrc")
+   ## execute command and place the output in the current file
+   #f [c-q][s]	InsPipe("ls")
+   # Excute command and and place output in a new file with name same as the command
+ --- 153,160 ----
+   f [s-f9]	ExeCmdFnameExt("make",".o")
+   ##		If the file is already open, switch to this file; otherwise
+   ##		load the file
+ ! f [f1]		RaiseOrLoad("/usr/X11R6/lib/X11/ted/ted.help")
+ ! f [c-a][f1]	RaiseOrLoad("/usr/X11R6/lib/X11/ted/tedrc")
+   ## execute command and place the output in the current file
+   #f [c-q][s]	InsPipe("ls")
+   # Excute command and and place output in a new file with name same as the command
diff -bcrNp ted.orig/patches/patch-ad ted/patches/patch-ad
*** ted.orig/patches/patch-ad	Thu Jan  1 08:00:00 1970
--- ted/patches/patch-ad	Fri Sep 19 01:20:22 1997
***************
*** 0 ****
--- 1,182 ----
+ *** cli_xcin.c.orig	Fri Sep 19 01:19:33 1997
+ --- cli_xcin.c	Sat Sep 13 11:41:12 1997
+ ***************
+ *** 0 ****
+ --- 1,130 ----
+ + /*
+ + 	Copyright (C) 1994,1995	Edward Der-Hua Liu, Hsin-Chu, Taiwan
+ + */
+ + 
+ + #include <stdio.h>
+ + #include <stdarg.h>
+ + #include <sys/types.h>
+ + #include <X11/Xlib.h>
+ + #include <X11/Xatom.h>
+ + #include "state.h"
+ + #include "protocol.h"
+ + 
+ + static Atom xcin_atom=0;
+ + static Window xcin_win=None;
+ + static InmdState inmdstate;
+ + #define ENDIAN_TEST() (*(int *)"\x11\x22\x33\x44"==0x11223344)
+ + static char my_endian;
+ + 
+ + static connect_xcin(Display *display)
+ + {
+ + Window twin;
+ + xcin_atom=XInternAtom(display, XCIN_ATOM,False);
+ + my_endian=ENDIAN_TEST();  /* if == 11223344, it is big-endian */
+ + 
+ + xcin_win=XGetSelectionOwner(display,xcin_atom);
+ + return xcin_win;
+ + }
+ + 
+ +  void send_FocusIn(Display *display, Window window)
+ + {
+ + 	XClientMessageEvent event;
+ + 	XEvent erreve;
+ + 	char *tmp=event.data.b;
+ + 
+ + 	if (connect_xcin(display)==None) return;
+ + /* Ensure xcin exists, or the process will be hanged */
+ + 	event.type=ClientMessage;
+ + 	event.window=window;
+ + 	event.message_type=xcin_atom;
+ + 	event.format=8;
+ + 	
+ + 	tmp[0]=tmp[1]=tmp[2]=0xff;
+ + 	tmp[3]=CLI_FOCUS_IN;
+ + 	memcpy(&tmp[4],&inmdstate, sizeof(inmdstate));
+ + 	XSendEvent(display, xcin_win, False, 0, (XEvent *)&event);
+ + }
+ + 
+ + static void send_FocusOut(Display *display, Window window)
+ + {
+ + 	XClientMessageEvent event;
+ + 	XEvent erreve;
+ + 	char *tmp=event.data.b;
+ + 
+ + 	if (connect_xcin(display)==None) return;
+ + /* Ensure xcin exists, or the process will be hanged */
+ + 	event.type=ClientMessage;
+ + 	event.window=window;
+ + 	event.message_type=xcin_atom;
+ + 	event.format=8;
+ + 	
+ + 	tmp[0]=tmp[1]=tmp[2]=0xff;
+ + 	tmp[3]=CLI_FOCUS_OUT;
+ + 	memcpy(&tmp[4],&inmdstate, sizeof(inmdstate));
+ + 	XSendEvent(display, xcin_win, False, 0, (XEvent *)&event);
+ + }
+ + 
+ + static void big_little(char *i)
+ + {
+ + char t;
+ + t=*i; *i=*(i+3); *(i+3)=t;
+ + t=*(i+1); *(i+1)=*(i+2); *(i+2)=t;
+ + }
+ + static read_keys(Display *display, char *buf)
+ + {
+ + 	Atom actual_type;
+ + 	int actual_format,i;
+ + 	u_long nitems,bytes_after;
+ + 	char *ttt, *cp;
+ + 	XCIN_RES res;
+ + 	int ofs;
+ + 	cp=(char *)&res;
+ + 	ofs=0;
+ + 	do { 
+ + 	if (XGetWindowProperty(display,xcin_win,xcin_atom,
+ + 		ofs/4,(sizeof(XCIN_RES)+3)/4,
+ + 		True, AnyPropertyType, &actual_type,&actual_format,
+ + 		&nitems,&bytes_after,(unsigned char **)&ttt) != Success)
+ + 			puts("err property");
+ + 		memcpy((char *)(&res)+(ofs & ~0x3), ttt, nitems);
+ + 		XFree(ttt);
+ + 		ofs=(ofs & ~0x3) + nitems;
+ + 	} while ((!nitems && !ofs) || bytes_after>0);
+ + 	if (my_endian) {
+ + 		big_little((char *)&res.len);
+ + 		big_little((char *)&res.status);
+ + 	}
+ + 	memcpy(buf,res.tkey, res.len);
+ + 	inmdstate=res.inmdstate;
+ + 	buf[res.len]=0;
+ + 	return  res.status;
+ + }
+ + 
+ + #include <X11/Xutil.h>
+ + 
+ + static XComposeStatus compose_status = {NULL, 0};
+ + 
+ +   send_key(Display *display, Window win, XKeyEvent *eve, char *buf)
+ + {
+ + XClientMessageEvent event;
+ + XEvent erreve;
+ + char *tmp=event.data.b;
+ + u_char tttt[8];
+ + KeySym keysym;
+ + int count;
+ + 
+ + if (xcin_win==None && connect_xcin(display)==None)
+ + 	return K_REJECT;
+ + if ((xcin_win=XGetSelectionOwner(display,xcin_atom))==None)
+ + 	return K_REJECT;
+ + 
+ + event.type=ClientMessage;
+ + event.window=win;
+ + event.message_type=xcin_atom;
+ + event.format=32;
+ + count =XLookupString (eve, tttt, sizeof(tmp), (KeySym *)tmp, &compose_status);
+ + memcpy(&tmp[4],&eve->state,4);
+ + XSendEvent(display, xcin_win, False, 0, (XEvent *)&event);
+ + XSync(display,False);
+ + return (read_keys(display, buf));
+ + }
+ *** protocol.h.orig	Fri Sep 19 01:19:44 1997
+ --- protocol.h	Fri Sep 19 01:19:41 1997
+ ***************
+ *** 0 ****
+ --- 1,13 ----
+ + /*
+ + 	Copyright (C) 1994	Edward Der-Hua Liu, Hsin-Chu, Taiwan
+ + */
+ + 
+ + #define K_REJECT (0)
+ + #define K_ACCEPT (1) 
+ + 
+ + #define CLI_FOCUS_IN (1)
+ + #define CLI_FOCUS_OUT (3)
+ + 
+ + #define LOAD_KEYWORD (2)
+ + 
+ + #define XCIN_ATOM "XCIN_A"
+ *** state.h.orig	Fri Sep 19 01:20:14 1997
+ --- state.h	Fri Sep 19 01:20:05 1997
+ ***************
+ *** 0 ****
+ --- 1,24 ----
+ + /*
+ + 	Copyright (C) 1994	Edward Der-Hua Liu, Hsin-Chu, Taiwan
+ + */
+ + 
+ + typedef struct {
+ + 	char  kb_state;
+ +         char _CurInMethod;
+ + } InmdState;
+ + 
+ + #define EngChiMask (1)
+ + #define HalfFullMask (2)
+ + 
+ + typedef struct {
+ + 	int len;
+ + 	int status;
+ + 	InmdState inmdstate;
+ + 	char tkey[512];
+ + } XCIN_RES;
+ + 
+ + #define EngChi ((inmdstate.kb_state & EngChiMask) ? 1:0)
+ + #define HalfFull ((inmdstate.kb_state & HalfFullMask) ? 1:0)
+ + #define CurInMethod (inmdstate._CurInMethod)
+ + /*extern InmdState inmdstate;
+ + */
diff -bcrNp ted.orig/pkg/COMMENT ted/pkg/COMMENT
*** ted.orig/pkg/COMMENT	Thu Jan  1 08:00:00 1970
--- ted/pkg/COMMENT	Fri Sep 19 00:59:28 1997
***************
*** 0 ****
--- 1 ----
+ A Small and Powerful Text Editor for X Window with big5 support
diff -bcrNp ted.orig/pkg/DESCR ted/pkg/DESCR
*** ted.orig/pkg/DESCR	Thu Jan  1 08:00:00 1970
--- ted/pkg/DESCR	Fri Sep 19 00:02:04 1997
***************
*** 0 ****
--- 1,5 ----
+ Ted is a small and powerful Text editor for X Window,
+ the interface is like PE2 on DOS
+ 
+ - Vanilla
+ vanilla@MinJe.com.TW
diff -bcrNp ted.orig/pkg/PLIST ted/pkg/PLIST
*** ted.orig/pkg/PLIST	Thu Jan  1 08:00:00 1970
--- ted/pkg/PLIST	Thu Sep 18 23:32:06 1997
***************
*** 0 ****
--- 1,4 ----
+ bin/ted
+ lib/X11/ted/ted.help
+ lib/X11/ted/tedrc
+ @dirrm lib/X11/ted
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970918173215.13215.qmail>