Subject: v17i033: MGR, Bellcore window manager, Part32/61 Newsgroups: comp.sources.unix Approved: rsalz@uunet.UU.NET Submitted-by: Stephen A. Uhler Posting-number: Volume 17, Issue 33 Archive-name: mgr/part32 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'font-16/Uoldeng22x30ru' <<'END_OF_FILE' Xbegin 644 oldeng22x30ru.fnt XM%A8>"%L@ @ XM XM /0 XP, 1 G_P XSQ!QB( !$ XW@!D #C, XW@#C> !$@> 1 XM "& /(P A@#R. _ ?@0#$8 (C P&# 8"(.(P! XM @ $ # " " ( XM XM !P XM ?X!_@^ (O __X! XM_G_#_'X B\!_OR"R '^8!_OP'^_( #ET_ _ ./ ?KZ #CP'JW !_P __P'E XM] 90>!&0.",9P#)X!&X8 [ $8X!&@^$;A@ 9\Y#B>!WCPCX< =X\( XM^#@$ _!'_@!T. /AP ?'1P.'@G,< __@ #P < XM & !QP < < !P XM $ ! $ H XM 'T 'P #Z /H . /^ ?X #_@ XM!] 'T !< #8.!F( #0. !@ "X@&80 ! XMX0 = "X !@< 'A !ITX#@(#.AP#H< SH< Z#@$ . $" !T. .AP ='1P'( XM '(< /_ #X < / !P < XM < !P < # , XM 0 XM ![X +@ ]\ #WP < ?\ !_P '_@ >^ ![X XM =. ,X.#.( '0. &@ ,X@,X@ &X = ,X &@( ;A #ITX#P( XM#.@X#H< SH. Z#@& $ (B !T. .AP ='1P'( '(< " XM !P < '@ !P < < !P XM < & 8 XM @ !PX #@ X< #AP < XM 0 !W@ _ <. !PX ^. .@ G \_@8\ >Z\ ] \X >FX![A 'OWX&X(..@<'O\#CH'! XMZ' 9_]PSB #W^ >_P ='1P/^ //\ ( < XM \ !P < 0 ! < !P XM < . X XM !PX #@ P< #!P T 0 !P $ XM<. !PX ' < $'!\[L..( ?0. ^OH!\_@X_@ ^ XM[@ !^ < XM < !P ?@ . X XM XM !PX #@ < !P !L XX !P ( <. !PX /@ ^ XM '_A\^...( ?0. ^_P!\_@XZ8 ^^\]!\^ 'WP ?_ XM !PX #@ #\ ' "< Y^ !WT 8 /\ "^X " ( XM /_P .@@ < "X #@ >< !P XM /WW _< !SH 'G0 !XX P ?^ 0X (! XMP<[^..( '0. .@@ X !P ''' << !QP #C@ << X !_@ < !QP # XMC@ ... #@ #C@ /P XM ( " !PX #@ 0 !P < . !PX #@ <. X " ( XM !P0<#".#P+ %P. /P@ 8X@,"8 .B8 9 !PX /A XM< _! #ITX'!X# @P#H< P(, \#@ (3 \"P!\. .AP ?'1P<' '(< 0 XM .. << !P '' > !P '#@ << X #@ X ' < '\@ XM _X /@ ^ /_ __\#_X@'#P _ XM^0'Q /\P _\.C__P?)TXO\X \O ?N\ /;P#_QT/_\ ?_ #_^@/_P _W_S_S XMH'(< __X '? N< "X@ +G ?$ "Y 'S@ ^< XMX #@ N> "Z /OG@^> "YP 'S@ N< Y #[@ N@ !SX #C@ ...!_R #C XM@ /\@ > ' XM "^ 'P _^ #_ ^ _X "^ !X O@ !_@ ' > XM >. ,\?P _X >/P!X/X'GP@#C !Y\0/^ >>@!XX/'@_@_RX=\ /_@ <8 < !P '< < ''' << > XM /\ '\ !> '^ ' #]P %\ 7]P#^\ #_@ ?_ XM * " , !@ X$ "" , XM P0 , @ # !! " * P$ %@' /( P#@# XM !P,!@@ \ # 8@(\ P' # 0&, ' C@0+@(8 #P 3L ^ ,! PPGP #R , XMB ! # 1 ,! @8'P# ?@ !$ " , @ #@ XM ( S0 (0 ( P "( ( """ (( ( +P "< , 8 " P@ XMP #C ",8 !@ ^ XM $ $ XM P !@ ( P # , @ # @( P # XM , @ #@ #H " , @@ " , # , 8 XM !P 0 X XM #@ < " XM ( XM ( @ XM! ( @ " ( @ " 0& @ " ( @ # #H " ( XM A " ( " ( 8 XM !P ( X #@ < XM "' XM XM @ ! ( @ " ( @ " XM 8!@ @ " ( 0 " #H # ( 1 " ( " ( XM 8'P P , XM 8 #@ < "/ XM@ XM XM @ ! ( @ " ( @ " < @ " ( 0 " XM #H #"( . " ( " ( /_X XM & P . 8 XM #@ < #_@ XM XM @ ! ( @ " XM " ( @ " < @ " ( ( , " #H #B( " ( XM " ( /_\ XM -A@ . 'P #@ > XM #X@ XM XM 0 @ 8 0 ! , $ !@ ! \ 0 ! XM $ P #@ ! #@ !\$ & $ ! $ 'X$ XM +7 > /@ XM # < !P@ XM XM , XM 9 X , PP # #@ P X , P ## P #0 \# XM . # P # $ XM N < / " 8 XM @ XM XM # & 0 # / P! , XM P # , \ , " 8 P $ P , P XM 8 8 XM ) $ 0 # X& X Xend END_OF_FILE # end of 'font-16/Uoldeng22x30ru' fi if test -f 'font-32/Uoldeng22x30r' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-32/Uoldeng22x30r'\" else echo shar: Extracting \"'font-32/Uoldeng22x30r'\" \(10459 characters\) sed "s/^X//" >'font-32/Uoldeng22x30r' <<'END_OF_FILE' Xbegin 644 oldeng22x30r.fnt XM&!8>"%L@ @ XM XM /0 XP, 1 G_P XSQ!QB( !$ XW@!D #C, XW@#C> !$@> 1 XM "& /(P A@#R. _ ?@0#$8 (C P&# 8"(.(P! XM @ $ # " " ( XM XM !P XM ?X!_@^ (O __X! XM_G_#_'X B\!_OR"R '^8!_OP'^_( #ET_ _ ./ ?KZ #CP'JW !_P __P'E XM] 90>!&0.",9P#)X!&X8 [ $8X!&@^$;A@ 9\Y#B>!WCPCX< =X\( XM^#@$ _!'_@!T. /AP ?'1P.'@G,< __@ #P < XM & !QP < < !P XM $ ! $ H XM 'T 'P #Z /H . /^ ?X #_@ XM!] 'T !< #8.!F( #0. !@ "X@&80 ! XMX0 = "X !@< 'A !ITX#@(#.AP#H< SH< Z#@$ . $" !T. .AP ='1P'( XM '(< /_ #X < / !P < XM < !P < # , XM 0 XM ![X +@ ]\ #WP < ?\ !_P '_@ >^ ![X XM =. ,X.#.( '0. &@ ,X@,X@ &X = ,X &@( ;A #ITX#P( XM#.@X#H< SH. Z#@& $ (B !T. .AP ='1P'( '(< " XM !P < '@ !P < < !P XM < & 8 XM @ !PX #@ X< #AP < XM 0 !W@ _ <. !PX ^. .@ G \_@8\ >Z\ ] \X >FX![A 'OWX&X(..@<'O\#CH'! XMZ' 9_]PSB #W^ >_P ='1P/^ //\ ( < XM \ !P < 0 ! < !P XM < . X XM !PX #@ P< #!P T 0 !P $ XM<. !PX ' < $'!\[L..( ?0. ^OH!\_@X_@ ^ XM[@ !^ < XM < !P ?@ . X XM XM !PX #@ < !P !L XX !P ( <. !PX /@ ^ XM '_A\^...( ?0. ^_P!\_@XZ8 ^^\]!\^ 'WP ?_ XM !PX #@ #\ ' "< Y^ !WT 8 /\ "^X " ( XM /_P .@@ < "X #@ >< !P XM /WW _< !SH 'G0 !XX P ?^ 0X (! XMP<[^..( '0. .@@ X !P ''' << !QP #C@ << X !_@ < !QP # XMC@ ... #@ #C@ /P XM ( " !PX #@ 0 !P < . !PX #@ <. X " ( XM !P0<#".#P+ %P. /P@ 8X@,"8 .B8 9 !PX /A XM< _! #ITX'!X# @P#H< P(, \#@ (3 \"P!\. .AP ?'1P<' '(< 0 XM .. << !P '' > !P '#@ << X #@ X ' < '\@ XM _X /@ ^ /_ __\#_X@'#P _ XM^0'Q /\P _\.C__P?)TXO\X \O ?N\ /;P#_QT/_\ ?_ #_^@/_P _W_S_S XMH'(< __X '? N< "X@ +G ?$ "Y 'S@ ^< XMX #@ N> "Z /OG@^> "YP 'S@ N< Y #[@ N@ !SX #C@ ...!_R #C XM@ /\@ > ' XM "^ 'P _^ #_ ^ _X "^ !X O@ !_@ ' > XM >. ,\?P _X >/P!X/X'GP@#C !Y\0/^ >>@!XX/'@_@_RX=\ /_@ <8 < !P '< < ''' << > XM /\ '\ !> '^ ' #]P %\ 7]P#^\ #_@ ?_ XM * " , !@ X$ "" , XM P0 , @ # !! " * P$ %@' /( P#@# XM !P,!@@ \ # 8@(\ P' # 0&, ' C@0+@(8 #P 3L ^ ,! PPGP #R , XMB ! # 1 ,! @8'P# ?@ !$ " , @ #@ XM ( S0 (0 ( P "( ( """ (( ( +P "< , 8 " P@ XMP #C ",8 !@ ^ XM $ $ XM P !@ ( P # , @ # @( P # XM , @ #@ #H " , @@ " , # , 8 XM !P 0 X XM #@ < " XM ( XM ( @ XM! ( @ " ( @ " 0& @ " ( @ # #H " ( XM A " ( " ( 8 XM !P ( X #@ < XM "' XM XM @ ! ( @ " ( @ " XM 8!@ @ " ( 0 " #H # ( 1 " ( " ( XM 8'P P , XM 8 #@ < "/ XM@ XM XM @ ! ( @ " ( @ " < @ " ( 0 " XM #H #"( . " ( " ( /_X XM & P . 8 XM #@ < #_@ XM XM @ ! ( @ " XM " ( @ " < @ " ( ( , " #H #B( " ( XM " ( /_\ XM -A@ . 'P #@ > XM #X@ XM XM 0 @ 8 0 ! , $ !@ ! \ 0 ! XM $ P #@ ! #@ !\$ & $ ! $ 'X$ XM +7 > /@ XM # < !P@ XM XM , XM 9 X , PP # #@ P X , P ## P #0 \# XM . # P # $ XM N < / " 8 XM @ XM XM # & 0 # / P! , XM P # , \ , " 8 P $ P , P XM 8 8 XM ) $ 0 # X& X Xend END_OF_FILE # end of 'font-32/Uoldeng22x30r' fi if test -f 'font-32/Uoldeng22x30ru' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-32/Uoldeng22x30ru'\" else echo shar: Extracting \"'font-32/Uoldeng22x30ru'\" \(10460 characters\) sed "s/^X//" >'font-32/Uoldeng22x30ru' <<'END_OF_FILE' Xbegin 644 oldeng22x30ru.fnt XM&!8>"%L@ @ XM XM /0 XP, 1 G_P XSQ!QB( !$ XW@!D #C, XW@#C> !$@> 1 XM "& /(P A@#R. _ ?@0#$8 (C P&# 8"(.(P! XM @ $ # " " ( XM XM !P XM ?X!_@^ (O __X! XM_G_#_'X B\!_OR"R '^8!_OP'^_( #ET_ _ ./ ?KZ #CP'JW !_P __P'E XM] 90>!&0.",9P#)X!&X8 [ $8X!&@^$;A@ 9\Y#B>!WCPCX< =X\( XM^#@$ _!'_@!T. /AP ?'1P.'@G,< __@ #P < XM & !QP < < !P XM $ ! $ H XM 'T 'P #Z /H . /^ ?X #_@ XM!] 'T !< #8.!F( #0. !@ "X@&80 ! XMX0 = "X !@< 'A !ITX#@(#.AP#H< SH< Z#@$ . $" !T. .AP ='1P'( XM '(< /_ #X < / !P < XM < !P < # , XM 0 XM ![X +@ ]\ #WP < ?\ !_P '_@ >^ ![X XM =. ,X.#.( '0. &@ ,X@,X@ &X = ,X &@( ;A #ITX#P( XM#.@X#H< SH. Z#@& $ (B !T. .AP ='1P'( '(< " XM !P < '@ !P < < !P XM < & 8 XM @ !PX #@ X< #AP < XM 0 !W@ _ <. !PX ^. .@ G \_@8\ >Z\ ] \X >FX![A 'OWX&X(..@<'O\#CH'! XMZ' 9_]PSB #W^ >_P ='1P/^ //\ ( < XM \ !P < 0 ! < !P XM < . X XM !PX #@ P< #!P T 0 !P $ XM<. !PX ' < $'!\[L..( ?0. ^OH!\_@X_@ ^ XM[@ !^ < XM < !P ?@ . X XM XM !PX #@ < !P !L XX !P ( <. !PX /@ ^ XM '_A\^...( ?0. ^_P!\_@XZ8 ^^\]!\^ 'WP ?_ XM !PX #@ #\ ' "< Y^ !WT 8 /\ "^X " ( XM /_P .@@ < "X #@ >< !P XM /WW _< !SH 'G0 !XX P ?^ 0X (! XMP<[^..( '0. .@@ X !P ''' << !QP #C@ << X !_@ < !QP # XMC@ ... #@ #C@ /P XM ( " !PX #@ 0 !P < . !PX #@ <. X " ( XM !P0<#".#P+ %P. /P@ 8X@,"8 .B8 9 !PX /A XM< _! #ITX'!X# @P#H< P(, \#@ (3 \"P!\. .AP ?'1P<' '(< 0 XM .. << !P '' > !P '#@ << X #@ X ' < '\@ XM _X /@ ^ /_ __\#_X@'#P _ XM^0'Q /\P _\.C__P?)TXO\X \O ?N\ /;P#_QT/_\ ?_ #_^@/_P _W_S_S XMH'(< __X '? N< "X@ +G ?$ "Y 'S@ ^< XMX #@ N> "Z /OG@^> "YP 'S@ N< Y #[@ N@ !SX #C@ ...!_R #C XM@ /\@ > ' XM "^ 'P _^ #_ ^ _X "^ !X O@ !_@ ' > XM >. ,\?P _X >/P!X/X'GP@#C !Y\0/^ >>@!XX/'@_@_RX=\ /_@ <8 < !P '< < ''' << > XM /\ '\ !> '^ ' #]P %\ 7]P#^\ #_@ ?_ XM * " , !@ X$ "" , XM P0 , @ # !! " * P$ %@' /( P#@# XM !P,!@@ \ # 8@(\ P' # 0&, ' C@0+@(8 #P 3L ^ ,! PPGP #R , XMB ! # 1 ,! @8'P# ?@ !$ " , @ #@ XM ( S0 (0 ( P "( ( """ (( ( +P "< , 8 " P@ XMP #C ",8 !@ ^ XM $ $ XM P !@ ( P # , @ # @( P # XM , @ #@ #H " , @@ " , # , 8 XM !P 0 X XM #@ < " XM ( XM ( @ XM! ( @ " ( @ " 0& @ " ( @ # #H " ( XM A " ( " ( 8 XM !P ( X #@ < XM "' XM XM @ ! ( @ " ( @ " XM 8!@ @ " ( 0 " #H # ( 1 " ( " ( XM 8'P P , XM 8 #@ < "/ XM@ XM XM @ ! ( @ " ( @ " < @ " ( 0 " XM #H #"( . " ( " ( /_X XM & P . 8 XM #@ < #_@ XM XM @ ! ( @ " XM " ( @ " < @ " ( ( , " #H #B( " ( XM " ( /_\ XM -A@ . 'P #@ > XM #X@ XM XM 0 @ 8 0 ! , $ !@ ! \ 0 ! XM $ P #@ ! #@ !\$ & $ ! $ 'X$ XM +7 > /@ XM # < !P@ XM XM , XM 9 X , PP # #@ P X , P ## P #0 \# XM . # P # $ XM N < / " 8 XM @ XM XM # & 0 # / P! , XM P # , \ , " 8 P $ P , P XM 8 8 XM ) $ 0 # X& X Xend END_OF_FILE # end of 'font-32/Uoldeng22x30ru' fi if test -f 'src/do_event.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/do_event.c'\" else echo shar: Extracting \"'src/do_event.c'\" \(10301 characters\) sed "s/^X//" >'src/do_event.c' <<'END_OF_FILE' X/* Copyright (c) 1987 Bellcore X * All Rights Reserved X * Permission is granted to copy or use this program, EXCEPT that it X * may not be sold for profit, the copyright notice must be reproduced X * on copies, and credit should be given to Bellcore where it is due. X * BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. X */ X/* $Header: do_event.c,v 4.1 88/06/21 13:21:44 bianchi Exp $ X $Source: /tmp/mgrsrc/src/RCS/do_event.c,v $ X*/ Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/do_event.c,v $$Revision: 4.1 $"; X X/* do a button event */ X X#include X#include "bitmap.h" X#include "defs.h" X#include "font.h" X#include "event.h" X X#define FSIZE(c) ((int) (W(font)->head.c)) /* from put_window.c */ X#define SUB_SIZE 256 /* max temp str size */ X#define START_SIZE 16 /* default starting size of sweep object */ X Xdo_event(event,win,flag) Xint event; /* event number */ Xregister WINDOW *win; /* window event applies to */ Xint flag; /* type of window */ X { X register char *buff, *p; X char *index(); X X if (!win) X return(-1); X X#ifdef DEBUG X dprintf(e)(stderr,"%s: event %d (%s) %s\r\n",W(tty),GET_EVENT(event), X IS_EVENT(win,event)?"ON":"OFF",flag==E_MAIN ? "MAIN":"STACK"); X#endif X X /* look for stacked events */ X X if (IS_EVENT(win,EVENT_STFLAG)) X do_event(event,win->stack,E_STACK); X X if (IS_EVENT(win,event) && (flag==E_MAIN || IS_EVENT(win,EVENT_STACK))) { X X#ifdef DEBUG X dprintf(e)(stderr,"\tSENT\r\n"); X#endif X X /* do the event */ X X switch(event) { X case EVENT_B1_DOWN: X case EVENT_B2_DOWN: X if (IS_EVENT(win,event) && (buff= W(events[GET_EVENT(event)]))) X write_event(win,buff,E_LIST_BUTTON); X X /* notify clicked window */ X X for(win=active;win != (WINDOW *) 0;win=W(next)) X if(mousein(mousex,mousey,win,1)) X break; X if (win && IS_EVENT(win,EVENT_TELLME) X && (buff= W(events[GET_EVENT(EVENT_TELLME)]))) { X if (message) { X free(message); X message = (char *) 0; X } X id_message = ACTIVE(pid); X write_event(win,buff,E_LIST_ACCEPT); X } X break; X case EVENT_PASTE: X if (IS_EVENT(win,event) && (buff= W(events[GET_EVENT(event)]))) X write_event(win,buff,E_LIST_PASTE); X break; X case EVENT_SNARFED: X if (IS_EVENT(win,event) && (buff= W(events[GET_EVENT(event)]))) X write_event(win,buff,E_LIST_SNARF); X break; X case EVENT_BSYS_DOWN: /* No events for System Button, down or up. */ X case EVENT_BSYS_UP: X break; X case EVENT_SHAPE: X case EVENT_MOVE: X case EVENT_DESTROY: X case EVENT_REDRAW: X case EVENT_COVERED: X case EVENT_UNCOVERED: X case EVENT_B1_UP: X case EVENT_B2_UP: X case EVENT_DEACTIVATED: X case EVENT_ACTIVATED: X buff = W(events[GET_EVENT(event)]); X if (buff && *buff) { X Write(W(to_fd),buff,strlen(buff)); X#ifdef DEBUG X dprintf(e)(stderr," sending %d [%s]\r\n",strlen(buff),buff); X#endif X } X#ifdef DEBUG X else X dprintf(e)(stderr," oops! nothing to send\r\n"); X#endif X break; X case EVENT_ACCEPT: X if (mode_ok(W(tty),MSG_MODEMASK) && X message && (buff= W(events[GET_EVENT(event)]))) { X#ifdef DEBUG X dprintf(e)(stderr," accept: %d: [%s]\r\n",strlen(buff),buff); X dprintf(c)(stderr," sent %d->%d: %s\r\n", X id_message,W(pid),message); X#endif X write_event(win,buff,E_LIST_ACCEPT); X } X#ifdef DEBUG X else { X dprintf(c)(stderr,"%d: can't send [%s] to %s\r\n", X id_message,message?message:"??",W(tty)); X dprintf(e)(stderr," reject accept: %s %s %s\r\n", X mode_ok(W(tty),MSG_MODEMASK) ? "OK" : X "BAD_MODE", X message?message:"NO MESSAGE", X buff?buff:"NO EVENT"); X } X#endif X break; X#ifdef DEBUG X default: X dprintf(e)(stderr," oops! unknown event\r\n"); X#endif X } /* end switch */ X } X return(0); X } X X/* substitute %x into str, returns true if an area was swept. */ X Xint Xsub_event(win,str,c,swept,count,args) Xregister WINDOW *win; Xregister char *str,c; Xint swept; /* if swept, don't do sweeps */ Xint count; /* # of sweep args */ Xint *args; /* the arg list */ X { X int sweep = 0; X static int x,y; X char *get_id(), *sprintf(); X int code; /* for text sweeping */ X X X#ifdef DEBUG X if (debug) { X register int i; X dprintf(e)(stderr,"%s) event (%c) args:",W(tty),c); X for(i=0;i=2) { X x = args[0]; X y = args[1]; X } X else if (c == E_SWTEXT || c == E_SWTEXTT) { X x = 1; X y = 0; X } X else { X x = START_SIZE; X y = START_SIZE; X } X#ifdef DEBUG X dprintf(e)(stderr,"initial sweep (x,y) = (%d,%d)\r\n",x,y); X#endif X count = 0; X } X X switch(c) { X case E_CPOS: /* return mouse position (rows/cols) */ X sprintf(str,"%d %d",(mousex-(W(x0)+W(text).x))/FSIZE(wide), X (mousey-(W(y0)+W(text).y))/FSIZE(high)); X break; X case E_POS: /* return mouse position */ X if (W(flags)&W_ABSCOORDS) X sprintf(str,"%d %d",mousex-W(x0),mousey-W(y0)); X else X sprintf(str,"%d %d", (mousex-W(x0))*GMAX/BIT_WIDE(W(window)), X (mousey-W(y0))*GMAX/BIT_HIGH(W(window))); X break; X case E_SWLINE: /* sweep out line */ X sweep++; X if (!swept) X get_rect(screen,mouse,mousex,mousey,&x,&y,1); X sprintf(str,"%d %d %d %d",mousex-W(x0),mousey-W(y0), X mousex+x-W(x0),mousey+y-W(y0)); X break; X case E_SWRECT: /* sweep out rectangle */ X sweep++; X if (!swept) X get_rect(screen,mouse,mousex,mousey,&x,&y,0); X sprintf(str,"%d %d %d %d",mousex-W(x0),mousey-W(y0), X mousex+x-W(x0),mousey+y-W(y0)); X break; X case E_SWRECTA: /* sweep out rectangle */ X sweep++; X if (!swept) X get_rect(screen,mouse,mousex,mousey,&x,&y,0); X sprintf(str,"%d %d %d %d",mousex,mousey, X mousex+x,mousey+y); X break; X case E_SWBOX: /* sweep out box */ X sweep++; X if (!swept) X move_box(screen,mouse,&mousex,&mousey,x,y,1); X sprintf(str,"%d %d",mousex-W(x0),mousey-W(y0)); X break; X case E_SWBOXA: /* sweep out box */ X sweep++; X if (!swept) X move_box(screen,mouse,&mousex,&mousey,x,y,1); X sprintf(str,"%d %d",mousex,mousey); X break; X case E_SWTEXTT: /* sweep out text */ X case E_SWTEXT: /* sweep out text */ X sweep++; X code = 0; X if (!swept) X code = get_text(screen,mouse,mousex,mousey,&x,&y,win,c); X sprintf(str,code ? "%d %d %d %d" : "", X (mousex-(W(x0)+W(text.x)))/FSIZE(wide), X (mousey-(W(y0)+W(text.y)))/FSIZE(high), X x,y); X break; X case E_NOTIFY: /* get other windows notify text */ X for(win=active;win != (WINDOW *) 0;win=W(next)) { X if (mousein(mousex,mousey,win,1)) X break; X } X if (win && IS_EVENT(win,EVENT_NOTIFY)) X sprintf(str,"%.*s",SUB_SIZE-1,W(events[GET_EVENT(EVENT_NOTIFY)])); X else X sprintf(str,""); X break; X case E_WHO: /* send other windows id */ X for(win=active;win != (WINDOW *) 0;win=W(next)) { X if (mousein(mousex,mousey,win,1)) X break; X } X if (win) X sprintf(str,"%.*s",SUB_SIZE-1,get_id(win)); X else X sprintf(str,""); X break; X case E_WHOSIZE: /* send other windows size */ X for(win=active;win != (WINDOW *) 0;win=W(next)) { X if (mousein(mousex,mousey,win,1)) X break; X } X if (win) X sprintf(str,"%d %d %d %d", X W(x0),W(y0),BIT_WIDE(W(border)),BIT_HIGH(W(border))); X else X sprintf(str,""); X break; X case E_FROM: /* see who message is from */ X sprintf(str,"%d",id_message); X break; X case E_MESS: X if (message) X sprintf(str,"%.*s",SUB_SIZE-1,message); X else X *str = '\0'; X break; X case E_MSGSIZE: X sprintf(str,"%d",message ? strlen(message) : 0); X break; X case E_SNARFSIZE: /* size of snarf buffer */ X sprintf(str,"%d",snarf ? strlen(snarf) : 0); X break; X case E_SNARFBUF: /* contents of snarf buffer */ X if (snarf) X sprintf(str,"%.*s",SUB_SIZE-1,snarf); X else X *str = '\0'; X break; X case E_ESC: /* the escape char */ X strcpy(str,"%"); X break; X } X return(sweep); X } X X/* write the event to a process */ X Xwrite_event(win,str,list) XWINDOW *win; /* window to get info about */ Xchar *str; /* event string */ Xchar *list; /* list of valid event chars */ X { X char *index(); X char data[SUB_SIZE]; X int args[4]; /* arguments to sweep event */ X int count; /* # of args */ X register char *start; X char *end, *event_args(); X int swept = 0; /* already did a sweep */ X X for(start=str;*start && (end=index(start,E_ESC));start=end+1) { X#ifdef DEBUG X dprintf(e)(stderr," sending %d [%s]\r\n",strlen(str),str); X#endif X if (end>start) X Write(W(to_fd),start,end-start); X end = event_args(end,&count,args); X if (index(list,*end)) { X swept += sub_event(win,data,*end,swept,count,args); X Write(W(to_fd),data,strlen(data)); X } X } X if (*start) X Write(W(to_fd),start,strlen(start)); X if( swept ) X /* If we swept something, the button was down and is now up. Notify X do_button(). */ X do_button(0); X } X X/* extract numeric argument from sweep events */ X Xchar * Xevent_args(str,count,args) Xchar *str; /* beginning of args */ Xint *count; /* # of args */ Xint *args; /* where to put args */ X { X register char c, *pntr = str; /* 1st char of args */ X X while ((c = *++pntr) >= '0' && c <= '9' || c==',' || c=='-') X ; X *count = sscanf(str+1,"%d,%d,%d,%d",args,args+1,args+2,args+3); X return(pntr); X } X X/* compute a unique window id */ X Xchar * Xget_id(win) Xregister WINDOW *win; X { X int sub = W(num); /* subwindow number */ X int main = W(pid); /* main window id */ X static char buff[6]; X char *sprintf(); X X return(sprintf(buff,"%d.%d",main,sub)); X } END_OF_FILE # end of 'src/do_event.c' fi echo shar: End of archive 32 \(of 61\). cp /dev/null ark32isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \ 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 \ 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 \ 55 56 57 58 59 60 61 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 61 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0