Date: Mon, 1 Oct 2001 11:31:09 +0800 (CST) From: Kang-min Liu <gugod@gugod.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/30950: port update : chinese/aterm with XIM path Message-ID: <200110010331.f913V9b81555@x20.gugod.org>
next in thread | raw e-mail | index | archive | help
>Number: 30950 >Category: ports >Synopsis: port update : chinese/aterm with XIM path >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 30 20:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Kang-min Liu >Release: FreeBSD 4.4-STABLE i386 >Organization: csie.ntu.edu.tw >Environment: System: FreeBSD x20.gugod.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Fri Sep 28 01:02:46 CST 2001 root@x20.gugod.org:/usr/src/sys/compile/X20 i386 >Description: aterm 0.4.2 with XIM patch workes great. aterm XIM patch is originally here : http://www.bb.wakwak.com/~akk/kadu/aterm.html >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # aterm/Makefile # aterm/distinfo # aterm/files # aterm/pkg-comment # aterm/pkg-descr # aterm/pkg-plist # aterm/files/patch-aa # echo x - aterm/Makefile sed 's/^X//' >aterm/Makefile << 'END-of-aterm/Makefile' X# New ports collection Makefile for: rxvt X# Date created: Nov 16 1997 X# Whom: frankch@waru.life.nthu.edu.tw X# X# $FreeBSD: ports/chinese/rxvt/Makefile,v 1.21 2001/03/07 22:53:39 keichii Exp $ X# X XPORTNAME= aterm XPORTVERSION= 0.4.2 XCATEGORIES= chinese x11 XMASTER_SITES= http://download.sourceforge.net/aterm/ XDISTNAME= aterm-${PORTVERSION} X XMAINTAINER= gugod@gugod.org X XUSE_XPM= yes XHAS_CONFIGURE= yes XPATCH_WRKSRC= ${WRKSRC}/.. XCONFIGURE_ARGS= --enable-fading --enable-xim --enable-big5 X Xpost-install: X @${CHMOD} 4711 ${PREFIX}/bin/aterm X XMAN1= aterm.1 X X.include <bsd.port.mk> END-of-aterm/Makefile echo x - aterm/distinfo sed 's/^X//' >aterm/distinfo << 'END-of-aterm/distinfo' XMD5 (aterm-0.4.2.tar.gz) = d046fcf7fadd661dd5efb393a43c57b1 END-of-aterm/distinfo echo c - aterm/files mkdir -p aterm/files > /dev/null 2>&1 echo x - aterm/pkg-comment sed 's/^X//' >aterm/pkg-comment << 'END-of-aterm/pkg-comment' XA color vt102 terminal emulator with transparency support END-of-aterm/pkg-comment echo x - aterm/pkg-descr sed 's/^X//' >aterm/pkg-descr << 'END-of-aterm/pkg-descr' Xaterm is a color vt102 terminal emulator, based on rxvt 2.4.8 with Xadditions for fast transparency. X XIt was created with AfterStep users in mind, but is not tied to any Xlibraries, and can be used anywhere. X XWWW: http://aterm.sourceforge.net/ X X- Jim <jim@FreeBSD.org> END-of-aterm/pkg-descr echo x - aterm/pkg-plist sed 's/^X//' >aterm/pkg-plist << 'END-of-aterm/pkg-plist' Xbin/aterm Xman/man1/aterm.1 END-of-aterm/pkg-plist echo x - aterm/files/patch-aa sed 's/^X//' >aterm/files/patch-aa << 'END-of-aterm/files/patch-aa' Xdiff -cNr aterm-0.4.2.orig/autoconf/acconfig.h aterm-0.4.2/autoconf/acconfig.h X*** aterm-0.4.2.orig/autoconf/acconfig.h Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/autoconf/acconfig.h Sun Sep 30 15:13:21 2001 X*************** X*** 38,44 **** X--- 38,49 ---- X /* Define if Xlocale support doesn't work */ X #undef NO_XLOCALE X X+ #undef USE_XIM X+ X /* Define is setlocale (defined to Xsetlocale) doesn't work */ X+ #undef NO_XSETLOCALE X+ X+ /* Define is plain setlocale doesn't work */ X #undef NO_SETLOCALE X X /* Define if you want Menubar support */ Xdiff -cNr aterm-0.4.2.orig/autoconf/config.h.in aterm-0.4.2/autoconf/config.h.in X*** aterm-0.4.2.orig/autoconf/config.h.in Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/autoconf/config.h.in Sun Sep 30 15:14:08 2001 X*************** X*** 88,94 **** X--- 88,99 ---- X /* Define if Xlocale support doesn't work */ X #undef NO_XLOCALE X X+ #undef USE_XIM X+ X /* Define is setlocale (defined to Xsetlocale) doesn't work */ X+ #undef NO_XSETLOCALE X+ X+ /* Define is plain setlocale doesn't work */ X #undef NO_SETLOCALE X X /* Define if you want Menubar support */ Xdiff -cNr aterm-0.4.2.orig/autoconf/configure.in aterm-0.4.2/autoconf/configure.in X*** aterm-0.4.2.orig/autoconf/configure.in Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/autoconf/configure.in Sun Sep 30 15:18:11 2001 X*************** X*** 106,111 **** X--- 106,117 ---- X AC_DEFINE(ZH) X fi]) X X+ AC_ARG_ENABLE(xim, X+ [ --enable-xim enable xim support], X+ [if test x$enableval = xyes; then X+ AC_DEFINE(USE_XIM) X+ fi]) X+ X AC_ARG_ENABLE(greek, X [ --enable-greek enable greek keyboard support], X [if test x$enableval = xyes; then X*************** X*** 642,647 **** X--- 648,654 ---- X dnl# this is a really hack test for some basic Xlocale stuff X SAVETHELIBS=$LIBS X LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11" X+ CFLAGS="$CFLAGS $X_CFLAGS" X AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, X [AC_TRY_RUN( X [#define X_LOCALE 1 X*************** X*** 667,672 **** X--- 674,687 ---- X [setlocale(LC_CTYPE, "");], X rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)]) X if test "${rxvt_cv_func_xsetlocale}" = no; then X+ AC_DEFINE(NO_XSETLOCALE) X+ fi X+ X+ AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, X+ [AC_TRY_LINK([#include <locale.h>], X+ [setlocale(LC_CTYPE, "");], X+ rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)]) X+ if test x${rxvt_cv_func_setlocale} = xno; then X AC_DEFINE(NO_SETLOCALE) X fi X Xdiff -cNr aterm-0.4.2.orig/configure aterm-0.4.2/configure X*** aterm-0.4.2.orig/configure Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/configure Sun Sep 30 17:00:35 2001 X*************** X*** 36,41 **** X--- 36,43 ---- X ac_help="$ac_help X --enable-big5 enable big5 support" X ac_help="$ac_help X+ --enable-xim enable xim support" X+ ac_help="$ac_help X --enable-greek enable greek keyboard support" X ac_help="$ac_help X --enable-thai enable thai support" X*************** X*** 786,791 **** X--- 788,804 ---- X fi X fi X X+ # Check whether --enable-xim or --disable-xim was given. X+ if test "${enable_xim+set}" = set; then X+ enableval="$enable_xim" X+ if test x$enableval = xyes; then X+ cat >> confdefs.h <<\EOF X+ #define USE_XIM 1 X+ EOF X+ X+ fi X+ fi X+ X X # Check whether --enable-greek or --disable-greek was given. X if test "${enable_greek+set}" = set; then X*************** X*** 4649,4654 **** X--- 4662,4668 ---- X X SAVETHELIBS=$LIBS X LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11" X+ CFLAGS="$CFLAGS $X_CFLAGS" X echo $ac_n "checking for working Xlocale""... $ac_c" 1>&6 X echo "configure:4654: checking for working Xlocale" >&5 X if eval "test \"`echo '$''{'rxvt_cv_func_xlocale'+set}'`\" = set"; then X*************** X*** 4724,4730 **** X echo "$ac_t""$rxvt_cv_func_xsetlocale" 1>&6 X if test "${rxvt_cv_func_xsetlocale}" = no; then X cat >> confdefs.h <<\EOF X! #define NO_SETLOCALE 1 X EOF X X fi X--- 4738,4777 ---- X echo "$ac_t""$rxvt_cv_func_xsetlocale" 1>&6 X if test "${rxvt_cv_func_xsetlocale}" = no; then X cat >> confdefs.h <<\EOF X! #define NO_XSETLOCALE 1 X! EOF X! X! fi X! X! echo $ac_n "checking for working plain setlocale""... $ac_c" 1>&6 X! echo "configure:4659: checking for working plain setlocale" >&5 X! if eval "test \"`echo '$''{'rxvt_cv_func_setlocale'+set}'`\" = set"; then X! echo $ac_n "(cached) $ac_c" 1>&6 X! else X! cat > conftest.$ac_ext <<EOF X! #line 4664 "configure" X! #include "confdefs.h" X! #include <locale.h> X! int main() { X! setlocale(LC_CTYPE, ""); X! ; return 0; } X! EOF X! if { (eval echo configure:4671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then X! rm -rf conftest* X! rxvt_cv_func_setlocale=yes X! else X! echo "configure: failed program was:" >&5 X! cat conftest.$ac_ext >&5 X! rm -rf conftest* X! rxvt_cv_func_setlocale=no X! fi X! rm -f conftest* X! fi X! X! echo "$ac_t""$rxvt_cv_func_setlocale" 1>&6 X! if test x${rxvt_cv_func_setlocale} = xno; then X! cat >> confdefs.h <<\EOF X! efine NO_SETLOCALE 1 X EOF X X fi Xdiff -cNr aterm-0.4.2.orig/scripts/random_colors aterm-0.4.2/scripts/random_colors X*** aterm-0.4.2.orig/scripts/random_colors Thu Jan 1 08:00:00 1970 X--- aterm-0.4.2/scripts/random_colors Sun Sep 30 17:01:24 2001 X*************** X*** 0 **** X--- 1,18 ---- X+ #!/bin/bash X+ X+ # This script will launch aterm with different tinting color X+ # every time you start it X+ # I don't really know how that can be of any use at all, but some X+ # folks like it - so here it is X+ X+ CLRCODE=`expr $RANDOM % 6` X+ ATRMPATH=$DESTDIR/usr/local/bin X+ X+ { [ "$CLRCODE" -eq "0" ] && CLRNAME="-tint blue -fg yellow -bg black"; } || X+ { [ "$CLRCODE" -eq "1" ] && CLRNAME="-tint red -fg white -bg black"; } || X+ { [ "$CLRCODE" -eq "2" ] && CLRNAME="-tint green -fg white -bg white"; } || X+ { [ "$CLRCODE" -eq "3" ] && CLRNAME="-tint cyan -fg white -bg white"; } || X+ { [ "$CLRCODE" -eq "4" ] && CLRNAME="-tint magenta -fg white -bg black"; } || X+ { [ "$CLRCODE" -eq "5" ] && CLRNAME="-tint yellow -fg blue -bg white"; } X+ X+ exec $ATRMPATH/aterm -fg white -tr $CLRNAME $@ Xdiff -cNr aterm-0.4.2.orig/src/command.c aterm-0.4.2/src/command.c X*** aterm-0.4.2.orig/src/command.c Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/command.c Sun Sep 30 14:36:49 2001 X*************** X*** 69,80 **** X #ifndef NO_XLOCALE X # if (XtSpecificationRelease < 6) X # define NO_XLOCALE X- # else X- # define X_LOCALE X- # include <X11/Xlocale.h> X # endif X #endif /* NO_XLOCALE */ X X #ifdef TTY_GID_SUPPORT X # include <grp.h> X #endif X--- 69,87 ---- X #ifndef NO_XLOCALE X # if (XtSpecificationRelease < 6) X # define NO_XLOCALE X # endif X #endif /* NO_XLOCALE */ X X+ #ifndef NO_XSETLOCALE X+ # define X_LOCALE X+ # include <X11/Xlocale.h> X+ #else X+ # ifndef NO_SETLOCALE X+ # include <locale.h> X+ # endif X+ #endif /* NO_XLOCALE */ X+ X+ X #ifdef TTY_GID_SUPPORT X # include <grp.h> X #endif X*************** X*** 182,190 **** X X /*{{{ defines: */ X X! #define KBUFSZ 8 /* size of keyboard mapping buffer */ X! #define STRING_MAX 512 /* max string size for process_xterm_seq() */ X! #define ESC_ARGS 32 /* max # of args for esc sequences */ X X /* a large REFRESH_PERIOD causes problems with `cat' */ X #define REFRESH_PERIOD 1 X--- 189,201 ---- X X /*{{{ defines: */ X X! #ifdef USE_XIM X! # define KBUFSZ 64 /* size of keyboard mapping buffer */ X! #else X! # define KBUFSZ 8 /* size of keyboard mapping buffer */ X! #endif X! #define STRING_MAX 512 /* max string size for process_xterm_seq() */ X! #define ESC_ARGS 32 /* max # of args for esc sequences */ X X /* a large REFRESH_PERIOD causes problems with `cat' */ X #define REFRESH_PERIOD 1 X*************** X*** 308,318 **** X--- 319,333 ---- X static Atom DndProtocol, DndSelection; X #endif /* OFFIX_DND */ X X+ #ifdef USE_XIM X+ static XIC Input_Context; /* input context */ X+ #else X #ifndef NO_XLOCALE X static char *rs_inputMethod = ""; /* XtNinputMethod */ X static char *rs_preeditType = NULL; /* XtNpreeditType */ X static XIC Input_Context; /* input context */ X #endif /* NO_XLOCALE */ X+ #endif /* USE_XIM */ X X /* command input buffering */ X #ifndef BUFSIZ X*************** X*** 534,540 **** X ttydev = tty_name; X X # define PTYCHAR1 "pqrstuvwxyz" X! # define PTYCHAR2 "0123456789abcdef" X for (c1 = PTYCHAR1; *c1; c1++) { X ptydev[len - 2] = ttydev[len - 2] = *c1; X for (c2 = PTYCHAR2; *c2; c2++) { X--- 549,555 ---- X ttydev = tty_name; X X # define PTYCHAR1 "pqrstuvwxyz" X! # define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz" X for (c1 = PTYCHAR1; *c1; c1++) { X ptydev[len - 2] = ttydev[len - 2] = *c1; X for (c2 = PTYCHAR2; *c2; c2++) { X*************** X*** 1137,1143 **** X--- 1152,1167 ---- X DndSelection = XInternAtom(Xdisplay, "DndSelection", False); X #endif /* OFFIX_DND */ X X+ #ifndef NO_XLOCALE X init_xlocale(); X+ #else X+ setlocale(LC_CTYPE, ""); X+ #endif X+ X+ #ifdef USE_XIM X+ setTermFontSet(); X+ XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, IMInstantiateCallback, NULL); X+ #endif X X /* get number of available file descriptors */ X #ifdef _POSIX_VERSION X*************** X*** 1204,1209 **** X--- 1228,1234 ---- X init_xlocale(void) X { X #ifndef NO_XLOCALE X+ #ifndef USE_XIM X char *p, *s, buf[32], tmp[1024]; X XIM xim = NULL; X XIMStyle input_style = 0; X*************** X*** 1212,1218 **** X X Input_Context = NULL; X X! # ifndef NO_SETLOCALE X /* setlocale(LC_CTYPE, ""); /* XXX: should we do this? */ X # endif X if (rs_inputMethod == NULL || !*rs_inputMethod) { X--- 1237,1243 ---- X X Input_Context = NULL; X X! # if !defined(NO_SETLOCALE) || !defined(NO_XSETLOCALE) X /* setlocale(LC_CTYPE, ""); /* XXX: should we do this? */ X # endif X if (rs_inputMethod == NULL || !*rs_inputMethod) { X*************** X*** 1311,1316 **** X--- 1336,1342 ---- X print_error("Failed to create input context"); X XCloseIM(xim); X } X+ #endif /* USE_XIM */ X #endif /* NO_XLOCALE */ X } X /*}}} */ X*************** X*** 1379,1400 **** X numlock_state = (ev->xkey.state & ModNumLockMask); /* numlock toggle */ X PrivMode((!numlock_state), PrivMode_aplKP); X } X! #ifndef NO_XLOCALE X! if (!XFilterEvent(ev, *(&ev->xkey.window))) { X! if (Input_Context != NULL) { X! Status status_return; X! X! len = XmbLookupString(Input_Context, &ev->xkey, kbuf, X! sizeof(kbuf), &keysym, X! &status_return); X! } else { X! len = XLookupString(&ev->xkey, kbuf, X! sizeof(kbuf), &keysym, X! &compose); X! } X! } else X! len = 0; X! #else /* NO_XLOCALE */ X len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, &compose); X /* X * have unmapped Latin[2-4] entries -> Latin1 X--- 1405,1425 ---- X numlock_state = (ev->xkey.state & ModNumLockMask); /* numlock toggle */ X PrivMode((!numlock_state), PrivMode_aplKP); X } X! #ifdef USE_XIM X! len = 0; X! if (Input_Context != NULL) { X! Status status_return; X! X! kbuf[0] = '\0'; X! len = XmbLookupString(Input_Context, &ev->xkey, kbuf, X! sizeof(kbuf), &keysym, X! &status_return); X! } else { X! len = XLookupString(&ev->xkey, kbuf, X! sizeof(kbuf), &keysym, X! &compose); X! } X! #else /* USE_XIM */ X len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, &compose); X /* X * have unmapped Latin[2-4] entries -> Latin1 X*************** X*** 1404,1410 **** X len = 1; X kbuf[0] = (keysym & 0xFF); X } X! #endif /* NO_XLOCALE */ X X if (len && (Options & Opt_scrollKeypress)) X TermWin.view_start = 0; X--- 1429,1435 ---- X len = 1; X kbuf[0] = (keysym & 0xFF); X } X! #endif /* USE_XIM */ X X if (len && (Options & Opt_scrollKeypress)) X TermWin.view_start = 0; X*************** X*** 1977,1984 **** X--- 2002,2013 ---- X XEvent ev; X X refreshed = 0; X+ #ifdef USE_XIM X+ XProcessEvent(Xdisplay); X+ #else X XNextEvent(Xdisplay, &ev); X process_x_event(&ev); X+ #endif X X /* in case button actions pushed chars to cmdbuf */ X if (cmdbuf_ptr < cmdbuf_endp) X*************** X*** 2050,2055 **** X--- 2079,2087 ---- X refreshed = 1; X scr_refresh(refresh_type); X scrollbar_show(1); X+ #ifdef USE_XIM X+ IMSendSpot(); X+ #endif X } X } X } X*************** X*** 2225,2231 **** X on_colors_changed(Color_bg); X } X #endif X! #ifndef NO_XLOCALE X if (Input_Context != NULL) X XSetICFocus(Input_Context); X #endif X--- 2257,2263 ---- X on_colors_changed(Color_bg); X } X #endif X! #ifndef USE_XIM X if (Input_Context != NULL) X XSetICFocus(Input_Context); X #endif X*************** X*** 2242,2248 **** X on_colors_changed(Color_bg); X } X #endif X! #ifndef NO_XLOCALE X if (Input_Context != NULL) X XUnsetICFocus(Input_Context); X #endif X--- 2274,2280 ---- X on_colors_changed(Color_bg); X } X #endif X! #ifndef USE_XIM X if (Input_Context != NULL) X XUnsetICFocus(Input_Context); X #endif X*************** X*** 2720,2725 **** X--- 2752,2760 ---- X scr_refresh(refresh_type); X refresh_count = refresh_limit = 0; X scrollbar_show(1); X+ #ifdef USE_XIM X+ IMSendSpot(); X+ #endif X } X break; X } X*************** X*** 3444,3449 **** X--- 3479,3487 ---- X } X } X Gr_do_graphics(cmd, nargs, args, text); X+ #ifdef USE_XIM X+ IMSendSpot(); X+ #endif X #endif X } X /*}}} */ X*************** X*** 3611,3617 **** X--- 3649,4013 ---- X } X } X X+ #ifdef USE_XIM X+ /* PROTO */ X+ void X+ setSize( XRectangle *size ) X+ { X+ size->x = TermWin_internalBorder; X+ size->y = TermWin_internalBorder; X+ size->width = Width2Pixel (TermWin.ncol); X+ size->height = Height2Pixel(TermWin.nrow); X+ return; X+ } X+ X+ /* PROTO */ X+ void X+ setColor( unsigned long *fg, unsigned long *bg ) X+ { X+ *fg = PixColors[Color_fg]; X+ *bg = PixColors[Color_bg]; X+ return; X+ } X X+ /* PROTO */ X+ void X+ IMSendSpot( void ) X+ { X+ XPoint spot; X+ XVaNestedList preedit_attr; X+ XIMStyle input_style; X+ X+ if( Input_Context == NULL ) X+ return; X+ else { X+ XGetICValues(Input_Context,XNInputStyle,&input_style,NULL); X+ if (!(input_style & XIMPreeditPosition)) X+ return; X+ } X+ setPosition( &spot ); X+ X+ preedit_attr = XVaCreateNestedList( 0, XNSpotLocation, &spot, NULL ); X+ XSetICValues( Input_Context, XNPreeditAttributes, preedit_attr, NULL ); X+ XFree( preedit_attr ); X+ return; X+ } X+ X+ /* PROTO */ X+ void X+ setTermFontSet( void ) X+ { X+ char *string; X+ long length, i; X+ X+ if( TermWin.fontset != NULL ){ X+ XFreeFontSet( Xdisplay, TermWin.fontset ); X+ TermWin.fontset = NULL; X+ } X+ X+ length = 0; X+ for( i = 0 ; i < NFONTS ; i ++){ X+ if( rs_font[ i ] ) X+ length += strlen( rs_font[ i ] ) + 1; X+ # ifdef MULTICHAR_SET X+ if( rs_mfont[ i ] ) X+ length += strlen( rs_mfont[ i ] ) + 1; X+ # endif X+ } X+ if( ( string = malloc( length ) ) != NULL ){ X+ char **missing_charsetlist, *def_string; X+ int missing_charsetcount; X+ X+ string[ 0 ] = '\0'; X+ for( i = 0 ; i < NFONTS ; i ++){ X+ if( rs_font[ i ] ){ X+ strcat( string, rs_font[ i ] ); X+ strcat( string, "," ); X+ } X+ # ifdef MULTICHAR_SET X+ if( rs_mfont[ i ] ){ X+ strcat( string, rs_mfont[ i ] ); X+ strcat( string, "," ); X+ } X+ # endif X+ } X+ length = strlen( string ); X+ if( length > 0 && string[ length - 1 ] == ',' ){ X+ string[ length - 1 ] = '\0'; X+ length --; X+ } X+ if( length > 0 ){ X+ TermWin.fontset = XCreateFontSet X+ ( Xdisplay, string, X+ &missing_charsetlist, &missing_charsetcount, &def_string ); X+ } X+ free( string ); X+ } else { X+ TermWin.fontset = NULL; X+ } X+ return; X+ } X+ X+ /* PROTO */ X+ void X+ setPreeditArea(XRectangle *preedit_rect, XRectangle *status_rect, XRectangle *needed_rect) X+ { X+ preedit_rect->x = needed_rect->width X+ + (scrollbar_visible() && !(Options & Opt_scrollBar_right) X+ ? (SB_WIDTH + sb_shadow * 2) : 0); X+ preedit_rect->y = Height2Pixel(TermWin.nrow - 1) X+ + ((menuBar.state == 1) ? menuBar_TotalHeight() : 0); X+ X+ preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width X+ + (!(Options & Opt_scrollBar_right) X+ ? (SB_WIDTH + sb_shadow * 2) : 0); X+ preedit_rect->height = Height2Pixel(1); X+ X+ status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) X+ ? (SB_WIDTH + sb_shadow * 2) : 0; X+ status_rect->y = Height2Pixel(TermWin.nrow - 1) X+ + ((menuBar.state == 1) ? menuBar_TotalHeight() : 0); X+ X+ status_rect->width = needed_rect->width ? needed_rect->width X+ : Width2Pixel(TermWin.ncol + 1); X+ status_rect->height = Height2Pixel(1); X+ } X+ X+ /* PROTO */ X+ void X+ IMDestroyCallback(XIM xim, XPointer client_data, XPointer call_data) X+ { X+ Input_Context = NULL; X+ XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, IMInstantiateCallback, NULL); X+ } X+ X+ X+ /* PROTO */ X+ void X+ IMInstantiateCallback(Display *display, XPointer client_data, XPointer call_data) X+ { X+ char *p, *s, buf[64], tmp[1024]; X+ char *end, *next_s; X+ XIM xim = NULL; X+ XIMStyle input_style = 0; X+ XIMStyles *xim_styles = NULL; X+ int found; X+ XPoint spot; X+ XRectangle rect, status_rect, needed_rect; X+ unsigned long fg, bg; X+ XVaNestedList preedit_attr = NULL; X+ XVaNestedList status_attr = NULL; X+ XIMCallback ximcallback; X+ X+ Input_Context = NULL; X+ X+ if (Input_Context) X+ return; X+ X+ ximcallback.callback = IMDestroyCallback; X+ ximcallback.client_data = NULL; X+ X+ if (rs_inputMethod && *rs_inputMethod) { X+ STRNCPY(tmp, rs_inputMethod, sizeof(tmp) - 1); X+ for (s = tmp; *s; s = next_s + 1) { X+ for (; *s && isspace(*s); s++); X+ if (!*s) X+ break; X+ for (end = s; (*end && (*end != ',')); end++); X+ for (next_s = end--; ((end >= s) && isspace(*end)); end--); X+ *(end + 1) = '\0'; X+ X+ if (*s) { X+ STRCPY(buf, "@im="); X+ strncat(buf, s, sizeof(buf) - 4 - 1); X+ if ((p = XSetLocaleModifiers(buf)) != NULL && *p X+ && (xim = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL) X+ break; X+ } X+ if (!*next_s) X+ break; X+ } X+ } X+ X+ /* try with XMODIFIERS env. var. */ X+ if (xim == NULL && (p = XSetLocaleModifiers("")) != NULL && *p) X+ xim = XOpenIM(Xdisplay, NULL, NULL, NULL); X+ X+ /* try with no modifiers base */ X+ if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL && *p) X+ xim = XOpenIM(Xdisplay, NULL, NULL, NULL); X+ X+ if (xim == NULL) X+ return; X+ XSetIMValues(xim, XNDestroyCallback, &ximcallback, NULL); X+ X+ if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) X+ || !xim_styles) { X+ print_error("input method doesn't support any style"); X+ XCloseIM(xim); X+ return; X+ } X+ STRNCPY(tmp, (rs_preeditType ? rs_preeditType X+ : "OverTheSpot,OffTheSpot,Root"), X+ sizeof(tmp) - 1); X+ for (found = 0, s = tmp; *s && !found; s = next_s + 1) { X+ unsigned short i; X+ X+ for (; *s && isspace(*s); s++); X+ if (!*s) X+ break; X+ for (end = s; (*end && (*end != ',')); end++); X+ for (next_s = end--; ((end >= s) && isspace(*end)); end--); X+ *(end + 1) = '\0'; X+ X+ if (!strcmp(s, "OverTheSpot")) X+ input_style = (XIMPreeditPosition | XIMStatusNothing); X+ else if (!strcmp(s, "OffTheSpot")) X+ input_style = (XIMPreeditArea | XIMStatusArea); X+ else if (!strcmp(s, "Root")) X+ input_style = (XIMPreeditNothing | XIMStatusNothing); X+ X+ for (i = 0; i < xim_styles->count_styles; i++) X+ if (input_style == xim_styles->supported_styles[i]) { X+ found = 1; X+ break; X+ } X+ } X+ XFree(xim_styles); X+ X+ if (found == 0) { X+ print_error("input method doesn't support my preedit type"); X+ XCloseIM(xim); X+ return; X+ } X+ if ((input_style != (XIMPreeditNothing | XIMStatusNothing)) X+ && (input_style != (XIMPreeditArea | XIMStatusArea)) X+ && (input_style != (XIMPreeditPosition | XIMStatusNothing))) { X+ print_error("This program does not support the preedit type"); X+ XCloseIM(xim); X+ return; X+ } X+ if (input_style & XIMPreeditPosition) { X+ setSize(&rect); X+ setPosition(&spot); X+ setColor(&fg, &bg); X+ X+ preedit_attr = XVaCreateNestedList(0, XNArea, &rect, X+ XNSpotLocation, &spot, X+ XNForeground, fg, X+ XNBackground, bg, X+ XNFontSet, TermWin.fontset, X+ NULL); X+ } else if (input_style & XIMPreeditArea) { X+ setColor(&fg, &bg); X+ X+ /* X+ * The necessary width of preedit area is unknown X+ * until create input context. X+ */ X+ needed_rect.width = 0; X+ X+ setPreeditArea(&rect, &status_rect, &needed_rect); X+ X+ preedit_attr = XVaCreateNestedList(0, XNArea, &rect, X+ XNForeground, fg, X+ XNBackground, bg, X+ XNFontSet, TermWin.fontset, X+ NULL); X+ status_attr = XVaCreateNestedList(0, XNArea, &status_rect, X+ XNForeground, fg, X+ XNBackground, bg, X+ XNFontSet, TermWin.fontset, X+ NULL); X+ } X+ Input_Context = XCreateIC(xim, XNInputStyle, input_style, X+ XNClientWindow, TermWin.parent, X+ XNFocusWindow, TermWin.parent, X+ XNDestroyCallback, &ximcallback, X+ preedit_attr ? XNPreeditAttributes : NULL, X+ preedit_attr, X+ status_attr ? XNStatusAttributes : NULL, X+ status_attr, X+ NULL); X+ XFree(preedit_attr); X+ XFree(status_attr); X+ if (Input_Context == NULL) { X+ print_error("Failed to create input context"); X+ XCloseIM(xim); X+ } X+ if (input_style & XIMPreeditArea) X+ IMSetStatusPosition(); X+ } X+ X+ /* PROTO */ X+ void X+ IMSetStatusPosition(void) X+ { X+ XIMStyle input_style; X+ XRectangle rect, status_rect, *needed_rect; X+ XVaNestedList preedit_attr, status_attr; X+ X+ if (Input_Context == NULL) X+ return; X+ X+ XGetICValues(Input_Context, XNInputStyle, &input_style, NULL); X+ X+ if (input_style & XIMPreeditArea) { X+ status_attr = XVaCreateNestedList(0, XNAreaNeeded, &needed_rect, NULL); X+ XGetICValues(Input_Context, XNStatusAttributes, status_attr, NULL); X+ XFree(status_attr); X+ X+ rect.x = needed_rect->width; X+ if (menuBar.state == 1) { X+ rect.y = Height2Pixel(TermWin.nrow - 1) - menuBar_TotalHeight(); X+ } else { X+ rect.y = Height2Pixel(TermWin.nrow - 1); X+ } X+ if (Options & Opt_scrollBar_right) { X+ rect.width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width; X+ } else { X+ rect.width = Width2Pixel(TermWin.ncol + 1) + SB_WIDTH + SHADOW * 2 - needed_rect->width; X+ } X+ rect.height = needed_rect->height; X+ preedit_attr = XVaCreateNestedList(0, XNArea, &rect, NULL); X+ X+ if (scrollbar_visible()) { X+ if (Options & Opt_scrollBar_right) { X+ status_rect.x = 0; X+ } else { X+ status_rect.x = SB_WIDTH + SHADOW * 2; X+ } X+ } else { X+ status_rect.x = 0; X+ } X+ if (menuBar.state == 1) { X+ status_rect.y = Height2Pixel(TermWin.nrow - 1) + menuBar_TotalHeight(); X+ } else { X+ status_rect.y = Height2Pixel(TermWin.nrow - 1); X+ } X+ status_rect.width = needed_rect->width; X+ status_rect.height = needed_rect->height; X+ status_attr = XVaCreateNestedList(0, XNArea, &status_rect, NULL); X+ XSetICValues(Input_Context, X+ XNPreeditAttributes, preedit_attr, X+ XNStatusAttributes, status_attr, NULL); X+ XFree(preedit_attr); X+ XFree(status_attr); X+ } X+ } X+ X+ /* PROTO */ X+ void X+ XProcessEvent( Display *display ) X+ { X+ XEvent xev; X+ XNextEvent( display, &xev ); X+ if( !XFilterEvent( &xev, xev.xany.window ) ) X+ process_x_event( &xev ); X+ return; X+ } X+ X+ #endif X X /*}}} */ X /*----------------------- end-of-file (C source) -----------------------*/ Xdiff -cNr aterm-0.4.2.orig/src/feature.h aterm-0.4.2/src/feature.h X*** aterm-0.4.2.orig/src/feature.h Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/feature.h Sun Sep 30 14:38:03 2001 X*************** X*** 306,311 **** X--- 306,317 ---- X */ X #define SAVELINES 64 X X+ /* X+ * Default line space X+ */ X+ #define LINESPACE 0 X+ X+ X /* (Hops) Set to choose a number of lines of context between pages X * (rather than a proportion (1/5) of savedlines buffer) X * when paging the savedlines with SHIFT-{Prior,Next} keys. Xdiff -cNr aterm-0.4.2.orig/src/main.c aterm-0.4.2/src/main.c X*** aterm-0.4.2.orig/src/main.c Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/main.c Sun Sep 30 14:56:48 2001 X*************** X*** 901,906 **** X--- 901,909 ---- X X XResizeWindow(Xdisplay, TermWin.parent, width, height); X resize_window1(width, height); X+ #ifdef USE_XIM X+ IMSetStatusPosition(); X+ #endif X scr_clear(); X } X } X*************** X*** 1357,1363 **** X fw = TermWin.font->min_bounds.width; /* can be error !!!! */ X if( fw > 1000 ) fw = 0 ; /* added by suggestion from <suchness>*/ X X! fh = TermWin.font->ascent + TermWin.font->descent; X X if (TermWin.font->min_bounds.width == TermWin.font->max_bounds.width) X TermWin.fprop = 0; /* Mono-spaced (fixed width) font */ X--- 1360,1370 ---- X fw = TermWin.font->min_bounds.width; /* can be error !!!! */ X if( fw > 1000 ) fw = 0 ; /* added by suggestion from <suchness>*/ X X! #ifdef USE_LINESPACE X! fh = TermWin.font->ascent + TermWin.font->descent + TermWin.lineSpace; X! #else X! fh = TermWin.font->ascent + TermWin.font->descent; X! #endif X X if (TermWin.font->min_bounds.width == TermWin.font->max_bounds.width) X TermWin.fprop = 0; /* Mono-spaced (fixed width) font */ X*************** X*** 1624,1629 **** X--- 1631,1639 ---- X rs_geometry = NULL; /* window geometry */ X rs_minBufferWidth = NULL; X rs_saveLines = NULL; /* scrollback buffer [lines] */ X+ #ifdef USE_LINESPACE X+ rs_lineSpace = NULL; X+ #endif X rs_borderWidth = NULL; X rs_modifier = NULL; /* modifier */ X #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) X*************** X*** 1750,1755 **** X--- 1760,1769 ---- X TermWin.min_bcol = 1; X if (!rs_saveLines || (TermWin.saveLines = atoi(rs_saveLines)) < 0) X TermWin.saveLines = SAVELINES; X+ #ifdef USE_LINESPACE X+ if (!rs_lineSpace || (TermWin.lineSpace = atoi(rs_lineSpace)) < 0) X+ TermWin.lineSpace = LINESPACE; X+ #endif X if (!rs_borderWidth || (TermWin.borderWidth = atoi(rs_borderWidth)) < 0) X TermWin.borderWidth = BORDERWIDTH; X X*************** X*** 1797,1802 **** X--- 1811,1819 ---- X rs_mfont[i] = def_mfontName[i]; X #endif X } X+ #ifdef USE_XIM X+ TermWin.fontset = NULL; X+ #endif X X #ifdef XTERM_REVERSE_VIDEO X /* this is how xterm implements reverseVideo */ Xdiff -cNr aterm-0.4.2.orig/src/rxvt.h aterm-0.4.2/src/rxvt.h X*** aterm-0.4.2.orig/src/rxvt.h Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/rxvt.h Sun Sep 30 15:01:00 2001 X*************** X*** 266,271 **** X--- 266,274 ---- X ncol, nrow, /* window size [characters] */ X bcol, /* current number of columns in the buffer */ X min_bcol, /* minimum horizontal columns in the buffer */ X+ #ifdef USE_LINESPACE X+ lineSpace, /* linespace */ X+ #endif X focus, /* window has focus */ X saveLines, /* number of lines that fit in scrollback */ X borderWidth,/* number of pixels in window border */ X*************** X*** 280,285 **** X--- 283,291 ---- X #ifdef MULTICHAR_SET X XFontStruct *mfont; /* Multichar font structure */ X #endif X+ #ifdef USE_XIM X+ XFontSet fontset; X+ #endif X #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) X BackgroundInfo background; X #endif X*************** X*** 928,933 **** X--- 934,942 ---- X EXTERN const char *rs_geometry; /* window geometry */ X EXTERN const char *rs_minBufferWidth; /* minimum buffer width - so we can scroll horizontally */ X EXTERN const char *rs_saveLines; /* scrollback buffer [lines] */ X+ #ifdef USE_LINESPACE X+ EXTERN const char *rs_lineSpace; /* line space [pixels] */ X+ #endif X EXTERN const char *rs_borderWidth; /* border width [pixels] */ X EXTERN const char *rs_cutchars; /* chars for selection boundaries */ X #ifdef META8_OPTION X*************** X*** 948,953 **** X--- 957,966 ---- X #endif X #ifdef PRINTPIPE X EXTERN const char *rs_print_pipe; X+ #endif X+ #ifdef USE_XIM X+ EXTERN const char *rs_preeditType; X+ EXTERN const char *rs_inputMethod; X #endif X #ifndef NO_BRIGHTCOLOR X EXTERN unsigned int colorfgbg; Xdiff -cNr aterm-0.4.2.orig/src/screen.c aterm-0.4.2/src/screen.c X*** aterm-0.4.2.orig/src/screen.c Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/screen.c Sun Sep 30 15:03:36 2001 X*************** X*** 3439,3441 **** X--- 3439,3455 ---- X #endif X fprintf(stderr, "%s\n", name[color]); X } X+ X+ #ifdef USE_XIM X+ /* PROTO */ X+ void X+ setPosition(XPoint *pos) X+ { X+ XWindowAttributes xwa ; X+ X+ XGetWindowAttributes( Xdisplay, TermWin.vt, &xwa ) ; X+ pos->x = Col2Pixel ( screen.cur.col ) + xwa.x; X+ pos->y = Height2Pixel((screen.cur.row + 1)) + xwa.y; X+ return ; X+ } X+ #endif Xdiff -cNr aterm-0.4.2.orig/src/xdefaults.c aterm-0.4.2/src/xdefaults.c X*** aterm-0.4.2.orig/src/xdefaults.c Fri Sep 7 00:38:07 2001 X--- aterm-0.4.2/src/xdefaults.c Sun Sep 30 15:06:21 2001 X*************** X*** 276,281 **** X--- 276,286 ---- X STRG(rs_multichar_encoding, "multichar_encoding", "km", "mode", X "multiple-character font encoding; mode = eucj | sjis | big5"), X #endif /* MULTICHAR_SET */ X+ #ifdef USE_XIM X+ STRG(rs_preeditType, "preeditType", "pt", "style", X+ "input style of input method; style = OverTheSpot | OffTheSpot | Root"), X+ STRG(rs_inputMethod, "inputMethod", "im", "name", "name of input method"), X+ #endif /* USE_XIM */ X #ifdef GREEK_SUPPORT X STRG(rs_greek_keyboard, "greek_keyboard", "grk", "mode", X "greek keyboard mapping; mode = iso | ibm"), X*************** X*** 313,318 **** X--- 318,327 ---- X "minimum number of columns stored in buffer"), X STRG(rs_saveLines, "saveLines", "sl", "number", X "number of scrolled lines to save"), X+ #ifdef USE_LINESPACE X+ STRG(rs_lineSpace, "lineSpace", "lsp", "number", X+ "line space"), X+ #endif X BOOL(rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, X "utmp inhibit"), X BOOL(rs_visualBell, "visualBell", "vb", Opt_visualBell, "visual bell"), END-of-aterm/files/patch-aa exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110010331.f913V9b81555>