home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume9 / xterm / part06 < prev    next >
SHell self-extracting ARchive  |  1987-04-20  |  61.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 30 39 69 30 35 |Subject:| v09i05|
|00000010| 39 3a 20 20 54 65 72 6d | 69 6e 61 6c 20 65 6d 75 |9: Term|inal emu|
|00000020| 6c 61 74 6f 72 20 66 6f | 72 20 58 20 77 69 6e 64 |lator fo|r X wind|
|00000030| 6f 77 20 73 79 73 74 65 | 6d 2c 20 50 61 72 74 30 |ow syste|m, Part0|
|00000040| 36 2f 30 37 0a 4e 65 77 | 73 67 72 6f 75 70 73 3a |6/07.New|sgroups:|
|00000050| 20 6d 6f 64 2e 73 6f 75 | 72 63 65 73 0a 41 70 70 | mod.sou|rces.App|
|00000060| 72 6f 76 65 64 3a 20 72 | 73 40 6d 69 72 72 6f 72 |roved: r|s@mirror|
|00000070| 2e 54 4d 43 2e 43 4f 4d | 0a 0a 53 75 62 6d 69 74 |.TMC.COM|..Submit|
|00000080| 74 65 64 20 62 79 3a 20 | 65 64 6d 6f 79 40 6f 70 |ted by: |edmoy@op|
|00000090| 61 6c 2e 42 65 72 6b 65 | 6c 65 79 2e 45 44 55 0a |al.Berke|ley.EDU.|
|000000a0| 4d 6f 64 2e 73 6f 75 72 | 63 65 73 3a 20 56 6f 6c |Mod.sour|ces: Vol|
|000000b0| 75 6d 65 20 39 2c 20 49 | 73 73 75 65 20 35 39 0a |ume 9, I|ssue 59.|
|000000c0| 41 72 63 68 69 76 65 2d | 6e 61 6d 65 3a 20 78 74 |Archive-|name: xt|
|000000d0| 65 72 6d 36 2e 36 62 2f | 50 61 72 74 30 36 0a 0a |erm6.6b/|Part06..|
|000000e0| 23 21 20 2f 62 69 6e 2f | 73 68 0a 23 20 54 68 69 |#! /bin/|sh.# Thi|
|000000f0| 73 20 69 73 20 61 20 73 | 68 65 6c 6c 20 61 72 63 |s is a s|hell arc|
|00000100| 68 69 76 65 2c 20 6d 65 | 61 6e 69 6e 67 3a 0a 23 |hive, me|aning:.#|
|00000110| 20 31 2e 20 52 65 6d 6f | 76 65 20 65 76 65 72 79 | 1. Remo|ve every|
|00000120| 74 68 69 6e 67 20 61 62 | 6f 76 65 20 74 68 65 20 |thing ab|ove the |
|00000130| 23 21 20 2f 62 69 6e 2f | 73 68 20 6c 69 6e 65 2e |#! /bin/|sh line.|
|00000140| 0a 23 20 32 2e 20 53 61 | 76 65 20 74 68 65 20 72 |.# 2. Sa|ve the r|
|00000150| 65 73 75 6c 74 69 6e 67 | 20 74 65 78 74 20 69 6e |esulting| text in|
|00000160| 20 61 20 66 69 6c 65 2e | 0a 23 20 33 2e 20 45 78 | a file.|.# 3. Ex|
|00000170| 65 63 75 74 65 20 74 68 | 65 20 66 69 6c 65 20 77 |ecute th|e file w|
|00000180| 69 74 68 20 2f 62 69 6e | 2f 73 68 20 28 6e 6f 74 |ith /bin|/sh (not|
|00000190| 20 63 73 68 29 20 74 6f | 20 63 72 65 61 74 65 20 | csh) to| create |
|000001a0| 74 68 65 20 66 69 6c 65 | 73 3a 0a 23 09 69 6e 70 |the file|s:.#.inp|
|000001b0| 75 74 2e 63 20 6d 65 6e | 75 2e 68 20 6d 69 73 63 |ut.c men|u.h misc|
|000001c0| 2e 63 20 72 65 73 69 7a | 65 2e 63 20 73 63 72 65 |.c resiz|e.c scre|
|000001d0| 65 6e 2e 63 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |en.c.if |test -f |
|000001e0| 69 6e 70 75 74 2e 63 0a | 74 68 65 6e 0a 09 65 63 |input.c.|then..ec|
|000001f0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|00000200| 74 20 6f 76 65 72 77 72 | 69 74 65 20 65 78 69 73 |t overwr|ite exis|
|00000210| 74 69 6e 67 20 66 69 6c | 65 20 22 27 69 6e 70 75 |ting fil|e "'inpu|
|00000220| 74 2e 63 27 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |t.c'".el|se.echo |
|00000230| 27 78 20 2d 20 69 6e 70 | 75 74 2e 63 27 0a 63 61 |'x - inp|ut.c'.ca|
|00000240| 74 20 3c 3c 20 5c 52 41 | 5a 5a 4c 45 21 44 41 5a |t << \RA|ZZLE!DAZ|
|00000250| 5a 4c 45 20 3e 20 69 6e | 70 75 74 2e 63 0a 2f 2a |ZLE > in|put.c./*|
|00000260| 0a 20 2a 09 24 53 6f 75 | 72 63 65 3a 20 2f 75 31 |. *.$Sou|rce: /u1|
|00000270| 2f 58 2f 78 74 65 72 6d | 2f 52 43 53 2f 69 6e 70 |/X/xterm|/RCS/inp|
|00000280| 75 74 2e 63 2c 76 20 24 | 0a 20 2a 09 24 48 65 61 |ut.c,v $|. *.$Hea|
|00000290| 64 65 72 3a 20 69 6e 70 | 75 74 2e 63 2c 76 20 31 |der: inp|ut.c,v 1|
|000002a0| 30 2e 31 30 30 20 38 36 | 2f 31 32 2f 30 31 20 31 |0.100 86|/12/01 1|
|000002b0| 34 3a 34 34 3a 30 34 20 | 6a 67 20 52 65 6c 20 24 |4:44:04 |jg Rel $|
|000002c0| 0a 20 2a 2f 0a 0a 23 69 | 66 6e 64 65 66 20 6c 69 |. */..#i|fndef li|
|000002d0| 6e 74 0a 73 74 61 74 69 | 63 20 63 68 61 72 20 2a |nt.stati|c char *|
|000002e0| 72 63 73 69 64 5f 69 6e | 70 75 74 5f 63 20 3d 20 |rcsid_in|put_c = |
|000002f0| 22 24 48 65 61 64 65 72 | 3a 20 69 6e 70 75 74 2e |"$Header|: input.|
|00000300| 63 2c 76 20 31 30 2e 31 | 30 30 20 38 36 2f 31 32 |c,v 10.1|00 86/12|
|00000310| 2f 30 31 20 31 34 3a 34 | 34 3a 30 34 20 6a 67 20 |/01 14:4|4:04 jg |
|00000320| 52 65 6c 20 24 22 3b 0a | 23 65 6e 64 69 66 09 6c |Rel $";.|#endif.l|
|00000330| 69 6e 74 0a 0a 23 69 6e | 63 6c 75 64 65 20 3c 58 |int..#in|clude <X|
|00000340| 2f 6d 69 74 2d 63 6f 70 | 79 72 69 67 68 74 2e 68 |/mit-cop|yright.h|
|00000350| 3e 0a 0a 2f 2a 20 43 6f | 70 79 72 69 67 68 74 20 |>../* Co|pyright |
|00000360| 20 20 20 4d 61 73 73 61 | 63 68 75 73 65 74 74 73 | Massa|chusetts|
|00000370| 20 49 6e 73 74 69 74 75 | 74 65 20 6f 66 20 54 65 | Institu|te of Te|
|00000380| 63 68 6e 6f 6c 6f 67 79 | 20 20 20 20 31 39 38 34 |chnology| 1984|
|00000390| 2c 20 31 39 38 35 09 2a | 2f 0a 0a 2f 2a 20 69 6e |, 1985.*|/../* in|
|000003a0| 70 75 74 2e 63 20 2a 2f | 0a 0a 23 69 66 6e 64 65 |put.c */|..#ifnde|
|000003b0| 66 20 6c 69 6e 74 0a 73 | 74 61 74 69 63 20 63 68 |f lint.s|tatic ch|
|000003c0| 61 72 20 73 63 63 73 5f | 69 64 5b 5d 20 3d 20 22 |ar sccs_|id[] = "|
|000003d0| 40 28 23 29 69 6e 70 75 | 74 2e 63 5c 74 58 31 30 |@(#)inpu|t.c\tX10|
|000003e0| 2f 36 2e 36 42 5c 74 31 | 32 2f 32 36 2f 38 36 22 |/6.6B\t1|2/26/86"|
|000003f0| 3b 0a 23 65 6e 64 69 66 | 09 6c 69 6e 74 0a 0a 23 |;.#endif|.lint..#|
|00000400| 69 6e 63 6c 75 64 65 20 | 3c 58 2f 58 6c 69 62 2e |include |<X/Xlib.|
|00000410| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 58 2f 58 |h>.#incl|ude <X/X|
|00000420| 6b 65 79 62 6f 61 72 64 | 2e 68 3e 0a 23 69 6e 63 |keyboard|.h>.#inc|
|00000430| 6c 75 64 65 20 22 73 63 | 72 6f 6c 6c 62 61 72 2e |lude "sc|rollbar.|
|00000440| 68 22 0a 23 69 6e 63 6c | 75 64 65 20 22 70 74 79 |h".#incl|ude "pty|
|00000450| 78 2e 68 22 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |x.h".#in|clude <s|
|00000460| 74 64 69 6f 2e 68 3e 0a | 0a 73 74 61 74 69 63 20 |tdio.h>.|.static |
|00000470| 63 68 61 72 20 2a 6b 79 | 70 64 5f 6e 75 6d 20 3d |char *ky|pd_num =|
|00000480| 20 22 30 78 2e 5c 72 31 | 32 33 34 35 36 2c 37 38 | "0x.\r1|23456,78|
|00000490| 39 2d 22 3b 0a 73 74 61 | 74 69 63 20 63 68 61 72 |9-";.sta|tic char|
|000004a0| 20 2a 6b 79 70 64 5f 61 | 70 6c 20 3d 20 22 70 78 | *kypd_a|pl = "px|
|000004b0| 6e 4d 71 72 73 74 75 76 | 6c 77 78 79 6d 22 3b 0a |nMqrstuv|lwxym";.|
|000004c0| 73 74 61 74 69 63 20 63 | 68 61 72 20 2a 63 75 72 |static c|har *cur|
|000004d0| 20 3d 20 22 44 43 42 41 | 22 3b 0a 0a 49 6e 70 75 | = "DCBA|";..Inpu|
|000004e0| 74 20 28 6b 65 79 62 6f | 61 72 64 2c 20 73 63 72 |t (keybo|ard, scr|
|000004f0| 65 65 6e 2c 20 65 76 65 | 6e 74 29 0a 72 65 67 69 |een, eve|nt).regi|
|00000500| 73 74 65 72 20 4b 65 79 | 62 6f 61 72 64 09 2a 6b |ster Key|board.*k|
|00000510| 65 79 62 6f 61 72 64 3b | 0a 72 65 67 69 73 74 65 |eyboard;|.registe|
|00000520| 72 20 53 63 72 65 65 6e | 09 09 2a 73 63 72 65 65 |r Screen|..*scree|
|00000530| 6e 3b 0a 72 65 67 69 73 | 74 65 72 20 58 4b 65 79 |n;.regis|ter XKey|
|00000540| 50 72 65 73 73 65 64 45 | 76 65 6e 74 20 2a 65 76 |PressedE|vent *ev|
|00000550| 65 6e 74 3b 0a 7b 0a 09 | 72 65 67 69 73 74 65 72 |ent;.{..|register|
|00000560| 20 69 6e 74 20 6b 65 79 | 63 6f 64 65 20 3d 20 65 | int key|code = e|
|00000570| 76 65 6e 74 2d 3e 64 65 | 74 61 69 6c 3b 0a 09 72 |vent->de|tail;..r|
|00000580| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 2a 73 74 |egister |char *st|
|00000590| 72 69 6e 67 3b 0a 09 72 | 65 67 69 73 74 65 72 20 |ring;..r|egister |
|000005a0| 69 6e 74 20 63 6f 6c 2c | 20 6b 65 79 20 3d 20 46 |int col,| key = F|
|000005b0| 41 4c 53 45 3b 0a 09 69 | 6e 74 09 70 74 79 09 3d |ALSE;..i|nt.pty.=|
|000005c0| 20 73 63 72 65 65 6e 2d | 3e 72 65 73 70 6f 6e 64 | screen-|>respond|
|000005d0| 3b 0a 09 69 6e 74 09 6e | 62 79 74 65 73 3b 0a 09 |;..int.n|bytes;..|
|000005e0| 41 4e 53 49 09 72 65 70 | 6c 79 3b 0a 0a 09 73 74 |ANSI.rep|ly;...st|
|000005f0| 72 69 6e 67 20 3d 20 58 | 4c 6f 6f 6b 75 70 4d 61 |ring = X|LookupMa|
|00000600| 70 70 69 6e 67 20 28 65 | 76 65 6e 74 2c 20 26 6e |pping (e|vent, &n|
|00000610| 62 79 74 65 73 29 3b 0a | 0a 09 69 66 20 28 6e 62 |bytes);.|..if (nb|
|00000620| 79 74 65 73 20 3e 20 30 | 29 20 7b 0a 09 09 69 66 |ytes > 0|) {...if|
|00000630| 28 73 63 72 65 65 6e 2d | 3e 54 65 6b 47 49 4e 29 |(screen-|>TekGIN)|
|00000640| 20 7b 0a 09 09 09 54 65 | 6b 45 6e 71 4d 6f 75 73 | {....Te|kEnqMous|
|00000650| 65 28 2a 73 74 72 69 6e | 67 2b 2b 29 3b 0a 09 09 |e(*strin|g++);...|
|00000660| 09 54 65 6b 47 49 4e 6f | 66 66 28 29 3b 0a 09 09 |.TekGINo|ff();...|
|00000670| 09 6e 62 79 74 65 73 2d | 2d 3b 0a 09 09 7d 0a 09 |.nbytes-|-;...}..|
|00000680| 09 77 68 69 6c 65 20 28 | 6e 62 79 74 65 73 2d 2d |.while (|nbytes--|
|00000690| 20 3e 20 30 29 0a 09 09 | 09 75 6e 70 61 72 73 65 | > 0)...|.unparse|
|000006a0| 70 75 74 63 28 2a 73 74 | 72 69 6e 67 2b 2b 2c 20 |putc(*st|ring++, |
|000006b0| 70 74 79 29 3b 0a 09 09 | 6b 65 79 20 3d 20 54 52 |pty);...|key = TR|
|000006c0| 55 45 3b 0a 09 7d 20 65 | 6c 73 65 20 7b 0a 09 20 |UE;..} e|lse {.. |
|000006d0| 20 20 20 6b 65 79 63 6f | 64 65 20 26 3d 20 56 61 | keyco|de &= Va|
|000006e0| 6c 75 65 4d 61 73 6b 3b | 20 2f 2a 20 6e 6f 20 6c |lueMask;| /* no l|
|000006f0| 6f 6e 67 65 72 20 6e 65 | 65 64 20 73 68 69 66 74 |onger ne|ed shift|
|00000700| 20 62 69 74 73 20 66 6f | 72 20 61 6e 79 74 68 69 | bits fo|r anythi|
|00000710| 6e 67 20 2a 2f 0a 09 20 | 20 20 20 72 65 70 6c 79 |ng */.. | reply|
|00000720| 2e 61 5f 70 69 6e 74 72 | 6f 20 3d 20 30 3b 0a 09 |.a_pintr|o = 0;..|
|00000730| 20 20 20 20 72 65 70 6c | 79 2e 61 5f 66 69 6e 61 | repl|y.a_fina|
|00000740| 6c 20 3d 20 30 3b 0a 09 | 20 20 20 20 72 65 70 6c |l = 0;..| repl|
|00000750| 79 2e 61 5f 6e 70 61 72 | 61 6d 20 3d 20 30 3b 0a |y.a_npar|am = 0;.|
|00000760| 09 20 20 20 20 72 65 70 | 6c 79 2e 61 5f 69 6e 74 |. rep|ly.a_int|
|00000770| 65 72 73 20 3d 20 30 3b | 0a 09 20 20 20 20 69 66 |ers = 0;|.. if|
|00000780| 20 28 49 73 4b 65 79 70 | 61 64 4b 65 79 28 6b 65 | (IsKeyp|adKey(ke|
|00000790| 79 63 6f 64 65 29 29 20 | 7b 0a 09 20 20 09 69 66 |ycode)) |{.. .if|
|000007a0| 20 28 6b 65 79 62 6f 61 | 72 64 2d 3e 66 6c 61 67 | (keyboa|rd->flag|
|000007b0| 73 20 26 20 4b 59 50 44 | 5f 41 50 4c 29 09 7b 0a |s & KYPD|_APL).{.|
|000007c0| 09 09 09 72 65 70 6c 79 | 2e 61 5f 74 79 70 65 20 |...reply|.a_type |
|000007d0| 20 20 3d 20 53 53 33 3b | 0a 09 09 09 75 6e 70 61 | = SS3;|....unpa|
|000007e0| 72 73 65 73 65 71 28 26 | 72 65 70 6c 79 2c 20 70 |rseseq(&|reply, p|
|000007f0| 74 79 29 3b 0a 09 09 09 | 75 6e 70 61 72 73 65 70 |ty);....|unparsep|
|00000800| 75 74 63 28 6b 79 70 64 | 5f 61 70 6c 5b 6b 65 79 |utc(kypd|_apl[key|
|00000810| 63 6f 64 65 2d 4b 43 5f | 4b 45 59 50 41 44 5f 30 |code-KC_|KEYPAD_0|
|00000820| 5d 2c 20 70 74 79 29 3b | 0a 09 09 7d 20 65 6c 73 |], pty);|...} els|
|00000830| 65 0a 09 09 09 75 6e 70 | 61 72 73 65 70 75 74 63 |e....unp|arseputc|
|00000840| 28 6b 79 70 64 5f 6e 75 | 6d 5b 6b 65 79 63 6f 64 |(kypd_nu|m[keycod|
|00000850| 65 2d 4b 43 5f 4b 45 59 | 50 41 44 5f 30 5d 2c 20 |e-KC_KEY|PAD_0], |
|00000860| 70 74 79 29 3b 0a 09 09 | 6b 65 79 20 3d 20 54 52 |pty);...|key = TR|
|00000870| 55 45 3b 0a 09 20 20 20 | 20 7d 20 65 6c 73 65 20 |UE;.. | } else |
|00000880| 69 66 20 28 49 73 43 75 | 72 73 6f 72 4b 65 79 28 |if (IsCu|rsorKey(|
|00000890| 6b 65 79 63 6f 64 65 29 | 29 20 7b 0a 20 20 20 20 |keycode)|) {. |
|000008a0| 20 20 20 09 09 69 66 20 | 28 6b 65 79 62 6f 61 72 | ..if |(keyboar|
|000008b0| 64 2d 3e 66 6c 61 67 73 | 20 26 20 43 55 52 53 4f |d->flags| & CURSO|
|000008c0| 52 5f 41 50 4c 29 20 7b | 0a 09 09 09 72 65 70 6c |R_APL) {|....repl|
|000008d0| 79 2e 61 5f 74 79 70 65 | 20 3d 20 53 53 33 3b 0a |y.a_type| = SS3;.|
|000008e0| 09 09 09 75 6e 70 61 72 | 73 65 73 65 71 28 26 72 |...unpar|seseq(&r|
|000008f0| 65 70 6c 79 2c 20 70 74 | 79 29 3b 0a 09 09 09 75 |eply, pt|y);....u|
|00000900| 6e 70 61 72 73 65 70 75 | 74 63 28 63 75 72 5b 6b |nparsepu|tc(cur[k|
|00000910| 65 79 63 6f 64 65 2d 4b | 43 5f 43 55 52 53 4f 52 |eycode-K|C_CURSOR|
|00000920| 5f 4c 45 46 54 5d 2c 20 | 70 74 79 29 3b 0a 09 09 |_LEFT], |pty);...|
|00000930| 7d 20 65 6c 73 65 20 7b | 0a 09 09 09 72 65 70 6c |} else {|....repl|
|00000940| 79 2e 61 5f 74 79 70 65 | 20 3d 20 43 53 49 3b 0a |y.a_type| = CSI;.|
|00000950| 09 09 09 72 65 70 6c 79 | 2e 61 5f 66 69 6e 61 6c |...reply|.a_final|
|00000960| 20 3d 20 63 75 72 5b 6b | 65 79 63 6f 64 65 2d 4b | = cur[k|eycode-K|
|00000970| 43 5f 43 55 52 53 4f 52 | 5f 4c 45 46 54 5d 3b 0a |C_CURSOR|_LEFT];.|
|00000980| 09 09 09 75 6e 70 61 72 | 73 65 73 65 71 28 26 72 |...unpar|seseq(&r|
|00000990| 65 70 6c 79 2c 20 70 74 | 79 29 3b 0a 09 09 7d 0a |eply, pt|y);...}.|
|000009a0| 09 09 6b 65 79 20 3d 20 | 54 52 55 45 3b 0a 09 20 |..key = |TRUE;.. |
|000009b0| 20 20 20 7d 20 65 6c 73 | 65 20 69 66 20 28 49 73 | } els|e if (Is|
|000009c0| 50 46 4b 65 79 28 6b 65 | 79 63 6f 64 65 29 29 20 |PFKey(ke|ycode)) |
|000009d0| 7b 0a 09 09 72 65 70 6c | 79 2e 61 5f 74 79 70 65 |{...repl|y.a_type|
|000009e0| 20 3d 20 53 53 33 3b 0a | 09 09 75 6e 70 61 72 73 | = SS3;.|..unpars|
|000009f0| 65 73 65 71 28 26 72 65 | 70 6c 79 2c 20 70 74 79 |eseq(&re|ply, pty|
|00000a00| 29 3b 0a 09 09 75 6e 70 | 61 72 73 65 70 75 74 63 |);...unp|arseputc|
|00000a10| 28 28 63 68 61 72 29 28 | 6b 65 79 63 6f 64 65 2d |((char)(|keycode-|
|00000a20| 4b 43 5f 50 46 31 2b 27 | 50 27 29 2c 20 70 74 79 |KC_PF1+'|P'), pty|
|00000a30| 29 3b 0a 09 09 6b 65 79 | 20 3d 20 54 52 55 45 3b |);...key| = TRUE;|
|00000a40| 0a 09 20 20 20 20 7d 20 | 65 6c 73 65 20 69 66 20 |.. } |else if |
|00000a50| 28 49 73 46 75 6e 63 74 | 69 6f 6e 4b 65 79 28 6b |(IsFunct|ionKey(k|
|00000a60| 65 79 63 6f 64 65 29 29 | 20 7b 0a 09 09 72 65 70 |eycode))| {...rep|
|00000a70| 6c 79 2e 61 5f 74 79 70 | 65 20 3d 20 43 53 49 3b |ly.a_typ|e = CSI;|
|00000a80| 0a 09 09 72 65 70 6c 79 | 2e 61 5f 6e 70 61 72 61 |...reply|.a_npara|
|00000a90| 6d 20 3d 20 31 3b 0a 09 | 09 72 65 70 6c 79 2e 61 |m = 1;..|.reply.a|
|00000aa0| 5f 70 61 72 61 6d 5b 30 | 5d 20 3d 20 66 75 6e 63 |_param[0|] = func|
|00000ab0| 76 61 6c 75 65 28 6b 65 | 79 63 6f 64 65 29 3b 0a |value(ke|ycode);.|
|00000ac0| 09 09 72 65 70 6c 79 2e | 61 5f 66 69 6e 61 6c 20 |..reply.|a_final |
|00000ad0| 3d 20 27 7e 27 3b 0a 09 | 09 69 66 20 28 72 65 70 |= '~';..|.if (rep|
|00000ae0| 6c 79 2e 61 5f 70 61 72 | 61 6d 5b 30 5d 20 3e 20 |ly.a_par|am[0] > |
|00000af0| 30 29 0a 09 09 09 75 6e | 70 61 72 73 65 73 65 71 |0)....un|parseseq|
|00000b00| 28 26 72 65 70 6c 79 2c | 20 70 74 79 29 3b 0a 09 |(&reply,| pty);..|
|00000b10| 09 6b 65 79 20 3d 20 54 | 52 55 45 3b 0a 09 20 20 |.key = T|RUE;.. |
|00000b20| 20 20 7d 0a 09 7d 0a 09 | 69 66 28 6b 65 79 20 26 | }..}..|if(key &|
|00000b30| 26 20 21 73 63 72 65 65 | 6e 2d 3e 54 65 6b 45 6d |& !scree|n->TekEm|
|00000b40| 75 29 20 7b 0a 09 09 69 | 66 28 73 63 72 65 65 6e |u) {...i|f(screen|
|00000b50| 2d 3e 73 63 72 6f 6c 6c | 6b 65 79 20 26 26 20 73 |->scroll|key && s|
|00000b60| 63 72 65 65 6e 2d 3e 74 | 6f 70 6c 69 6e 65 20 21 |creen->t|opline !|
|00000b70| 3d 20 30 29 0a 09 09 09 | 53 63 72 6f 6c 6c 54 6f |= 0)....|ScrollTo|
|00000b80| 42 6f 74 74 6f 6d 28 73 | 63 72 65 65 6e 2d 3e 73 |Bottom(s|creen->s|
|00000b90| 62 29 3b 0a 09 09 69 66 | 28 73 63 72 65 65 6e 2d |b);...if|(screen-|
|00000ba0| 3e 6d 61 72 67 69 6e 62 | 65 6c 6c 29 20 7b 0a 09 |>marginb|ell) {..|
|00000bb0| 09 09 63 6f 6c 20 3d 20 | 73 63 72 65 65 6e 2d 3e |..col = |screen->|
|00000bc0| 6d 61 78 5f 63 6f 6c 20 | 2d 20 73 63 72 65 65 6e |max_col |- screen|
|00000bd0| 2d 3e 6e 6d 61 72 67 69 | 6e 62 65 6c 6c 3b 0a 09 |->nmargi|nbell;..|
|00000be0| 09 09 69 66 28 73 63 72 | 65 65 6e 2d 3e 62 65 6c |..if(scr|een->bel|
|00000bf0| 6c 61 72 6d 65 64 20 3e | 3d 20 30 29 20 7b 0a 09 |larmed >|= 0) {..|
|00000c00| 09 09 09 69 66 28 73 63 | 72 65 65 6e 2d 3e 62 65 |...if(sc|reen->be|
|00000c10| 6c 6c 61 72 6d 65 64 20 | 3d 3d 20 73 63 72 65 65 |llarmed |== scree|
|00000c20| 6e 2d 3e 63 75 72 5f 72 | 6f 77 29 20 7b 0a 09 09 |n->cur_r|ow) {...|
|00000c30| 09 09 09 69 66 28 73 63 | 72 65 65 6e 2d 3e 63 75 |...if(sc|reen->cu|
|00000c40| 72 5f 63 6f 6c 20 3e 3d | 20 63 6f 6c 29 20 7b 0a |r_col >=| col) {.|
|00000c50| 09 09 09 09 09 09 69 66 | 28 73 63 72 65 65 6e 2d |......if|(screen-|
|00000c60| 3e 63 75 72 5f 63 6f 6c | 20 3d 3d 20 63 6f 6c 29 |>cur_col| == col)|
|00000c70| 0a 09 09 09 09 09 09 09 | 42 65 6c 6c 28 29 3b 0a |........|Bell();.|
|00000c80| 09 09 09 09 09 09 73 63 | 72 65 65 6e 2d 3e 62 65 |......sc|reen->be|
|00000c90| 6c 6c 61 72 6d 65 64 20 | 3d 20 2d 31 3b 0a 09 09 |llarmed |= -1;...|
|00000ca0| 09 09 09 7d 0a 09 09 09 | 09 7d 20 65 6c 73 65 0a |...}....|.} else.|
|00000cb0| 09 09 09 09 09 73 63 72 | 65 65 6e 2d 3e 62 65 6c |.....scr|een->bel|
|00000cc0| 6c 61 72 6d 65 64 20 3d | 20 73 63 72 65 65 6e 2d |larmed =| screen-|
|00000cd0| 3e 63 75 72 5f 63 6f 6c | 20 3c 0a 09 09 09 09 09 |>cur_col| <......|
|00000ce0| 20 63 6f 6c 20 3f 20 73 | 63 72 65 65 6e 2d 3e 63 | col ? s|creen->c|
|00000cf0| 75 72 5f 72 6f 77 20 3a | 20 2d 31 3b 0a 09 09 09 |ur_row :| -1;....|
|00000d00| 7d 20 65 6c 73 65 20 69 | 66 28 73 63 72 65 65 6e |} else i|f(screen|
|00000d10| 2d 3e 63 75 72 5f 63 6f | 6c 20 3c 20 63 6f 6c 29 |->cur_co|l < col)|
|00000d20| 0a 09 09 09 09 73 63 72 | 65 65 6e 2d 3e 62 65 6c |.....scr|een->bel|
|00000d30| 6c 61 72 6d 65 64 20 3d | 20 73 63 72 65 65 6e 2d |larmed =| screen-|
|00000d40| 3e 63 75 72 5f 72 6f 77 | 3b 0a 09 09 7d 0a 09 7d |>cur_row|;...}..}|
|00000d50| 0a 23 69 66 64 65 66 20 | 45 4e 41 42 4c 45 5f 50 |.#ifdef |ENABLE_P|
|00000d60| 52 49 4e 54 0a 09 69 66 | 20 28 6b 65 79 63 6f 64 |RINT..if| (keycod|
|00000d70| 65 20 3d 3d 20 4b 43 5f | 46 32 29 20 54 65 6b 50 |e == KC_|F2) TekP|
|00000d80| 72 69 6e 74 28 29 3b 0a | 23 65 6e 64 69 66 0a 09 |rint();.|#endif..|
|00000d90| 72 65 74 75 72 6e 3b 0a | 7d 0a 0a 66 75 6e 63 76 |return;.|}..funcv|
|00000da0| 61 6c 75 65 28 6b 65 79 | 63 6f 64 65 29 0a 7b 0a |alue(key|code).{.|
|00000db0| 09 73 77 69 74 63 68 20 | 28 6b 65 79 63 6f 64 65 |.switch |(keycode|
|00000dc0| 29 20 7b 0a 09 09 63 61 | 73 65 20 4b 43 5f 46 31 |) {...ca|se KC_F1|
|00000dd0| 3a 09 72 65 74 75 72 6e | 28 31 31 29 3b 0a 09 09 |:.return|(11);...|
|00000de0| 63 61 73 65 20 4b 43 5f | 46 32 3a 09 72 65 74 75 |case KC_|F2:.retu|
|00000df0| 72 6e 28 31 32 29 3b 0a | 09 09 63 61 73 65 20 4b |rn(12);.|..case K|
|00000e00| 43 5f 46 33 3a 09 72 65 | 74 75 72 6e 28 31 33 29 |C_F3:.re|turn(13)|
|00000e10| 3b 0a 09 09 63 61 73 65 | 20 4b 43 5f 46 34 3a 09 |;...case| KC_F4:.|
|00000e20| 72 65 74 75 72 6e 28 31 | 34 29 3b 0a 09 09 63 61 |return(1|4);...ca|
|00000e30| 73 65 20 4b 43 5f 46 35 | 3a 09 72 65 74 75 72 6e |se KC_F5|:.return|
|00000e40| 28 31 35 29 3b 0a 09 09 | 63 61 73 65 20 4b 43 5f |(15);...|case KC_|
|00000e50| 46 36 3a 09 72 65 74 75 | 72 6e 28 31 37 29 3b 0a |F6:.retu|rn(17);.|
|00000e60| 09 09 63 61 73 65 20 4b | 43 5f 46 37 3a 09 72 65 |..case K|C_F7:.re|
|00000e70| 74 75 72 6e 28 31 38 29 | 3b 0a 09 09 63 61 73 65 |turn(18)|;...case|
|00000e80| 20 4b 43 5f 46 38 3a 09 | 72 65 74 75 72 6e 28 31 | KC_F8:.|return(1|
|00000e90| 39 29 3b 0a 09 09 63 61 | 73 65 20 4b 43 5f 46 39 |9);...ca|se KC_F9|
|00000ea0| 3a 09 72 65 74 75 72 6e | 28 32 30 29 3b 0a 09 09 |:.return|(20);...|
|00000eb0| 63 61 73 65 20 4b 43 5f | 46 31 30 3a 09 72 65 74 |case KC_|F10:.ret|
|00000ec0| 75 72 6e 28 32 31 29 3b | 0a 09 09 63 61 73 65 20 |urn(21);|...case |
|00000ed0| 4b 43 5f 46 31 31 3a 09 | 72 65 74 75 72 6e 28 32 |KC_F11:.|return(2|
|00000ee0| 33 29 3b 0a 09 09 63 61 | 73 65 20 4b 43 5f 46 31 |3);...ca|se KC_F1|
|00000ef0| 32 3a 09 72 65 74 75 72 | 6e 28 32 34 29 3b 0a 09 |2:.retur|n(24);..|
|00000f00| 09 63 61 73 65 20 4b 43 | 5f 46 31 33 3a 09 72 65 |.case KC|_F13:.re|
|00000f10| 74 75 72 6e 28 32 35 29 | 3b 0a 09 09 63 61 73 65 |turn(25)|;...case|
|00000f20| 20 4b 43 5f 46 31 34 3a | 09 72 65 74 75 72 6e 28 | KC_F14:|.return(|
|00000f30| 32 36 29 3b 0a 09 09 63 | 61 73 65 20 4b 43 5f 46 |26);...c|ase KC_F|
|00000f40| 31 35 3a 09 72 65 74 75 | 72 6e 28 32 38 29 3b 0a |15:.retu|rn(28);.|
|00000f50| 09 09 63 61 73 65 20 4b | 43 5f 46 31 36 3a 09 72 |..case K|C_F16:.r|
|00000f60| 65 74 75 72 6e 28 32 39 | 29 3b 0a 09 09 63 61 73 |eturn(29|);...cas|
|00000f70| 65 20 4b 43 5f 46 31 37 | 3a 09 72 65 74 75 72 6e |e KC_F17|:.return|
|00000f80| 28 33 31 29 3b 0a 09 09 | 63 61 73 65 20 4b 43 5f |(31);...|case KC_|
|00000f90| 46 31 38 3a 09 72 65 74 | 75 72 6e 28 33 32 29 3b |F18:.ret|urn(32);|
|00000fa0| 0a 09 09 63 61 73 65 20 | 4b 43 5f 46 31 39 3a 09 |...case |KC_F19:.|
|00000fb0| 72 65 74 75 72 6e 28 33 | 33 29 3b 0a 09 09 63 61 |return(3|3);...ca|
|00000fc0| 73 65 20 4b 43 5f 46 32 | 30 3a 09 72 65 74 75 72 |se KC_F2|0:.retur|
|00000fd0| 6e 28 33 34 29 3b 0a 09 | 09 63 61 73 65 20 4b 43 |n(34);..|.case KC|
|00000fe0| 5f 45 31 20 3a 09 72 65 | 74 75 72 6e 28 31 29 3b |_E1 :.re|turn(1);|
|00000ff0| 0a 09 09 63 61 73 65 20 | 4b 43 5f 45 32 3a 09 72 |...case |KC_E2:.r|
|00001000| 65 74 75 72 6e 28 32 29 | 3b 0a 09 09 63 61 73 65 |eturn(2)|;...case|
|00001010| 20 4b 43 5f 45 33 3a 09 | 72 65 74 75 72 6e 28 33 | KC_E3:.|return(3|
|00001020| 29 3b 0a 09 09 63 61 73 | 65 20 4b 43 5f 45 34 3a |);...cas|e KC_E4:|
|00001030| 09 72 65 74 75 72 6e 28 | 34 29 3b 0a 09 09 63 61 |.return(|4);...ca|
|00001040| 73 65 20 4b 43 5f 45 35 | 3a 09 72 65 74 75 72 6e |se KC_E5|:.return|
|00001050| 28 35 29 3b 0a 09 09 63 | 61 73 65 20 4b 43 5f 45 |(5);...c|ase KC_E|
|00001060| 36 3a 09 72 65 74 75 72 | 6e 28 36 29 3b 0a 09 09 |6:.retur|n(6);...|
|00001070| 64 65 66 61 75 6c 74 3a | 09 72 65 74 75 72 6e 28 |default:|.return(|
|00001080| 2d 31 29 3b 0a 09 7d 0a | 7d 0a 52 41 5a 5a 4c 45 |-1);..}.|}.RAZZLE|
|00001090| 21 44 41 5a 5a 4c 45 0a | 66 69 09 23 20 45 6e 64 |!DAZZLE.|fi.# End|
|000010a0| 20 69 6e 70 75 74 2e 63 | 0a 69 66 20 74 65 73 74 | input.c|.if test|
|000010b0| 20 2d 66 20 6d 65 6e 75 | 2e 68 0a 74 68 65 6e 0a | -f menu|.h.then.|
|000010c0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|000010d0| 20 6e 6f 74 20 6f 76 65 | 72 77 72 69 74 65 20 65 | not ove|rwrite e|
|000010e0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 6d |xisting |file "'m|
|000010f0| 65 6e 75 2e 68 27 22 0a | 65 6c 73 65 0a 65 63 68 |enu.h'".|else.ech|
|00001100| 6f 20 27 78 20 2d 20 6d | 65 6e 75 2e 68 27 0a 63 |o 'x - m|enu.h'.c|
|00001110| 61 74 20 3c 3c 20 5c 52 | 41 5a 5a 4c 45 21 44 41 |at << \R|AZZLE!DA|
|00001120| 5a 5a 4c 45 20 3e 20 6d | 65 6e 75 2e 68 0a 2f 2a |ZZLE > m|enu.h./*|
|00001130| 0a 20 2a 09 24 53 6f 75 | 72 63 65 3a 20 2f 75 31 |. *.$Sou|rce: /u1|
|00001140| 2f 58 2f 78 74 65 72 6d | 2f 52 43 53 2f 6d 65 6e |/X/xterm|/RCS/men|
|00001150| 75 2e 68 2c 76 20 24 0a | 20 2a 09 24 48 65 61 64 |u.h,v $.| *.$Head|
|00001160| 65 72 3a 20 6d 65 6e 75 | 2e 68 2c 76 20 31 30 2e |er: menu|.h,v 10.|
|00001170| 31 30 30 20 38 36 2f 31 | 32 2f 30 31 20 31 34 3a |100 86/1|2/01 14:|
|00001180| 34 30 3a 30 35 20 6a 67 | 20 52 65 6c 20 24 0a 20 |40:05 jg| Rel $. |
|00001190| 2a 2f 0a 0a 2f 2a 20 40 | 28 23 29 6d 65 6e 75 2e |*/../* @|(#)menu.|
|000011a0| 68 20 20 20 20 20 20 20 | 58 31 30 2f 36 2e 36 42 |h |X10/6.6B|
|000011b0| 20 31 32 2f 32 36 2f 38 | 36 20 2a 2f 0a 2f 2a 0a | 12/26/8|6 */./*.|
|000011c0| 20 2a 20 4d 65 6e 75 20 | 69 74 65 6d 73 20 61 72 | * Menu |items ar|
|000011d0| 65 20 63 6f 6e 73 74 72 | 75 63 74 65 64 20 61 73 |e constr|ucted as|
|000011e0| 20 66 6f 6c 6c 6f 77 73 | 2c 20 73 74 61 72 74 69 | follows|, starti|
|000011f0| 6e 67 20 66 72 6f 6d 20 | 74 68 65 20 6c 65 66 74 |ng from |the left|
|00001200| 20 73 69 64 65 3a 0a 20 | 2a 0a 20 2a 09 6d 65 6e | side:. |*. *.men|
|00001210| 75 49 74 65 6d 50 61 64 | 0a 20 2a 09 73 70 61 63 |uItemPad|. *.spac|
|00001220| 65 20 66 6f 72 20 63 68 | 65 63 6b 20 6d 61 72 6b |e for ch|eck mark|
|00001230| 0a 20 2a 09 6d 65 6e 75 | 49 74 65 6d 50 61 64 0a |. *.menu|ItemPad.|
|00001240| 20 2a 09 74 65 78 74 20 | 2b 20 70 61 64 64 69 6e | *.text |+ paddin|
|00001250| 67 0a 20 2a 09 6d 65 6e | 75 49 74 65 6d 50 61 64 |g. *.men|uItemPad|
|00001260| 0a 20 2a 0a 20 2a 20 54 | 68 65 20 70 61 64 64 69 |. *. * T|he paddi|
|00001270| 6e 67 20 66 6f 72 20 74 | 68 65 20 74 65 78 74 20 |ng for t|he text |
|00001280| 69 73 20 74 68 61 74 20 | 61 6d 6f 75 6e 74 20 74 |is that |amount t|
|00001290| 68 61 74 20 74 68 69 73 | 20 74 65 78 74 20 69 73 |hat this| text is|
|000012a0| 20 6e 61 72 72 6f 77 65 | 72 20 74 68 61 6e 20 74 | narrowe|r than t|
|000012b0| 68 65 0a 20 2a 20 77 69 | 64 65 73 74 20 74 65 78 |he. * wi|dest tex|
|000012c0| 74 2e 0a 20 2a 2f 0a 0a | 74 79 70 65 64 65 66 20 |t.. */..|typedef |
|000012d0| 73 74 72 75 63 74 20 5f | 6d 65 6e 75 49 74 65 6d |struct _|menuItem|
|000012e0| 20 7b 0a 09 69 6e 74 20 | 69 74 65 6d 48 65 69 67 | {..int |itemHeig|
|000012f0| 68 74 3b 09 09 09 2f 2a | 20 74 6f 74 61 6c 20 68 |ht;.../*| total h|
|00001300| 65 69 67 68 74 20 6f 66 | 20 74 68 69 73 20 69 74 |eight of| this it|
|00001310| 65 6d 20 2a 2f 0a 09 69 | 6e 74 20 69 74 65 6d 46 |em */..i|nt itemF|
|00001320| 6c 61 67 73 3b 09 09 09 | 2f 2a 20 66 6c 61 67 73 |lags;...|/* flags|
|00001330| 20 6f 66 20 69 74 65 6d | 20 2a 2f 0a 0a 23 64 65 | of item| */..#de|
|00001340| 66 69 6e 65 09 69 74 65 | 6d 44 69 73 61 62 6c 65 |fine.ite|mDisable|
|00001350| 64 09 09 30 78 30 30 30 | 31 09 2f 2a 20 69 74 65 |d..0x000|1./* ite|
|00001360| 6d 20 69 73 20 64 69 73 | 61 62 6c 65 64 20 2a 2f |m is dis|abled */|
|00001370| 0a 23 64 65 66 69 6e 65 | 09 69 74 65 6d 43 68 65 |.#define|.itemChe|
|00001380| 63 6b 65 64 09 09 30 78 | 30 30 30 32 09 2f 2a 20 |cked..0x|0002./* |
|00001390| 69 74 65 6d 20 68 61 73 | 20 63 68 65 63 6b 20 6d |item has| check m|
|000013a0| 61 72 6b 20 2a 2f 0a 23 | 64 65 66 69 6e 65 09 69 |ark */.#|define.i|
|000013b0| 74 65 6d 53 74 61 74 65 | 4d 61 73 6b 09 09 30 78 |temState|Mask..0x|
|000013c0| 30 30 30 33 09 2f 2a 20 | 6d 61 73 6b 20 66 6f 72 |0003./* |mask for|
|000013d0| 20 63 75 72 72 65 6e 74 | 20 73 74 61 74 65 20 2a | current| state *|
|000013e0| 2f 0a 23 64 65 66 69 6e | 65 09 69 74 65 6d 53 65 |/.#defin|e.itemSe|
|000013f0| 74 44 69 73 61 62 6c 65 | 64 09 09 30 78 30 30 30 |tDisable|d..0x000|
|00001400| 34 09 2f 2a 20 69 74 65 | 6d 20 77 61 6e 74 73 20 |4./* ite|m wants |
|00001410| 74 6f 20 62 65 20 64 69 | 73 61 62 6c 65 64 20 2a |to be di|sabled *|
|00001420| 2f 0a 23 64 65 66 69 6e | 65 09 69 74 65 6d 53 65 |/.#defin|e.itemSe|
|00001430| 74 43 68 65 63 6b 65 64 | 09 09 30 78 30 30 30 38 |tChecked|..0x0008|
|00001440| 09 2f 2a 20 69 74 65 6d | 20 77 61 6e 74 73 20 63 |./* item| wants c|
|00001450| 68 65 63 6b 20 6d 61 72 | 6b 20 2a 2f 0a 23 64 65 |heck mar|k */.#de|
|00001460| 66 69 6e 65 09 69 74 65 | 6d 53 65 74 4d 61 73 6b |fine.ite|mSetMask|
|00001470| 09 09 30 78 30 30 30 63 | 09 2f 2a 20 6d 61 73 6b |..0x000c|./* mask|
|00001480| 20 66 6f 72 20 64 65 73 | 69 72 65 64 20 73 74 61 | for des|ired sta|
|00001490| 74 65 20 2a 2f 0a 23 64 | 65 66 69 6e 65 09 69 74 |te */.#d|efine.it|
|000014a0| 65 6d 53 65 74 4d 61 73 | 6b 53 68 69 66 74 09 32 |emSetMas|kShift.2|
|000014b0| 09 2f 2a 20 66 6f 72 20 | 63 6f 6d 70 61 72 69 73 |./* for |comparis|
|000014c0| 6f 6e 20 77 69 74 68 20 | 61 63 74 75 61 6c 20 2a |on with |actual *|
|000014d0| 2f 0a 23 64 65 66 69 6e | 65 09 69 74 65 6d 43 68 |/.#defin|e.itemCh|
|000014e0| 61 6e 67 65 64 09 09 30 | 78 30 30 31 30 09 2f 2a |anged..0|x0010./*|
|000014f0| 20 69 74 65 6d 20 64 65 | 73 69 72 65 73 20 63 68 | item de|sires ch|
|00001500| 61 6e 67 65 20 2a 2f 0a | 0a 09 63 68 61 72 20 2a |ange */.|..char *|
|00001510| 69 74 65 6d 54 65 78 74 | 3b 09 09 09 2f 2a 20 74 |itemText|;.../* t|
|00001520| 65 78 74 20 6f 66 20 69 | 74 65 6d 20 2a 2f 0a 09 |ext of i|tem */..|
|00001530| 69 6e 74 20 69 74 65 6d | 54 65 78 74 57 69 64 74 |int item|TextWidt|
|00001540| 68 3b 09 09 2f 2a 20 77 | 69 64 74 68 20 6f 66 20 |h;../* w|idth of |
|00001550| 74 65 78 74 20 2a 2f 0a | 09 69 6e 74 20 69 74 65 |text */.|.int ite|
|00001560| 6d 54 65 78 74 4c 65 6e | 67 74 68 3b 09 09 2f 2a |mTextLen|gth;../*|
|00001570| 20 6c 65 6e 67 74 68 20 | 6f 66 20 74 65 78 74 20 | length |of text |
|00001580| 2a 2f 0a 09 73 74 72 75 | 63 74 20 5f 6d 65 6e 75 |*/..stru|ct _menu|
|00001590| 49 74 65 6d 20 2a 6e 65 | 78 74 49 74 65 6d 3b 09 |Item *ne|xtItem;.|
|000015a0| 2f 2a 20 6e 65 78 74 20 | 69 74 65 6d 20 69 6e 20 |/* next |item in |
|000015b0| 63 68 61 69 6e 20 2a 2f | 0a 7d 20 4d 65 6e 75 49 |chain */|.} MenuI|
|000015c0| 74 65 6d 3b 0a 0a 74 79 | 70 65 64 65 66 20 73 74 |tem;..ty|pedef st|
|000015d0| 72 75 63 74 20 5f 6d 65 | 6e 75 20 7b 0a 09 69 6e |ruct _me|nu {..in|
|000015e0| 74 20 6d 65 6e 75 57 69 | 64 74 68 3b 09 09 09 2f |t menuWi|dth;.../|
|000015f0| 2a 20 66 75 6c 6c 20 77 | 69 64 74 68 20 6f 66 20 |* full w|idth of |
|00001600| 6d 65 6e 75 20 2a 2f 0a | 09 69 6e 74 20 6d 65 6e |menu */.|.int men|
|00001610| 75 48 65 69 67 68 74 3b | 09 09 09 2f 2a 20 66 75 |uHeight;|.../* fu|
|00001620| 6c 6c 20 68 65 69 67 68 | 74 20 6f 66 20 6d 65 6e |ll heigh|t of men|
|00001630| 75 20 2a 2f 0a 09 69 6e | 74 20 6d 65 6e 75 46 6c |u */..in|t menuFl|
|00001640| 61 67 73 3b 09 09 09 2f | 2a 20 66 6c 61 67 73 20 |ags;.../|* flags |
|00001650| 6f 66 20 74 68 69 73 20 | 6d 65 6e 75 20 2a 2f 0a |of this |menu */.|
|00001660| 0a 23 20 64 65 66 69 6e | 65 09 6d 65 6e 75 43 68 |.# defin|e.menuCh|
|00001670| 61 6e 67 65 64 09 30 78 | 30 30 30 31 09 09 2f 2a |anged.0x|0001../*|
|00001680| 20 6d 65 6e 75 20 63 68 | 61 6e 67 65 64 2c 20 6d | menu ch|anged, m|
|00001690| 75 73 74 20 72 65 64 72 | 61 77 20 2a 2f 0a 23 20 |ust redr|aw */.# |
|000016a0| 64 65 66 69 6e 65 09 6d | 65 6e 75 49 74 65 6d 43 |define.m|enuItemC|
|000016b0| 68 61 6e 67 65 64 09 30 | 78 30 30 30 32 09 09 2f |hanged.0|x0002../|
|000016c0| 2a 20 69 74 65 6d 20 63 | 68 61 6e 67 65 64 2c 20 |* item c|hanged, |
|000016d0| 6d 75 73 74 20 72 65 64 | 72 61 77 20 2a 2f 0a 23 |must red|raw */.#|
|000016e0| 20 64 65 66 69 6e 65 09 | 6d 65 6e 75 4d 61 70 70 | define.|menuMapp|
|000016f0| 65 64 09 30 78 30 30 30 | 34 09 09 2f 2a 20 6d 65 |ed.0x000|4../* me|
|00001700| 6e 75 20 69 73 20 6e 6f | 77 20 6d 61 70 70 65 64 |nu is no|w mapped|
|00001710| 20 2a 2f 0a 23 20 64 65 | 66 69 6e 65 09 6d 65 6e | */.# de|fine.men|
|00001720| 75 46 72 65 65 7a 65 09 | 30 78 30 30 30 38 09 09 |uFreeze.|0x0008..|
|00001730| 2f 2a 20 66 72 65 65 7a | 65 20 77 68 65 6e 20 64 |/* freez|e when d|
|00001740| 6f 69 6e 67 20 6d 65 6e | 75 20 2a 2f 0a 23 20 64 |oing men|u */.# d|
|00001750| 65 66 69 6e 65 09 6d 65 | 6e 75 53 61 76 65 4d 65 |efine.me|nuSaveMe|
|00001760| 6e 75 09 30 78 30 30 31 | 30 09 09 2f 2a 20 73 61 |nu.0x001|0../* sa|
|00001770| 76 65 20 63 6f 70 79 20 | 6f 66 20 6d 65 6e 75 20 |ve copy |of menu |
|00001780| 2a 2f 0a 0a 09 69 6e 74 | 20 6d 65 6e 75 4d 61 78 |*/...int| menuMax|
|00001790| 54 65 78 74 57 69 64 74 | 68 3b 09 09 2f 2a 20 77 |TextWidt|h;../* w|
|000017a0| 69 64 74 68 20 6f 66 20 | 77 69 64 65 73 74 20 74 |idth of |widest t|
|000017b0| 65 78 74 20 2a 2f 0a 09 | 69 6e 74 20 6d 65 6e 75 |ext */..|int menu|
|000017c0| 49 6e 69 74 69 61 6c 49 | 74 65 6d 3b 09 09 2f 2a |InitialI|tem;../*|
|000017d0| 20 3c 20 30 20 6e 6f 6e | 65 2c 20 3e 3d 20 30 20 | < 0 non|e, >= 0 |
|000017e0| 69 6e 69 74 69 61 6c 20 | 69 74 65 6d 20 2a 2f 0a |initial |item */.|
|000017f0| 09 69 6e 74 20 6d 65 6e | 75 42 6f 72 64 65 72 57 |.int men|uBorderW|
|00001800| 69 64 74 68 3b 09 09 2f | 2a 20 77 69 64 74 68 20 |idth;../|* width |
|00001810| 6f 66 20 62 6f 72 64 65 | 72 20 2a 2f 0a 09 69 6e |of borde|r */..in|
|00001820| 74 20 6d 65 6e 75 42 67 | 43 6f 6c 6f 72 3b 09 09 |t menuBg|Color;..|
|00001830| 2f 2a 20 62 61 63 6b 67 | 72 6f 75 6e 64 20 63 6f |/* backg|round co|
|00001840| 6c 6f 72 20 2a 2f 0a 09 | 69 6e 74 20 6d 65 6e 75 |lor */..|int menu|
|00001850| 46 67 43 6f 6c 6f 72 3b | 09 09 2f 2a 20 66 6f 72 |FgColor;|../* for|
|00001860| 65 67 72 6f 75 6e 64 20 | 63 6f 6c 6f 72 20 2a 2f |eground |color */|
|00001870| 0a 09 50 69 78 6d 61 70 | 20 6d 65 6e 75 42 67 54 |..Pixmap| menuBgT|
|00001880| 69 6c 65 3b 09 09 2f 2a | 20 62 61 63 6b 67 72 6f |ile;../*| backgro|
|00001890| 75 64 20 74 69 6c 65 20 | 2a 2f 0a 09 46 6f 6e 74 |ud tile |*/..Font|
|000018a0| 49 6e 66 6f 20 2a 6d 65 | 6e 75 46 6f 6e 74 49 6e |Info *me|nuFontIn|
|000018b0| 66 6f 3b 09 09 2f 2a 20 | 66 6f 6e 74 69 6e 66 6f |fo;../* |fontinfo|
|000018c0| 20 66 6f 72 20 6d 65 6e | 75 20 66 6f 6e 74 20 2a | for men|u font *|
|000018d0| 2f 0a 09 69 6e 74 20 6d | 65 6e 75 49 74 65 6d 50 |/..int m|enuItemP|
|000018e0| 61 64 3b 09 09 2f 2a 20 | 70 61 64 20 61 6d 6f 75 |ad;../* |pad amou|
|000018f0| 6e 74 20 2a 2f 0a 09 57 | 69 6e 64 6f 77 20 6d 65 |nt */..W|indow me|
|00001900| 6e 75 57 69 6e 64 6f 77 | 3b 09 09 2f 2a 20 77 69 |nuWindow|;../* wi|
|00001910| 6e 64 6f 77 20 6f 66 20 | 6d 65 6e 75 20 2a 2f 0a |ndow of |menu */.|
|00001920| 09 69 6e 74 20 28 2a 6d | 65 6e 75 45 76 65 6e 74 |.int (*m|enuEvent|
|00001930| 48 61 6e 64 6c 65 72 29 | 28 29 3b 09 2f 2a 20 65 |Handler)|();./* e|
|00001940| 78 74 65 72 6e 61 6c 20 | 65 76 65 6e 74 20 68 61 |xternal |event ha|
|00001950| 6e 64 6c 65 72 20 2a 2f | 0a 09 43 75 72 73 6f 72 |ndler */|..Cursor|
|00001960| 20 6d 65 6e 75 43 75 72 | 73 6f 72 3b 09 09 2f 2a | menuCur|sor;../*|
|00001970| 20 63 75 72 73 6f 72 20 | 75 73 65 64 20 69 6e 20 | cursor |used in |
|00001980| 6d 65 6e 75 20 2a 2f 0a | 09 50 69 78 6d 61 70 20 |menu */.|.Pixmap |
|00001990| 6d 65 6e 75 53 61 76 65 | 64 3b 09 09 2f 2a 20 63 |menuSave|d;../* c|
|000019a0| 6f 70 79 20 6f 66 20 6d | 65 6e 75 20 2a 2f 0a 09 |opy of m|enu */..|
|000019b0| 50 69 78 6d 61 70 20 6d | 65 6e 75 53 61 76 65 64 |Pixmap m|enuSaved|
|000019c0| 49 6d 61 67 65 3b 09 09 | 2f 2a 20 63 6f 70 79 20 |Image;..|/* copy |
|000019d0| 6f 66 20 69 6d 61 67 65 | 20 75 6e 64 65 72 20 6d |of image| under m|
|000019e0| 65 6e 75 20 2a 2f 0a 09 | 69 6e 74 20 6d 65 6e 75 |enu */..|int menu|
|000019f0| 53 61 76 65 64 49 6d 61 | 67 65 58 3b 09 09 2f 2a |SavedIma|geX;../*|
|00001a00| 20 58 20 63 6f 6f 72 64 | 69 6e 61 74 65 20 6f 66 | X coord|inate of|
|00001a10| 20 74 68 65 20 73 61 76 | 65 64 20 69 6d 61 67 65 | the sav|ed image|
|00001a20| 20 2a 2f 0a 09 69 6e 74 | 20 6d 65 6e 75 53 61 76 | */..int| menuSav|
|00001a30| 65 64 49 6d 61 67 65 59 | 3b 09 09 2f 2a 20 59 20 |edImageY|;../* Y |
|00001a40| 63 6f 6f 72 64 69 6e 61 | 74 65 20 6f 66 20 74 68 |coordina|te of th|
|00001a50| 65 20 73 61 76 65 64 20 | 69 6d 61 67 65 20 2a 2f |e saved |image */|
|00001a60| 0a 09 4d 65 6e 75 49 74 | 65 6d 20 2a 6d 65 6e 75 |..MenuIt|em *menu|
|00001a70| 49 74 65 6d 73 3b 09 09 | 2f 2a 20 68 65 61 64 20 |Items;..|/* head |
|00001a80| 6f 66 20 6d 65 6e 75 20 | 69 74 65 6d 20 63 68 61 |of menu |item cha|
|00001a90| 69 6e 20 2a 2f 0a 09 63 | 68 61 72 20 2a 6d 65 6e |in */..c|har *men|
|00001aa0| 75 54 69 74 6c 65 3b 09 | 09 2f 2a 20 74 69 74 6c |uTitle;.|./* titl|
|00001ab0| 65 20 6f 66 20 6d 65 6e | 75 20 2a 2f 0a 09 69 6e |e of men|u */..in|
|00001ac0| 74 20 6d 65 6e 75 54 69 | 74 6c 65 57 69 64 74 68 |t menuTi|tleWidth|
|00001ad0| 3b 09 09 2f 2a 20 77 69 | 64 74 68 20 6f 66 20 74 |;../* wi|dth of t|
|00001ae0| 69 74 6c 65 20 2a 2f 0a | 09 69 6e 74 20 6d 65 6e |itle */.|.int men|
|00001af0| 75 54 69 74 6c 65 4c 65 | 6e 67 74 68 3b 09 09 2f |uTitleLe|ngth;../|
|00001b00| 2a 20 6c 65 6e 67 74 68 | 20 6f 66 20 74 69 74 6c |* length| of titl|
|00001b10| 65 20 2a 2f 0a 09 69 6e | 74 20 6d 65 6e 75 49 74 |e */..in|t menuIt|
|00001b20| 65 6d 54 6f 70 3b 09 09 | 2f 2a 20 70 6f 73 69 74 |emTop;..|/* posit|
|00001b30| 69 6f 6e 20 6f 66 20 74 | 6f 70 20 6f 66 20 66 69 |ion of t|op of fi|
|00001b40| 72 73 74 20 69 74 65 6d | 20 2a 2f 0a 7d 20 4d 65 |rst item| */.} Me|
|00001b50| 6e 75 3b 0a 0a 23 64 65 | 66 69 6e 65 09 63 68 65 |nu;..#de|fine.che|
|00001b60| 63 6b 4d 61 72 6b 57 69 | 64 74 68 09 09 39 0a 23 |ckMarkWi|dth..9.#|
|00001b70| 64 65 66 69 6e 65 09 63 | 68 65 63 6b 4d 61 72 6b |define.c|heckMark|
|00001b80| 48 65 69 67 68 74 09 09 | 38 0a 23 64 65 66 69 6e |Height..|8.#defin|
|00001b90| 65 09 64 65 66 61 75 6c | 74 43 75 72 73 6f 72 57 |e.defaul|tCursorW|
|00001ba0| 69 64 74 68 09 31 36 0a | 23 64 65 66 69 6e 65 09 |idth.16.|#define.|
|00001bb0| 64 65 66 61 75 6c 74 43 | 75 72 73 6f 72 48 65 69 |defaultC|ursorHei|
|00001bc0| 67 68 74 09 31 36 0a 23 | 64 65 66 69 6e 65 09 64 |ght.16.#|define.d|
|00001bd0| 65 66 61 75 6c 74 43 75 | 72 73 6f 72 58 09 09 31 |efaultCu|rsorX..1|
|00001be0| 0a 23 64 65 66 69 6e 65 | 09 64 65 66 61 75 6c 74 |.#define|.default|
|00001bf0| 43 75 72 73 6f 72 59 09 | 09 31 0a 23 64 65 66 69 |CursorY.|.1.#defi|
|00001c00| 6e 65 09 67 72 61 79 48 | 65 69 67 68 74 09 09 31 |ne.grayH|eight..1|
|00001c10| 36 0a 23 64 65 66 69 6e | 65 09 67 72 61 79 57 69 |6.#defin|e.grayWi|
|00001c20| 64 74 68 09 09 31 36 0a | 23 64 65 66 69 6e 65 09 |dth..16.|#define.|
|00001c30| 6c 69 6e 65 53 65 70 61 | 72 61 74 6f 72 48 65 69 |lineSepa|ratorHei|
|00001c40| 67 68 74 09 39 0a 0a 23 | 64 65 66 69 6e 65 09 43 |ght.9..#|define.C|
|00001c50| 68 65 63 6b 49 74 65 6d | 28 6d 65 6e 75 2c 69 74 |heckItem|(menu,it|
|00001c60| 65 6d 29 09 53 65 74 49 | 74 65 6d 43 68 65 63 6b |em).SetI|temCheck|
|00001c70| 28 6d 65 6e 75 2c 69 74 | 65 6d 2c 31 29 0a 23 64 |(menu,it|em,1).#d|
|00001c80| 65 66 69 6e 65 09 44 69 | 73 61 62 6c 65 49 74 65 |efine.Di|sableIte|
|00001c90| 6d 28 6d 65 6e 75 2c 69 | 74 65 6d 29 09 53 65 74 |m(menu,i|tem).Set|
|00001ca0| 49 74 65 6d 44 69 73 61 | 62 6c 65 28 6d 65 6e 75 |ItemDisa|ble(menu|
|00001cb0| 2c 69 74 65 6d 2c 31 29 | 0a 23 64 65 66 69 6e 65 |,item,1)|.#define|
|00001cc0| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |.EnableI|tem(menu|
|00001cd0| 2c 69 74 65 6d 29 09 53 | 65 74 49 74 65 6d 44 69 |,item).S|etItemDi|
|00001ce0| 73 61 62 6c 65 28 6d 65 | 6e 75 2c 69 74 65 6d 2c |sable(me|nu,item,|
|00001cf0| 30 29 0a 23 64 65 66 69 | 6e 65 09 53 65 74 4d 65 |0).#defi|ne.SetMe|
|00001d00| 6e 75 45 76 65 6e 74 48 | 61 6e 64 6c 65 72 28 6d |nuEventH|andler(m|
|00001d10| 65 6e 75 2c 66 29 09 6d | 65 6e 75 2d 3e 6d 65 6e |enu,f).m|enu->men|
|00001d20| 75 45 76 65 6e 74 48 61 | 6e 64 6c 65 72 20 3d 20 |uEventHa|ndler = |
|00001d30| 66 0a 23 64 65 66 69 6e | 65 09 55 6e 63 68 65 63 |f.#defin|e.Unchec|
|00001d40| 6b 49 74 65 6d 28 6d 65 | 6e 75 2c 69 74 65 6d 29 |kItem(me|nu,item)|
|00001d50| 09 53 65 74 49 74 65 6d | 43 68 65 63 6b 28 6d 65 |.SetItem|Check(me|
|00001d60| 6e 75 2c 69 74 65 6d 2c | 30 29 0a 0a 65 78 74 65 |nu,item,|0)..exte|
|00001d70| 72 6e 20 4d 65 6e 75 20 | 2a 4e 65 77 4d 65 6e 75 |rn Menu |*NewMenu|
|00001d80| 28 29 3b 0a 52 41 5a 5a | 4c 45 21 44 41 5a 5a 4c |();.RAZZ|LE!DAZZL|
|00001d90| 45 0a 66 69 09 23 20 45 | 6e 64 20 6d 65 6e 75 2e |E.fi.# E|nd menu.|
|00001da0| 68 0a 69 66 20 74 65 73 | 74 20 2d 66 20 6d 69 73 |h.if tes|t -f mis|
|00001db0| 63 2e 63 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |c.c.then|..echo s|
|00001dc0| 68 61 72 3a 20 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: wil|l not ov|
|00001dd0| 65 72 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |erwrite |existing|
|00001de0| 20 66 69 6c 65 20 22 27 | 6d 69 73 63 2e 63 27 22 | file "'|misc.c'"|
|00001df0| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 27 78 20 2d 20 |.else.ec|ho 'x - |
|00001e00| 6d 69 73 63 2e 63 27 0a | 63 61 74 20 3c 3c 20 5c |misc.c'.|cat << \|
|00001e10| 52 41 5a 5a 4c 45 21 44 | 41 5a 5a 4c 45 20 3e 20 |RAZZLE!D|AZZLE > |
|00001e20| 6d 69 73 63 2e 63 0a 2f | 2a 0a 20 2a 09 24 53 6f |misc.c./|*. *.$So|
|00001e30| 75 72 63 65 3a 20 2f 75 | 31 2f 58 2f 78 74 65 72 |urce: /u|1/X/xter|
|00001e40| 6d 2f 52 43 53 2f 6d 69 | 73 63 2e 63 2c 76 20 24 |m/RCS/mi|sc.c,v $|
|00001e50| 0a 20 2a 09 24 48 65 61 | 64 65 72 3a 20 6d 69 73 |. *.$Hea|der: mis|
|00001e60| 63 2e 63 2c 76 20 31 30 | 2e 31 30 31 20 38 36 2f |c.c,v 10|.101 86/|
|00001e70| 31 32 2f 30 32 20 30 38 | 3a 34 39 3a 32 30 20 73 |12/02 08|:49:20 s|
|00001e80| 77 69 63 6b 20 45 78 70 | 20 24 0a 20 2a 2f 0a 0a |wick Exp| $. */..|
|00001e90| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00001ea0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 65 74 |h>.#incl|ude <set|
|00001eb0| 6a 6d 70 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |jmp.h>.#|include |
|00001ec0| 3c 73 69 67 6e 61 6c 2e | 68 3e 0a 23 69 6e 63 6c |<signal.|h>.#incl|
|00001ed0| 75 64 65 20 3c 63 74 79 | 70 65 2e 68 3e 0a 23 69 |ude <cty|pe.h>.#i|
|00001ee0| 6e 63 6c 75 64 65 20 3c | 70 77 64 2e 68 3e 0a 23 |nclude <|pwd.h>.#|
|00001ef0| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 69 6d |include |<sys/tim|
|00001f00| 65 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |e.h>.#in|clude <s|
|00001f10| 79 73 2f 66 69 6c 65 2e | 68 3e 0a 23 69 6e 63 6c |ys/file.|h>.#incl|
|00001f20| 75 64 65 20 3c 58 2f 58 | 6c 69 62 2e 68 3e 0a 23 |ude <X/X|lib.h>.#|
|00001f30| 69 6e 63 6c 75 64 65 20 | 22 73 63 72 6f 6c 6c 62 |include |"scrollb|
|00001f40| 61 72 2e 68 22 0a 23 69 | 6e 63 6c 75 64 65 20 22 |ar.h".#i|nclude "|
|00001f50| 70 74 79 78 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 |ptyx.h".|#include|
|00001f60| 20 22 64 61 74 61 2e 68 | 22 0a 23 69 6e 63 6c 75 | "data.h|".#inclu|
|00001f70| 64 65 20 22 65 72 72 6f | 72 2e 68 22 0a 23 69 6e |de "erro|r.h".#in|
|00001f80| 63 6c 75 64 65 20 22 67 | 72 61 79 2e 69 63 22 0a |clude "g|ray.ic".|
|00001f90| 23 69 6e 63 6c 75 64 65 | 20 22 68 69 6c 69 74 65 |#include| "hilite|
|00001fa0| 2e 69 63 22 0a 23 69 6e | 63 6c 75 64 65 20 22 69 |.ic".#in|clude "i|
|00001fb0| 63 6f 6e 2e 69 63 22 0a | 23 69 6e 63 6c 75 64 65 |con.ic".|#include|
|00001fc0| 20 22 74 65 6b 5f 69 63 | 6f 6e 2e 69 63 22 0a 23 | "tek_ic|on.ic".#|
|00001fd0| 69 6e 63 6c 75 64 65 20 | 22 77 61 69 74 2e 69 63 |include |"wait.ic|
|00001fe0| 22 0a 23 69 6e 63 6c 75 | 64 65 20 22 77 61 69 74 |".#inclu|de "wait|
|00001ff0| 6d 61 73 6b 2e 69 63 22 | 0a 23 69 6e 63 6c 75 64 |mask.ic"|.#includ|
|00002000| 65 20 22 2e 2e 2f 63 75 | 72 73 6f 72 73 2f 6c 65 |e "../cu|rsors/le|
|00002010| 66 74 5f 70 74 72 2e 63 | 75 72 73 6f 72 22 0a 23 |ft_ptr.c|ursor".#|
|00002020| 69 6e 63 6c 75 64 65 20 | 22 2e 2e 2f 63 75 72 73 |include |"../curs|
|00002030| 6f 72 73 2f 6c 65 66 74 | 5f 70 74 72 5f 6d 61 73 |ors/left|_ptr_mas|
|00002040| 6b 2e 63 75 72 73 6f 72 | 22 0a 23 69 6e 63 6c 75 |k.cursor|".#inclu|
|00002050| 64 65 20 22 2e 2e 2f 63 | 75 72 73 6f 72 73 2f 74 |de "../c|ursors/t|
|00002060| 63 72 6f 73 73 2e 63 75 | 72 73 6f 72 22 0a 23 69 |cross.cu|rsor".#i|
|00002070| 6e 63 6c 75 64 65 20 22 | 2e 2e 2f 63 75 72 73 6f |nclude "|../curso|
|00002080| 72 73 2f 74 63 72 6f 73 | 73 5f 6d 61 73 6b 2e 63 |rs/tcros|s_mask.c|
|00002090| 75 72 73 6f 72 22 0a 23 | 69 6e 63 6c 75 64 65 20 |ursor".#|include |
|000020a0| 22 2e 2e 2f 63 75 72 73 | 6f 72 73 2f 78 74 65 72 |"../curs|ors/xter|
|000020b0| 6d 2e 63 75 72 73 6f 72 | 22 0a 23 69 6e 63 6c 75 |m.cursor|".#inclu|
|000020c0| 64 65 20 22 2e 2e 2f 63 | 75 72 73 6f 72 73 2f 78 |de "../c|ursors/x|
|000020d0| 74 65 72 6d 5f 6d 61 73 | 6b 2e 63 75 72 73 6f 72 |term_mas|k.cursor|
|000020e0| 22 0a 0a 23 69 66 6e 64 | 65 66 20 6c 69 6e 74 0a |"..#ifnd|ef lint.|
|000020f0| 73 74 61 74 69 63 20 63 | 68 61 72 20 73 63 63 73 |static c|har sccs|
|00002100| 5f 69 64 5b 5d 20 3d 20 | 22 40 28 23 29 6d 69 73 |_id[] = |"@(#)mis|
|00002110| 63 2e 63 5c 74 58 31 30 | 2f 36 2e 36 42 5c 74 31 |c.c\tX10|/6.6B\t1|
|00002120| 2f 39 2f 38 37 22 3b 0a | 23 65 6e 64 69 66 09 6c |/9/87";.|#endif.l|
|00002130| 69 6e 74 0a 0a 78 65 76 | 65 6e 74 73 28 29 0a 7b |int..xev|ents().{|
|00002140| 0a 09 58 45 76 65 6e 74 | 20 72 65 70 6c 79 3b 0a |..XEvent| reply;.|
|00002150| 09 72 65 67 69 73 74 65 | 72 20 58 45 76 65 6e 74 |.registe|r XEvent|
|00002160| 20 2a 72 65 70 20 3d 20 | 26 20 72 65 70 6c 79 3b | *rep = |& reply;|
|00002170| 0a 09 72 65 67 69 73 74 | 65 72 20 53 63 72 65 65 |..regist|er Scree|
|00002180| 6e 20 2a 73 63 72 65 65 | 6e 20 3d 20 26 74 65 72 |n *scree|n = &ter|
|00002190| 6d 2e 73 63 72 65 65 6e | 3b 0a 0a 09 69 66 28 73 |m.screen|;...if(s|
|000021a0| 63 72 65 65 6e 2d 3e 73 | 63 72 6f 6c 6c 5f 61 6d |creen->s|croll_am|
|000021b0| 74 29 0a 09 09 46 6c 75 | 73 68 53 63 72 6f 6c 6c |t)...Flu|shScroll|
|000021c0| 28 73 63 72 65 65 6e 29 | 3b 0a 09 58 50 65 6e 64 |(screen)|;..XPend|
|000021d0| 69 6e 67 20 28 29 3b 0a | 09 64 6f 20 7b 0a 09 09 |ing ();.|.do {...|
|000021e0| 58 4e 65 78 74 45 76 65 | 6e 74 20 28 26 72 65 70 |XNextEve|nt (&rep|
|000021f0| 6c 79 29 3b 0a 09 09 78 | 65 76 65 6e 74 70 61 73 |ly);...x|eventpas|
|00002200| 73 28 26 72 65 70 6c 79 | 29 3b 0a 09 7d 20 77 68 |s(&reply|);..} wh|
|00002210| 69 6c 65 20 28 51 4c 65 | 6e 67 74 68 28 29 20 3e |ile (QLe|ngth() >|
|00002220| 20 30 29 3b 0a 7d 0a 0a | 78 65 76 65 6e 74 70 61 | 0);.}..|xeventpa|
|00002230| 73 73 28 72 65 70 29 0a | 72 65 67 69 73 74 65 72 |ss(rep).|register|
|00002240| 20 58 45 76 65 6e 74 20 | 2a 72 65 70 3b 0a 7b 0a | XEvent |*rep;.{.|
|00002250| 09 72 65 67 69 73 74 65 | 72 20 53 63 72 65 65 6e |.registe|r Screen|
|00002260| 20 2a 73 63 72 65 65 6e | 20 3d 20 26 74 65 72 6d | *screen| = &term|
|00002270| 2e 73 63 72 65 65 6e 3b | 0a 09 72 65 67 69 73 74 |.screen;|..regist|
|00002280| 65 72 20 57 69 6e 64 6f | 77 20 77 69 6e 64 6f 77 |er Windo|w window|
|00002290| 20 3d 20 72 65 70 2d 3e | 77 69 6e 64 6f 77 3b 0a | = rep->|window;.|
|000022a0| 09 72 65 67 69 73 74 65 | 72 20 57 69 6e 64 6f 77 |.registe|r Window|
|000022b0| 20 77 3b 0a 09 72 65 67 | 69 73 74 65 72 20 69 6e | w;..reg|ister in|
|000022c0| 74 20 69 3b 0a 0a 09 73 | 77 69 74 63 68 20 28 28 |t i;...s|witch ((|
|000022d0| 69 6e 74 29 72 65 70 2d | 3e 74 79 70 65 29 20 7b |int)rep-|>type) {|
|000022e0| 0a 09 20 63 61 73 65 20 | 4b 65 79 50 72 65 73 73 |.. case |KeyPress|
|000022f0| 65 64 3a 0a 09 09 49 6e | 70 75 74 20 28 26 74 65 |ed:...In|put (&te|
|00002300| 72 6d 2e 6b 65 79 62 6f | 61 72 64 2c 20 26 74 65 |rm.keybo|ard, &te|
|00002310| 72 6d 2e 73 63 72 65 65 | 6e 2c 0a 09 09 20 28 58 |rm.scree|n,... (X|
|00002320| 4b 65 79 50 72 65 73 73 | 65 64 45 76 65 6e 74 20 |KeyPress|edEvent |
|00002330| 2a 29 72 65 70 29 3b 0a | 09 09 62 72 65 61 6b 3b |*)rep);.|..break;|
|00002340| 0a 0a 09 20 63 61 73 65 | 20 45 78 70 6f 73 65 57 |... case| ExposeW|
|00002350| 69 6e 64 6f 77 3a 0a 09 | 09 69 66 28 73 63 72 65 |indow:..|.if(scre|
|00002360| 65 6e 2d 3e 73 62 20 26 | 26 20 77 69 6e 64 6f 77 |en->sb &|& window|
|00002370| 20 3d 3d 20 73 63 72 65 | 65 6e 2d 3e 73 62 2d 3e | == scre|en->sb->|
|00002380| 62 61 72 29 20 7b 0a 23 | 69 66 64 65 66 20 44 45 |bar) {.#|ifdef DE|
|00002390| 42 55 47 0a 09 09 09 69 | 66 28 64 65 62 75 67 29 |BUG....i|f(debug)|
|000023a0| 0a 09 09 09 09 66 70 75 | 74 73 28 22 45 78 70 6f |.....fpu|ts("Expo|
|000023b0| 73 65 57 69 6e 64 6f 77 | 20 73 63 72 6f 6c 6c 62 |seWindow| scrollb|
|000023c0| 61 72 5c 6e 22 2c 20 73 | 74 64 65 72 72 29 3b 0a |ar\n", s|tderr);.|
|000023d0| 23 65 6e 64 69 66 20 44 | 45 42 55 47 0a 09 09 09 |#endif D|EBUG....|
|000023e0| 69 66 28 28 28 58 45 78 | 70 6f 73 65 45 76 65 6e |if(((XEx|poseEven|
|000023f0| 74 20 2a 29 72 65 70 29 | 2d 3e 73 75 62 77 69 6e |t *)rep)|->subwin|
|00002400| 64 6f 77 20 3d 3d 0a 09 | 09 09 20 73 63 72 65 65 |dow ==..|.. scree|
|00002410| 6e 2d 3e 73 62 2d 3e 62 | 75 74 74 6f 6e 29 20 7b |n->sb->b|utton) {|
|00002420| 0a 09 09 09 09 73 63 72 | 65 65 6e 2d 3e 73 62 2d |.....scr|een->sb-|
|00002430| 3e 62 75 74 74 6f 6e 73 | 74 61 74 65 20 3d 20 2d |>buttons|tate = -|
|00002440| 31 3b 0a 09 09 09 09 44 | 72 61 77 42 75 74 74 6f |1;.....D|rawButto|
|00002450| 6e 28 73 63 72 65 65 6e | 2d 3e 73 62 29 3b 0a 09 |n(screen|->sb);..|
|00002460| 09 09 7d 20 65 6c 73 65 | 20 69 66 28 28 28 58 45 |..} else| if(((XE|
|00002470| 78 70 6f 73 65 45 76 65 | 6e 74 20 2a 29 72 65 70 |xposeEve|nt *)rep|
|00002480| 29 2d 3e 73 75 62 77 69 | 6e 64 6f 77 20 3d 3d 0a |)->subwi|ndow ==.|
|00002490| 09 09 09 20 73 63 72 65 | 65 6e 2d 3e 73 62 2d 3e |... scre|en->sb->|
|000024a0| 73 61 76 65 29 20 7b 0a | 09 09 09 09 73 63 72 65 |save) {.|....scre|
|000024b0| 65 6e 2d 3e 73 62 2d 3e | 73 61 76 65 73 74 61 74 |en->sb->|savestat|
|000024c0| 65 20 3d 20 2d 31 3b 0a | 09 09 09 09 44 72 61 77 |e = -1;.|....Draw|
|000024d0| 53 61 76 65 28 73 63 72 | 65 65 6e 2d 3e 73 62 29 |Save(scr|een->sb)|
|000024e0| 3b 0a 09 09 09 7d 0a 09 | 09 09 62 72 65 61 6b 3b |;....}..|..break;|
|000024f0| 0a 09 09 7d 0a 09 09 69 | 66 20 28 73 63 72 65 65 |...}...i|f (scree|
|00002500| 6e 2d 3e 61 63 74 69 76 | 65 5f 69 63 6f 6e 29 20 |n->activ|e_icon) |
|00002510| 7b 0a 23 69 66 64 65 66 | 20 44 45 42 55 47 0a 09 |{.#ifdef| DEBUG..|
|00002520| 09 20 20 20 20 66 70 75 | 74 73 28 20 22 45 78 70 |. fpu|ts( "Exp|
|00002530| 6f 73 65 57 69 6e 64 6f | 77 20 69 63 6f 6e 5c 6e |oseWindo|w icon\n|
|00002540| 22 2c 20 73 74 64 65 72 | 72 20 29 3b 0a 23 65 6e |", stder|r );.#en|
|00002550| 64 69 66 20 44 45 42 55 | 47 0a 09 09 20 20 20 20 |dif DEBU|G... |
|00002560| 69 66 20 28 77 69 6e 64 | 6f 77 20 3d 3d 20 73 63 |if (wind|ow == sc|
|00002570| 72 65 65 6e 2d 3e 69 63 | 6f 6e 56 77 69 6e 2e 77 |reen->ic|onVwin.w|
|00002580| 69 6e 64 6f 77 29 20 7b | 0a 09 09 20 20 20 20 20 |indow) {|... |
|00002590| 20 20 20 69 66 20 28 21 | 73 63 72 65 65 6e 2d 3e | if (!|screen->|
|000025a0| 69 63 6f 6e 5f 73 68 6f | 77 29 20 7b 0a 09 09 09 |icon_sho|w) {....|
|000025b0| 20 20 20 20 73 63 72 65 | 65 6e 2d 3e 6d 61 70 70 | scre|en->mapp|
|000025c0| 65 64 56 77 69 6e 20 3d | 20 26 73 63 72 65 65 6e |edVwin =| &screen|
|000025d0| 2d 3e 69 63 6f 6e 56 77 | 69 6e 3b 0a 09 09 09 20 |->iconVw|in;.... |
|000025e0| 20 20 20 73 63 72 65 65 | 6e 2d 3e 69 63 6f 6e 5f | scree|n->icon_|
|000025f0| 73 68 6f 77 20 3d 20 54 | 52 55 45 3b 0a 09 09 09 |show = T|RUE;....|
|00002600| 20 20 20 20 73 63 72 65 | 65 6e 2d 3e 73 68 6f 77 | scre|en->show|
|00002610| 20 3d 20 46 41 4c 53 45 | 3b 0a 09 09 09 20 20 20 | = FALSE|;.... |
|00002620| 20 73 63 72 65 65 6e 2d | 3e 74 69 6d 65 72 20 3d | screen-|>timer =|
|00002630| 20 30 3b 0a 09 09 09 20 | 20 20 20 73 63 72 65 65 | 0;.... | scree|
|00002640| 6e 2d 3e 68 6f 6c 64 6f | 66 66 20 3d 20 46 41 4c |n->holdo|ff = FAL|
|00002650| 53 45 3b 0a 09 09 09 20 | 20 20 20 69 66 28 73 63 |SE;.... | if(sc|
|00002660| 72 65 65 6e 2d 3e 66 75 | 6c 6c 54 77 69 6e 2e 77 |reen->fu|llTwin.w|
|00002670| 69 6e 64 6f 77 29 0a 09 | 09 09 09 6d 6f 76 65 69 |indow)..|...movei|
|00002680| 63 6f 6e 77 69 6e 64 6f | 77 28 20 73 63 72 65 65 |conwindo|w( scree|
|00002690| 6e 2d 3e 66 75 6c 6c 54 | 77 69 6e 2e 77 69 6e 64 |n->fullT|win.wind|
|000026a0| 6f 77 2c 0a 09 09 09 09 | 09 09 73 63 72 65 65 6e |ow,.....|..screen|
|000026b0| 2d 3e 66 75 6c 6c 56 77 | 69 6e 2e 77 69 6e 64 6f |->fullVw|in.windo|
|000026c0| 77 20 29 3b 0a 09 09 09 | 7d 0a 09 09 09 69 66 20 |w );....|}....if |
|000026d0| 28 73 63 72 65 65 6e 2d | 3e 54 65 6b 45 6d 75 29 |(screen-|>TekEmu)|
|000026e0| 0a 09 09 09 20 20 20 20 | 56 54 55 6e 73 65 6c 65 |.... |VTUnsele|
|000026f0| 63 74 28 29 3b 0a 09 09 | 09 69 66 20 28 74 65 72 |ct();...|.if (ter|
|00002700| 6d 2e 66 6c 61 67 73 20 | 26 20 49 43 4f 4e 49 4e |m.flags |& ICONIN|
|00002710| 50 55 54 29 0a 09 09 09 | 20 20 20 20 72 65 73 65 |PUT)....| rese|
|00002720| 6c 65 63 74 77 69 6e 64 | 6f 77 28 73 63 72 65 65 |lectwind|ow(scree|
|00002730| 6e 29 3b 0a 09 09 09 65 | 6c 73 65 0a 09 09 09 20 |n);....e|lse.... |
|00002740| 20 20 20 75 6e 73 65 6c | 65 63 74 77 69 6e 64 6f | unsel|ectwindo|
|00002750| 77 28 73 63 72 65 65 6e | 2c 20 49 4e 57 49 4e 44 |w(screen|, INWIND|
|00002760| 4f 57 29 3b 0a 09 09 09 | 73 63 72 65 65 6e 2d 3e |OW);....|screen->|
|00002770| 69 63 6f 6e 69 6e 70 75 | 74 20 3d 20 46 41 4c 53 |iconinpu|t = FALS|
|00002780| 45 3b 0a 09 09 09 56 54 | 45 78 70 6f 73 65 28 72 |E;....VT|Expose(r|
|00002790| 65 70 29 3b 0a 09 09 20 | 20 20 20 7d 20 65 6c 73 |ep);... | } els|
|000027a0| 65 20 69 66 20 28 77 69 | 6e 64 6f 77 20 3d 3d 20 |e if (wi|ndow == |
|000027b0| 73 63 72 65 65 6e 2d 3e | 69 63 6f 6e 54 77 69 6e |screen->|iconTwin|
|000027c0| 2e 77 69 6e 64 6f 77 29 | 20 7b 0a 09 09 09 69 66 |.window)| {....if|
|000027d0| 20 28 21 73 63 72 65 65 | 6e 2d 3e 69 63 6f 6e 5f | (!scree|n->icon_|
|000027e0| 73 68 6f 77 29 20 7b 0a | 09 09 09 20 20 20 20 73 |show) {.|... s|
|000027f0| 63 72 65 65 6e 2d 3e 6d | 61 70 70 65 64 54 77 69 |creen->m|appedTwi|
|00002800| 6e 20 3d 20 26 73 63 72 | 65 65 6e 2d 3e 69 63 6f |n = &scr|een->ico|
|00002810| 6e 54 77 69 6e 3b 0a 09 | 09 09 20 20 20 20 73 63 |nTwin;..|.. sc|
|00002820| 72 65 65 6e 2d 3e 69 63 | 6f 6e 5f 73 68 6f 77 20 |reen->ic|on_show |
|00002830| 3d 20 54 52 55 45 3b 0a | 09 09 09 20 20 20 20 73 |= TRUE;.|... s|
|00002840| 63 72 65 65 6e 2d 3e 54 | 73 68 6f 77 20 3d 20 46 |creen->T|show = F|
|00002850| 41 4c 53 45 3b 0a 09 09 | 09 20 20 20 20 73 63 72 |ALSE;...|. scr|
|00002860| 65 65 6e 2d 3e 74 69 6d | 65 72 20 3d 20 30 3b 0a |een->tim|er = 0;.|
|00002870| 09 09 09 20 20 20 20 73 | 63 72 65 65 6e 2d 3e 68 |... s|creen->h|
|00002880| 6f 6c 64 6f 66 66 20 3d | 20 46 41 4c 53 45 3b 0a |oldoff =| FALSE;.|
|00002890| 09 09 09 20 20 20 20 69 | 66 20 28 73 63 72 65 65 |... i|f (scree|
|000028a0| 6e 2d 3e 66 75 6c 6c 56 | 77 69 6e 2e 77 69 6e 64 |n->fullV|win.wind|
|000028b0| 6f 77 29 0a 09 09 09 09 | 6d 6f 76 65 69 63 6f 6e |ow).....|moveicon|
|000028c0| 77 69 6e 64 6f 77 28 20 | 73 63 72 65 65 6e 2d 3e |window( |screen->|
|000028d0| 66 75 6c 6c 56 77 69 6e | 2e 77 69 6e 64 6f 77 2c |fullVwin|.window,|
|000028e0| 0a 09 09 09 09 09 09 73 | 63 72 65 65 6e 2d 3e 66 |.......s|creen->f|
|000028f0| 75 6c 6c 54 77 69 6e 2e | 77 69 6e 64 6f 77 20 29 |ullTwin.|window )|
|00002900| 3b 0a 09 09 09 7d 0a 09 | 09 09 69 66 20 28 21 73 |;....}..|..if (!s|
|00002910| 63 72 65 65 6e 2d 3e 54 | 65 6b 45 6d 75 29 0a 09 |creen->T|ekEmu)..|
|00002920| 09 09 20 20 20 20 54 65 | 6b 55 6e 73 65 6c 65 63 |.. Te|kUnselec|
|00002930| 74 28 29 3b 0a 09 09 09 | 69 66 20 28 74 65 72 6d |t();....|if (term|
|00002940| 2e 66 6c 61 67 73 20 26 | 20 49 43 4f 4e 49 4e 50 |.flags &| ICONINP|
|00002950| 55 54 29 0a 09 09 09 20 | 20 20 20 72 65 73 65 6c |UT).... | resel|
|00002960| 65 63 74 77 69 6e 64 6f | 77 28 73 63 72 65 65 6e |ectwindo|w(screen|
|00002970| 29 3b 0a 09 09 09 65 6c | 73 65 0a 09 09 09 20 20 |);....el|se.... |
|00002980| 20 20 75 6e 73 65 6c 65 | 63 74 77 69 6e 64 6f 77 | unsele|ctwindow|
|00002990| 28 73 63 72 65 65 6e 2c | 20 49 4e 57 49 4e 44 4f |(screen,| INWINDO|
|000029a0| 57 29 3b 0a 09 09 09 73 | 63 72 65 65 6e 2d 3e 69 |W);....s|creen->i|
|000029b0| 63 6f 6e 69 6e 70 75 74 | 20 3d 20 46 41 4c 53 45 |coninput| = FALSE|
|000029c0| 3b 0a 09 09 09 54 65 6b | 45 78 70 6f 73 65 28 72 |;....Tek|Expose(r|
|000029d0| 65 70 29 3b 0a 09 09 09 | 7d 0a 09 09 7d 20 65 6c |ep);....|}...} el|
|000029e0| 73 65 20 69 66 20 28 77 | 69 6e 64 6f 77 20 3d 3d |se if (w|indow ==|
|000029f0| 20 73 63 72 65 65 6e 2d | 3e 69 63 6f 6e 56 77 69 | screen-|>iconVwi|
|00002a00| 6e 2e 77 69 6e 64 6f 77 | 20 7c 7c 0a 09 09 09 20 |n.window| ||.... |
|00002a10| 20 20 77 69 6e 64 6f 77 | 20 3d 3d 20 73 63 72 65 | window| == scre|
|00002a20| 65 6e 2d 3e 69 63 6f 6e | 54 77 69 6e 2e 77 69 6e |en->icon|Twin.win|
|00002a30| 64 6f 77 29 20 7b 0a 23 | 69 66 64 65 66 20 44 45 |dow) {.#|ifdef DE|
|00002a40| 42 55 47 0a 09 09 09 69 | 66 28 64 65 62 75 67 29 |BUG....i|f(debug)|
|00002a50| 0a 09 09 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 |.....fpr|intf(std|
|00002a60| 65 72 72 2c 20 22 45 78 | 70 6f 73 65 57 69 6e 64 |err, "Ex|poseWind|
|00002a70| 6f 77 20 25 73 5c 6e 22 | 2c 20 77 69 6e 64 6f 77 |ow %s\n"|, window|
|00002a80| 20 3d 3d 0a 09 09 09 09 | 20 73 63 72 65 65 6e 2d | ==.....| screen-|
|00002a90| 3e 69 63 6f 6e 56 77 69 | 6e 2e 77 69 6e 64 6f 77 |>iconVwi|n.window|
|00002aa0| 20 3f 20 22 69 63 6f 6e | 22 20 3a 20 22 54 69 63 | ? "icon|" : "Tic|
|00002ab0| 6f 6e 22 29 3b 0a 23 65 | 6e 64 69 66 20 44 45 42 |on");.#e|ndif DEB|
|00002ac0| 55 47 0a 09 09 09 52 65 | 66 72 65 73 68 49 63 6f |UG....Re|freshIco|
|00002ad0| 6e 28 73 63 72 65 65 6e | 2c 20 77 69 6e 64 6f 77 |n(screen|, window|
|00002ae0| 29 3b 0a 09 09 09 62 72 | 65 61 6b 3b 0a 09 09 7d |);....br|eak;...}|
|00002af0| 0a 09 09 69 66 28 54 69 | 74 6c 65 62 61 72 28 73 |...if(Ti|tlebar(s|
|00002b00| 63 72 65 65 6e 29 20 7c | 7c 20 73 63 72 65 65 6e |creen) ||| screen|
|00002b10| 2d 3e 69 63 6f 6e 5f 73 | 68 6f 77 29 20 7b 0a 09 |->icon_s|how) {..|
|00002b20| 09 2f 2a 20 69 63 6f 6e | 5f 73 68 6f 77 20 69 73 |./* icon|_show is|
|00002b30| 20 61 20 6b 6c 75 64 67 | 65 20 61 73 20 74 68 65 | a kludg|e as the|
|00002b40| 20 74 69 74 6c 65 62 61 | 72 20 65 78 70 6f 73 75 | titleba|r exposu|
|00002b50| 72 65 20 65 76 65 6e 74 | 0a 09 09 20 2a 20 66 72 |re event|... * fr|
|00002b60| 65 71 75 65 6e 74 6c 79 | 20 61 72 72 69 76 65 73 |equently| arrives|
|00002b70| 20 62 65 66 6f 72 65 20 | 74 68 65 20 66 75 6c 6c | before |the full|
|00002b80| 20 77 69 6e 64 6f 77 20 | 65 78 70 6f 73 75 72 65 | window |exposure|
|00002b90| 20 65 76 65 6e 74 20 2a | 2f 0a 09 09 09 69 66 28 | event *|/....if(|
|00002ba0| 77 69 6e 64 6f 77 20 3d | 3d 20 73 63 72 65 65 6e |window =|= screen|
|00002bb0| 2d 3e 74 69 74 6c 65 2e | 74 62 61 72 29 20 7b 0a |->title.|tbar) {.|
|00002bc0| 23 69 66 64 65 66 20 44 | 45 42 55 47 0a 09 09 09 |#ifdef D|EBUG....|
|00002bd0| 69 66 28 64 65 62 75 67 | 29 0a 09 09 09 09 66 70 |if(debug|).....fp|
|00002be0| 75 74 73 28 22 45 78 70 | 6f 73 65 57 69 6e 64 6f |uts("Exp|oseWindo|
|00002bf0| 77 20 74 69 74 6c 65 5c | 6e 22 2c 20 73 74 64 65 |w title\|n", stde|
|00002c00| 72 72 29 3b 0a 23 65 6e | 64 69 66 20 44 45 42 55 |rr);.#en|dif DEBU|
|00002c10| 47 0a 09 09 09 09 56 54 | 54 69 74 6c 65 45 78 70 |G.....VT|TitleExp|
|00002c20| 6f 73 65 28 28 58 45 78 | 70 6f 73 65 57 69 6e 64 |ose((XEx|poseWind|
|00002c30| 6f 77 45 76 65 6e 74 20 | 2a 29 72 65 70 29 3b 0a |owEvent |*)rep);.|
|00002c40| 09 09 09 09 62 72 65 61 | 6b 3b 0a 09 09 09 7d 20 |....brea|k;....} |
|00002c50| 65 6c 73 65 20 69 66 28 | 77 69 6e 64 6f 77 20 3d |else if(|window =|
|00002c60| 3d 20 73 63 72 65 65 6e | 2d 3e 54 74 69 74 6c 65 |= screen|->Ttitle|
|00002c70| 2e 74 62 61 72 29 20 7b | 0a 23 69 66 64 65 66 20 |.tbar) {|.#ifdef |
|00002c80| 44 45 42 55 47 0a 09 09 | 09 69 66 28 64 65 62 75 |DEBUG...|.if(debu|
|00002c90| 67 29 0a 09 09 09 09 66 | 70 75 74 73 28 22 45 78 |g).....f|puts("Ex|
|00002ca0| 70 6f 73 65 57 69 6e 64 | 6f 77 20 54 74 69 74 6c |poseWind|ow Ttitl|
|00002cb0| 65 5c 6e 22 2c 20 73 74 | 64 65 72 72 29 3b 0a 23 |e\n", st|derr);.#|
|00002cc0| 65 6e 64 69 66 20 44 45 | 42 55 47 0a 09 09 09 09 |endif DE|BUG.....|
|00002cd0| 54 65 6b 54 69 74 6c 65 | 45 78 70 6f 73 65 28 28 |TekTitle|Expose((|
|00002ce0| 58 45 78 70 6f 73 65 57 | 69 6e 64 6f 77 45 76 65 |XExposeW|indowEve|
|00002cf0| 6e 74 20 2a 29 72 65 70 | 29 3b 0a 09 09 09 09 62 |nt *)rep|);.....b|
|00002d00| 72 65 61 6b 3b 0a 09 09 | 09 7d 0a 09 09 7d 0a 09 |reak;...|.}...}..|
|00002d10| 09 69 66 28 77 69 6e 64 | 6f 77 20 3d 3d 20 73 63 |.if(wind|ow == sc|
|00002d20| 72 65 65 6e 2d 3e 66 75 | 6c 6c 56 77 69 6e 2e 77 |reen->fu|llVwin.w|
|00002d30| 69 6e 64 6f 77 29 20 7b | 0a 23 69 66 64 65 66 20 |indow) {|.#ifdef |
|00002d40| 44 45 42 55 47 0a 09 09 | 09 69 66 28 64 65 62 75 |DEBUG...|.if(debu|
|00002d50| 67 29 0a 09 09 09 09 66 | 70 75 74 73 28 22 45 78 |g).....f|puts("Ex|
|00002d60| 70 6f 73 65 57 69 6e 64 | 6f 77 20 56 54 5c 6e 22 |poseWind|ow VT\n"|
|00002d70| 2c 20 73 74 64 65 72 72 | 29 3b 0a 23 65 6e 64 69 |, stderr|);.#endi|
|00002d80| 66 20 44 45 42 55 47 0a | 09 09 09 69 66 28 21 73 |f DEBUG.|...if(!s|
|00002d90| 63 72 65 65 6e 2d 3e 73 | 68 6f 77 29 20 7b 0a 09 |creen->s|how) {..|
|00002da0| 09 09 09 73 63 72 65 65 | 6e 2d 3e 6d 61 70 70 65 |...scree|n->mappe|
|00002db0| 64 56 77 69 6e 20 3d 20 | 26 73 63 72 65 65 6e 2d |dVwin = |&screen-|
|00002dc0| 3e 66 75 6c 6c 56 77 69 | 6e 3b 0a 09 09 09 09 69 |>fullVwi|n;.....i|
|00002dd0| 66 28 73 63 72 65 65 6e | 2d 3e 54 69 63 6f 6e 75 |f(screen|->Ticonu|
|00002de0| 6e 6d 61 70 29 20 7b 0a | 09 09 09 09 09 73 63 72 |nmap) {.|.....scr|
|00002df0| 65 65 6e 2d 3e 54 69 63 | 6f 6e 75 6e 6d 61 70 20 |een->Tic|onunmap |
|00002e00| 3d 20 46 41 4c 53 45 3b | 0a 09 09 09 09 09 58 4d |= FALSE;|......XM|
|00002e10| 61 70 57 69 6e 64 6f 77 | 28 20 73 63 72 65 65 6e |apWindow|( screen|
|00002e20| 2d 3e 66 75 6c 6c 54 77 | 69 6e 2e 77 69 6e 64 6f |->fullTw|in.windo|
|00002e30| 77 20 29 3b 0a 09 09 09 | 09 09 73 63 72 65 65 6e |w );....|..screen|
|00002e40| 2d 3e 54 73 68 6f 77 20 | 3d 20 54 52 55 45 3b 0a |->Tshow |= TRUE;.|
|00002e50| 09 09 09 09 09 69 66 28 | 21 73 63 72 65 65 6e 2d |.....if(|!screen-|
|00002e60| 3e 54 65 6b 45 6d 75 29 | 20 7b 0a 09 09 09 09 09 |>TekEmu)| {......|
|00002e70| 20 20 20 20 73 63 72 65 | 65 6e 2d 3e 68 6f 6c 64 | scre|en->hold|
|00002e80| 6f 66 66 20 3d 20 54 52 | 55 45 3b 0a 09 09 09 09 |off = TR|UE;.....|
|00002e90| 09 20 20 20 20 58 55 6e | 6d 61 70 54 72 61 6e 73 |. XUn|mapTrans|
|00002ea0| 70 61 72 65 6e 74 28 56 | 57 69 6e 64 6f 77 28 73 |parent(V|Window(s|
|00002eb0| 63 72 65 65 6e 29 29 3b | 0a 09 09 09 09 09 20 20 |creen));|...... |
|00002ec0| 20 20 58 4d 61 70 57 69 | 6e 64 6f 77 28 56 57 69 | XMapWi|ndow(VWi|
|00002ed0| 6e 64 6f 77 28 73 63 72 | 65 65 6e 29 29 3b 0a 09 |ndow(scr|een));..|
|00002ee0| 09 09 09 09 20 20 20 20 | 62 72 65 61 6b 3b 0a 09 |.... |break;..|
|00002ef0| 09 09 09 09 7d 0a 09 09 | 09 09 7d 20 65 6c 73 65 |....}...|..} else|
|00002f00| 20 7b 0a 09 09 09 09 09 | 73 63 72 65 65 6e 2d 3e | {......|screen->|
|00002f10| 74 69 6d 65 72 20 3d 20 | 30 3b 0a 09 09 09 09 09 |timer = |0;......|
|00002f20| 73 63 72 65 65 6e 2d 3e | 68 6f 6c 64 6f 66 66 20 |screen->|holdoff |
|00002f30| 3d 20 46 41 4c 53 45 3b | 0a 09 09 09 09 7d 0a 09 |= FALSE;|.....}..|
|00002f40| 09 09 09 73 63 72 65 65 | 6e 2d 3e 73 68 6f 77 20 |...scree|n->show |
|00002f50| 3d 20 54 52 55 45 3b 0a | 09 09 09 09 72 65 73 65 |= TRUE;.|....rese|
|00002f60| 6c 65 63 74 77 69 6e 64 | 6f 77 28 73 63 72 65 65 |lectwind|ow(scree|
|00002f70| 6e 29 3b 0a 09 09 09 09 | 69 66 28 73 63 72 65 65 |n);.....|if(scree|
|00002f80| 6e 2d 3e 69 63 6f 6e 5f | 73 68 6f 77 20 26 26 20 |n->icon_|show && |
|00002f90| 73 63 72 65 65 6e 2d 3e | 64 65 69 63 6f 6e 77 61 |screen->|deiconwa|
|00002fa0| 72 70 29 0a 09 09 09 09 | 20 20 20 20 44 65 69 63 |rp).....| Deic|
|00002fb0| 6f 6e 57 61 72 70 28 73 | 63 72 65 65 6e 29 3b 0a |onWarp(s|creen);.|
|00002fc0| 0a 09 09 09 09 73 63 72 | 65 65 6e 2d 3e 69 63 6f |.....scr|een->ico|
|00002fd0| 6e 5f 73 68 6f 77 20 3d | 20 46 41 4c 53 45 3b 0a |n_show =| FALSE;.|
|00002fe0| 09 09 09 09 73 63 72 65 | 65 6e 2d 3e 69 63 6f 6e |....scre|en->icon|
|00002ff0| 69 6e 70 75 74 20 3d 20 | 46 41 4c 53 45 3b 0a 09 |input = |FALSE;..|
|00003000| 09 09 7d 0a 09 09 09 56 | 54 45 78 70 6f 73 65 28 |..}....V|TExpose(|
|00003010| 72 65 70 29 3b 0a 09 09 | 7d 20 65 6c 73 65 20 69 |rep);...|} else i|
|00003020| 66 28 77 69 6e 64 6f 77 | 20 3d 3d 20 73 63 72 65 |f(window| == scre|
|00003030| 65 6e 2d 3e 66 75 6c 6c | 54 77 69 6e 2e 77 69 6e |en->full|Twin.win|
|00003040| 64 6f 77 29 20 7b 0a 23 | 69 66 64 65 66 20 44 45 |dow) {.#|ifdef DE|
|00003050| 42 55 47 0a 09 09 09 69 | 66 28 64 65 62 75 67 29 |BUG....i|f(debug)|
|00003060| 0a 09 09 09 09 66 70 75 | 74 73 28 22 45 78 70 6f |.....fpu|ts("Expo|
|00003070| 73 65 57 69 6e 64 6f 77 | 20 54 65 6b 5c 6e 22 2c |seWindow| Tek\n",|
|00003080| 20 73 74 64 65 72 72 29 | 3b 0a 23 65 6e 64 69 66 | stderr)|;.#endif|
|00003090| 20 44 45 42 55 47 0a 09 | 09 09 69 66 28 21 73 63 | DEBUG..|..if(!sc|
|000030a0| 72 65 65 6e 2d 3e 54 73 | 68 6f 77 29 20 7b 0a 09 |reen->Ts|how) {..|
|000030b0| 09 09 09 73 63 72 65 65 | 6e 2d 3e 6d 61 70 70 65 |...scree|n->mappe|
|000030c0| 64 54 77 69 6e 20 3d 20 | 26 73 63 72 65 65 6e 2d |dTwin = |&screen-|
|000030d0| 3e 66 75 6c 6c 54 77 69 | 6e 3b 0a 09 09 09 09 69 |>fullTwi|n;.....i|
|000030e0| 66 28 73 63 72 65 65 6e | 2d 3e 69 63 6f 6e 75 6e |f(screen|->iconun|
|000030f0| 6d 61 70 29 20 7b 0a 09 | 09 09 09 09 73 63 72 65 |map) {..|....scre|
|00003100| 65 6e 2d 3e 69 63 6f 6e | 75 6e 6d 61 70 20 3d 20 |en->icon|unmap = |
|00003110| 46 41 4c 53 45 3b 0a 09 | 09 09 09 09 58 4d 61 70 |FALSE;..|....XMap|
|00003120| 57 69 6e 64 6f 77 28 20 | 73 63 72 65 65 6e 2d 3e |Window( |screen->|
|00003130| 66 75 6c 6c 56 77 69 6e | 2e 77 69 6e 64 6f 77 20 |fullVwin|.window |
|00003140| 29 3b 0a 09 09 09 09 09 | 73 63 72 65 65 6e 2d 3e |);......|screen->|
|00003150| 73 68 6f 77 20 3d 20 54 | 52 55 45 3b 0a 09 09 09 |show = T|RUE;....|
|00003160| 09 09 69 66 28 73 63 72 | 65 65 6e 2d 3e 54 65 6b |..if(scr|een->Tek|
|00003170| 45 6d 75 29 20 7b 0a 09 | 09 09 09 09 20 20 20 20 |Emu) {..|.... |
|00003180| 73 63 72 65 65 6e 2d 3e | 68 6f 6c 64 6f 66 66 20 |screen->|holdoff |
|00003190| 3d 20 54 52 55 45 3b 0a | 09 09 09 09 09 20 20 20 |= TRUE;.|..... |
|000031a0| 20 58 55 6e 6d 61 70 54 | 72 61 6e 73 70 61 72 65 | XUnmapT|ranspare|
|000031b0| 6e 74 28 54 57 69 6e 64 | 6f 77 28 73 63 72 65 65 |nt(TWind|ow(scree|
|000031c0| 6e 29 29 3b 0a 09 09 09 | 09 09 20 20 20 20 58 4d |n));....|.. XM|
|000031d0| 61 70 57 69 6e 64 6f 77 | 28 54 57 69 6e 64 6f 77 |apWindow|(TWindow|
|000031e0| 28 73 63 72 65 65 6e 29 | 29 3b 0a 09 09 09 09 09 |(screen)|);......|
|000031f0| 20 20 20 20 62 72 65 61 | 6b 3b 0a 09 09 09 09 09 | brea|k;......|
|00003200| 7d 0a 09 09 09 09 7d 20 | 65 6c 73 65 20 7b 0a 09 |}.....} |else {..|
|00003210| 09 09 09 09 73 63 72 65 | 65 6e 2d 3e 74 69 6d 65 |....scre|en->time|
|00003220| 72 20 3d 20 30 3b 0a 09 | 09 09 09 09 73 63 72 65 |r = 0;..|....scre|
|00003230| 65 6e 2d 3e 68 6f 6c 64 | 6f 66 66 20 3d 20 46 41 |en->hold|off = FA|
|00003240| 4c 53 45 3b 0a 09 09 09 | 09 7d 0a 09 09 09 09 73 |LSE;....|.}.....s|
|00003250| 63 72 65 65 6e 2d 3e 54 | 73 68 6f 77 20 3d 20 54 |creen->T|show = T|
|00003260| 52 55 45 3b 0a 09 09 09 | 09 72 65 73 65 6c 65 63 |RUE;....|.reselec|
|00003270| 74 77 69 6e 64 6f 77 28 | 73 63 72 65 65 6e 29 3b |twindow(|screen);|
|00003280| 0a 09 09 09 09 69 66 28 | 73 63 72 65 65 6e 2d 3e |.....if(|screen->|
|00003290| 69 63 6f 6e 5f 73 68 6f | 77 20 26 26 20 73 63 72 |icon_sho|w && scr|
|000032a0| 65 65 6e 2d 3e 64 65 69 | 63 6f 6e 77 61 72 70 29 |een->dei|conwarp)|
|000032b0| 0a 09 09 09 09 09 44 65 | 69 63 6f 6e 57 61 72 70 |......De|iconWarp|
|000032c0| 28 73 63 72 65 65 6e 29 | 3b 0a 09 09 09 09 73 63 |(screen)|;.....sc|
|000032d0| 72 65 65 6e 2d 3e 69 63 | 6f 6e 5f 73 68 6f 77 20 |reen->ic|on_show |
|000032e0| 3d 20 46 41 4c 53 45 3b | 0a 09 09 09 09 73 63 72 |= FALSE;|.....scr|
|000032f0| 65 65 6e 2d 3e 69 63 6f | 6e 69 6e 70 75 74 20 3d |een->ico|ninput =|
|00003300| 20 46 41 4c 53 45 3b 0a | 09 09 09 7d 0a 09 09 09 | FALSE;.|...}....|
|00003310| 54 65 6b 45 78 70 6f 73 | 65 28 72 65 70 29 3b 0a |TekExpos|e(rep);.|
|00003320| 09 09 7d 0a 09 09 62 72 | 65 61 6b 3b 0a 0a 09 20 |..}...br|eak;... |
|00003330| 63 61 73 65 20 45 78 70 | 6f 73 65 52 65 67 69 6f |case Exp|oseRegio|
|00003340| 6e 3a 0a 09 09 69 66 20 | 28 21 73 63 72 65 65 6e |n:...if |(!screen|
|00003350| 2d 3e 61 63 74 69 76 65 | 5f 69 63 6f 6e 20 26 26 |->active|_icon &&|
|00003360| 20 77 69 6e 64 6f 77 20 | 3d 3d 20 73 63 72 65 65 | window |== scree|
|00003370| 6e 2d 3e 69 63 6f 6e 56 | 77 69 6e 2e 77 69 6e 64 |n->iconV|win.wind|
|00003380| 6f 77 20 7c 7c 0a 09 09 | 09 20 20 20 77 69 6e 64 |ow ||...|. wind|
|00003390| 6f 77 20 3d 3d 20 73 63 | 72 65 65 6e 2d 3e 69 63 |ow == sc|reen->ic|
|000033a0| 6f 6e 54 77 69 6e 2e 77 | 69 6e 64 6f 77 29 20 7b |onTwin.w|indow) {|
|000033b0| 0a 23 69 66 64 65 66 20 | 44 45 42 55 47 0a 09 09 |.#ifdef |DEBUG...|
|000033c0| 09 69 66 28 64 65 62 75 | 67 29 0a 09 09 09 09 66 |.if(debu|g).....f|
|000033d0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|000033e0| 45 78 70 6f 73 65 52 65 | 67 69 6f 6e 20 25 73 5c |ExposeRe|gion %s\|
|000033f0| 6e 22 2c 20 77 69 6e 64 | 6f 77 20 3d 3d 0a 09 09 |n", wind|ow ==...|
|00003400| 09 09 20 73 63 72 65 65 | 6e 2d 3e 69 63 6f 6e 56 |.. scree|n->iconV|
|00003410| 77 69 6e 2e 77 69 6e 64 | 6f 77 20 3f 20 22 69 63 |win.wind|ow ? "ic|
|00003420| 6f 6e 22 20 3a 20 22 54 | 69 63 6f 6e 22 29 3b 0a |on" : "T|icon");.|
|00003430| 23 65 6e 64 69 66 20 44 | 45 42 55 47 0a 09 09 09 |#endif D|EBUG....|
|00003440| 52 65 66 72 65 73 68 49 | 63 6f 6e 28 73 63 72 65 |RefreshI|con(scre|
|00003450| 65 6e 2c 20 77 69 6e 64 | 6f 77 29 3b 0a 09 09 09 |en, wind|ow);....|
|00003460| 62 72 65 61 6b 3b 0a 09 | 09 7d 0a 23 69 66 64 65 |break;..|.}.#ifde|
|00003470| 66 20 44 45 42 55 47 0a | 09 09 69 66 28 64 65 62 |f DEBUG.|..if(deb|
|00003480| 75 67 29 0a 09 09 09 66 | 70 75 74 73 28 22 45 78 |ug)....f|puts("Ex|
|00003490| 70 6f 73 65 52 65 67 69 | 6f 6e 5c 6e 22 2c 20 73 |poseRegi|on\n", s|
|000034a0| 74 64 65 72 72 29 3b 0a | 23 65 6e 64 69 66 20 44 |tderr);.|#endif D|
|000034b0| 45 42 55 47 0a 09 09 69 | 66 20 28 28 28 58 45 78 |EBUG...i|f (((XEx|
|000034c0| 70 6f 73 65 57 69 6e 64 | 6f 77 45 76 65 6e 74 20 |poseWind|owEvent |
|000034d0| 2a 29 72 65 70 29 2d 3e | 64 65 74 61 69 6c 20 3d |*)rep)->|detail =|
|000034e0| 3d 20 45 78 70 6f 73 65 | 43 6f 70 79 20 26 26 0a |= Expose|Copy &&.|
|000034f0| 09 09 20 20 20 20 73 63 | 72 65 65 6e 2d 3e 69 6e |.. sc|reen->in|
|00003500| 63 6f 70 79 20 3c 3d 20 | 30 29 20 7b 0a 09 09 09 |copy <= |0) {....|
|00003510| 73 63 72 65 65 6e 2d 3e | 69 6e 63 6f 70 79 20 3d |screen->|incopy =|
|00003520| 20 31 3b 0a 09 09 09 69 | 66 20 28 73 63 72 65 65 | 1;....i|f (scree|
|00003530| 6e 2d 3e 73 63 72 6f 6c | 6c 73 20 3e 20 30 29 0a |n->scrol|ls > 0).|
|00003540| 09 09 09 09 73 63 72 65 | 65 6e 2d 3e 73 63 72 6f |....scre|en->scro|
|00003550| 6c 6c 73 2d 2d 3b 0a 09 | 09 7d 0a 09 09 69 66 20 |lls--;..|.}...if |
|00003560| 28 48 61 6e 64 6c 65 45 | 78 70 6f 73 75 72 65 20 |(HandleE|xposure |
|00003570| 28 73 63 72 65 65 6e 2c | 20 72 65 70 29 29 0a 09 |(screen,| rep))..|
|00003580| 09 09 73 63 72 65 65 6e | 2d 3e 63 75 72 73 6f 72 |..screen|->cursor|
|00003590| 5f 73 74 61 74 65 20 3d | 20 4f 46 46 3b 0a 09 09 |_state =| OFF;...|
|000035a0| 62 72 65 61 6b 3b 0a 0a | 09 20 63 61 73 65 20 45 |break;..|. case E|
|000035b0| 78 70 6f 73 65 43 6f 70 | 79 3a 0a 23 69 66 64 65 |xposeCop|y:.#ifde|
|000035c0| 66 20 44 45 42 55 47 0a | 09 09 09 69 66 28 64 65 |f DEBUG.|...if(de|
|000035d0| 62 75 67 29 0a 09 09 09 | 09 66 70 75 74 73 28 22 |bug)....|.fputs("|
|000035e0| 45 78 70 6f 73 65 43 6f | 70 79 5c 6e 22 2c 20 73 |ExposeCo|py\n", s|
|000035f0| 74 64 65 72 72 29 3b 0a | 23 65 6e 64 69 66 20 44 |tderr);.|#endif D|
|00003600| 45 42 55 47 0a 09 09 69 | 66 20 28 73 63 72 65 65 |EBUG...i|f (scree|
|00003610| 6e 2d 3e 69 6e 63 6f 70 | 79 20 3c 3d 20 30 20 26 |n->incop|y <= 0 &|
|00003620| 26 20 73 63 72 65 65 6e | 2d 3e 73 63 72 6f 6c 6c |& screen|->scroll|
|00003630| 73 20 3e 20 30 29 0a 09 | 09 09 73 63 72 65 65 6e |s > 0)..|..screen|
|00003640| 2d 3e 73 63 72 6f 6c 6c | 73 2d 2d 3b 0a 09 09 69 |->scroll|s--;...i|
|00003650| 66 20 28 73 63 72 65 65 | 6e 2d 3e 73 63 72 6f 6c |f (scree|n->scrol|
|00003660| 6c 73 29 0a 09 09 09 73 | 63 72 65 65 6e 2d 3e 69 |ls)....s|creen->i|
|00003670| 6e 63 6f 70 79 20 3d 20 | 2d 31 3b 0a 09 09 65 6c |ncopy = |-1;...el|
|00003680| 73 65 0a 09 09 09 73 63 | 72 65 65 6e 2d 3e 69 6e |se....sc|reen->in|
|00003690| 63 6f 70 79 20 3d 20 30 | 3b 0a 09 09 62 72 65 61 |copy = 0|;...brea|
|000036a0| 6b 3b 0a 0a 09 20 63 61 | 73 65 20 42 75 74 74 6f |k;... ca|se Butto|
|000036b0| 6e 50 72 65 73 73 65 64 | 3a 0a 09 09 69 66 20 28 |nPressed|:...if (|
|000036c0| 73 63 72 65 65 6e 2d 3e | 69 6e 63 6f 70 79 29 0a |screen->|incopy).|
|000036d0| 09 09 09 43 6f 70 79 57 | 61 69 74 20 28 73 63 72 |...CopyW|ait (scr|
|000036e0| 65 65 6e 29 3b 0a 09 09 | 69 66 28 77 69 6e 64 6f |een);...|if(windo|
|000036f0| 77 20 3d 3d 20 73 63 72 | 65 65 6e 2d 3e 69 63 6f |w == scr|een->ico|
|00003700| 6e 56 77 69 6e 2e 77 69 | 6e 64 6f 77 29 20 7b 0a |nVwin.wi|ndow) {.|
|00003710| 23 69 66 64 65 66 20 44 | 45 42 55 47 0a 09 09 09 |#ifdef D|EBUG....|
|00003720| 69 66 28 64 65 62 75 67 | 29 0a 09 09 09 09 66 70 |if(debug|).....fp|
|00003730| 75 74 73 28 22 42 75 74 | 74 6f 6e 50 72 65 73 73 |uts("But|tonPress|
|00003740| 65 64 20 69 63 6f 6e 5c | 6e 22 2c 20 73 74 64 65 |ed icon\|n", stde|
|00003750| 72 72 29 3b 0a 23 65 6e | 64 69 66 20 44 45 42 55 |rr);.#en|dif DEBU|
|00003760| 47 0a 09 09 09 58 55 6e | 6d 61 70 57 69 6e 64 6f |G....XUn|mapWindo|
|00003770| 77 28 77 69 6e 64 6f 77 | 29 3b 0a 09 09 09 69 66 |w(window|);....if|
|00003780| 28 73 63 72 65 65 6e 2d | 3e 54 69 63 6f 6e 75 6e |(screen-|>Ticonun|
|00003790| 6d 61 70 20 26 26 20 21 | 73 63 72 65 65 6e 2d 3e |map && !|screen->|
|000037a0| 54 65 6b 45 6d 75 29 20 | 7b 0a 09 09 09 09 73 63 |TekEmu) |{.....sc|
|000037b0| 72 65 65 6e 2d 3e 54 69 | 63 6f 6e 75 6e 6d 61 70 |reen->Ti|conunmap|
|000037c0| 20 3d 20 46 41 4c 53 45 | 3b 0a 09 09 09 09 58 4d | = FALSE|;.....XM|
|000037d0| 61 70 57 69 6e 64 6f 77 | 28 54 57 69 6e 64 6f 77 |apWindow|(TWindow|
|000037e0| 28 73 63 72 65 65 6e 29 | 29 3b 0a 09 09 09 09 73 |(screen)|);.....s|
|000037f0| 63 72 65 65 6e 2d 3e 54 | 73 68 6f 77 20 3d 20 54 |creen->T|show = T|
|00003800| 52 55 45 3b 0a 09 09 09 | 09 73 63 72 65 65 6e 2d |RUE;....|.screen-|
|00003810| 3e 68 6f 6c 64 6f 66 66 | 20 3d 20 54 52 55 45 3b |>holdoff| = TRUE;|
|00003820| 0a 09 09 09 7d 0a 09 09 | 09 58 4d 61 70 57 69 6e |....}...|.XMapWin|
|00003830| 64 6f 77 28 73 63 72 65 | 65 6e 2d 3e 66 75 6c 6c |dow(scre|en->full|
|00003840| 56 77 69 6e 2e 77 69 6e | 64 6f 77 29 3b 0a 09 09 |Vwin.win|dow);...|
|00003850| 09 62 72 65 61 6b 3b 0a | 09 09 7d 20 65 6c 73 65 |.break;.|..} else|
|00003860| 20 69 66 28 77 69 6e 64 | 6f 77 20 3d 3d 20 73 63 | if(wind|ow == sc|
|00003870| 72 65 65 6e 2d 3e 69 63 | 6f 6e 54 77 69 6e 2e 77 |reen->ic|onTwin.w|
|00003880| 69 6e 64 6f 77 29 20 7b | 0a 23 69 66 64 65 66 20 |indow) {|.#ifdef |
|00003890| 44 45 42 55 47 0a 09 09 | 09 69 66 28 64 65 62 75 |DEBUG...|.if(debu|
|000038a0| 67 29 0a 09 09 09 09 66 | 70 75 74 73 28 22 42 75 |g).....f|puts("Bu|
|000038b0| 74 74 6f 6e 50 72 65 73 | 73 65 64 20 54 69 63 6f |ttonPres|sed Tico|
|000038c0| 6e 5c 6e 22 2c 20 73 74 | 64 65 72 72 29 3b 0a 23 |n\n", st|derr);.#|
|000038d0| 65 6e 64 69 66 20 44 45 | 42 55 47 0a 09 09 09 58 |endif DE|BUG....X|
|000038e0| 55 6e 6d 61 70 57 69 6e | 64 6f 77 28 77 69 6e 64 |UnmapWin|dow(wind|
|000038f0| 6f 77 29 3b 0a 09 09 09 | 69 66 28 73 63 72 65 65 |ow);....|if(scree|
|00003900| 6e 2d 3e 69 63 6f 6e 75 | 6e 6d 61 70 20 26 26 20 |n->iconu|nmap && |
|00003910| 73 63 72 65 65 6e 2d 3e | 54 65 6b 45 6d 75 29 20 |screen->|TekEmu) |
|00003920| 7b 0a 09 09 09 09 73 63 | 72 65 65 6e 2d 3e 69 63 |{.....sc|reen->ic|
|00003930| 6f 6e 75 6e 6d 61 70 20 | 3d 20 46 41 4c 53 45 3b |onunmap |= FALSE;|
|00003940| 0a 09 09 09 09 58 4d 61 | 70 57 69 6e 64 6f 77 28 |.....XMa|pWindow(|
|00003950| 56 57 69 6e 64 6f 77 28 | 73 63 72 65 65 6e 29 29 |VWindow(|screen))|
|00003960| 3b 0a 09 09 09 09 73 63 | 72 65 65 6e 2d 3e 73 68 |;.....sc|reen->sh|
|00003970| 6f 77 20 3d 20 54 52 55 | 45 3b 0a 09 09 09 09 73 |ow = TRU|E;.....s|
|00003980| 63 72 65 65 6e 2d 3e 68 | 6f 6c 64 6f 66 66 20 3d |creen->h|oldoff =|
|00003990| 20 54 52 55 45 3b 0a 09 | 09 09 7d 0a 09 09 09 58 | TRUE;..|..}....X|
|000039a0| 4d 61 70 57 69 6e 64 6f | 77 28 73 63 72 65 65 6e |MapWindo|w(screen|
|000039b0| 2d 3e 66 75 6c 6c 54 77 | 69 6e 2e 77 69 6e 64 6f |->fullTw|in.windo|
|000039c0| 77 29 3b 0a 09 09 09 62 | 72 65 61 6b 3b 0a 09 09 |w);....b|reak;...|
|000039d0| 7d 0a 09 09 2f 2a 20 64 | 72 6f 70 20 74 68 72 6f |}.../* d|rop thro|
|000039e0| 75 67 68 20 2a 2f 0a 09 | 20 63 61 73 65 20 42 75 |ugh */..| case Bu|
|000039f0| 74 74 6f 6e 52 65 6c 65 | 61 73 65 64 3a 0a 23 69 |ttonRele|ased:.#i|
|00003a00| 66 64 65 66 20 44 45 42 | 55 47 0a 09 09 09 69 66 |fdef DEB|UG....if|
|00003a10| 28 64 65 62 75 67 29 0a | 09 09 09 09 66 70 75 74 |(debug).|....fput|
|00003a20| 73 28 22 42 75 74 74 6f | 6e 50 72 65 73 73 65 64 |s("Butto|nPressed|
|00003a30| 20 6f 72 20 42 75 74 74 | 6f 6e 52 65 6c 65 61 73 | or Butt|onReleas|
|00003a40| 65 64 5c 6e 22 2c 0a 09 | 09 09 09 20 73 74 64 65 |ed\n",..|... stde|
|00003a50| 72 72 29 3b 0a 23 65 6e | 64 69 66 20 44 45 42 55 |rr);.#en|dif DEBU|
|00003a60| 47 0a 09 09 48 61 6e 64 | 6c 65 42 75 74 74 6f 6e |G...Hand|leButton|
|00003a70| 73 28 26 74 65 72 6d 2c | 20 72 65 70 2c 20 73 63 |s(&term,| rep, sc|
|00003a80| 72 65 65 6e 2d 3e 72 65 | 73 70 6f 6e 64 29 3b 0a |reen->re|spond);.|
|00003a90| 09 09 62 72 65 61 6b 3b | 0a 0a 09 20 63 61 73 65 |..break;|... case|
|00003aa0| 20 55 6e 6d 61 70 57 69 | 6e 64 6f 77 3a 09 09 2f | UnmapWi|ndow:../|
|00003ab0| 2a 20 66 75 6c 6c 20 77 | 69 6e 64 6f 77 73 20 2a |* full w|indows *|
|00003ac0| 2f 0a 09 09 69 66 20 28 | 77 69 6e 64 6f 77 20 3d |/...if (|window =|
|00003ad0| 3d 20 73 63 72 65 65 6e | 2d 3e 66 75 6c 6c 56 77 |= screen|->fullVw|
|00003ae0| 69 6e 2e 77 69 6e 64 6f | 77 29 20 7b 0a 23 69 66 |in.windo|w) {.#if|
|00003af0| 64 65 66 20 44 45 42 55 | 47 0a 09 09 09 69 66 28 |def DEBU|G....if(|
|00003b00| 64 65 62 75 67 29 0a 09 | 09 09 09 66 70 75 74 73 |debug)..|...fputs|
|00003b10| 28 22 55 6e 6d 61 70 57 | 69 6e 64 6f 77 20 56 54 |("UnmapW|indow VT|
|00003b20| 5c 6e 22 2c 20 73 74 64 | 65 72 72 29 3b 0a 23 65 |\n", std|err);.#e|
|00003b30| 6e 64 69 66 20 44 45 42 | 55 47 0a 09 09 09 69 66 |ndif DEB|UG....if|
|00003b40| 20 28 73 63 72 65 65 6e | 2d 3e 66 75 6c 6c 56 77 | (screen|->fullVw|
|00003b50| 69 6e 2e 74 69 74 6c 65 | 62 61 72 29 0a 09 09 09 |in.title|bar)....|
|00003b60| 09 56 54 54 69 74 6c 65 | 55 6e 68 69 6c 69 74 65 |.VTTitle|Unhilite|
|00003b70| 28 29 3b 0a 09 09 09 73 | 63 72 65 65 6e 2d 3e 73 |();....s|creen->s|
|00003b80| 68 6f 77 20 3d 20 46 41 | 4c 53 45 3b 0a 09 09 09 |how = FA|LSE;....|
|00003b90| 69 66 28 73 63 72 65 65 | 6e 2d 3e 54 73 68 6f 77 |if(scree|n->Tshow|
|00003ba0| 29 20 7b 0a 09 09 09 09 | 73 63 72 65 65 6e 2d 3e |) {.....|screen->|
|00003bb0| 54 69 63 6f 6e 75 6e 6d | 61 70 20 3d 20 54 52 55 |Ticonunm|ap = TRU|
|00003bc0| 45 3b 0a 09 09 09 09 73 | 63 72 65 65 6e 2d 3e 54 |E;.....s|creen->T|
|00003bd0| 73 68 6f 77 20 3d 20 46 | 41 4c 53 45 3b 0a 09 09 |show = F|ALSE;...|
|00003be0| 09 09 58 55 6e 6d 61 70 | 57 69 6e 64 6f 77 28 20 |..XUnmap|Window( |
|00003bf0| 73 63 72 65 65 6e 2d 3e | 66 75 6c 6c 54 77 69 6e |screen->|fullTwin|
|00003c00| 2e 77 69 6e 64 6f 77 20 | 29 3b 0a 09 09 09 09 53 |.window |);.....S|
|00003c10| 79 6e 63 55 6e 6d 61 70 | 28 20 73 63 72 65 65 6e |yncUnmap|( screen|
|00003c20| 2d 3e 66 75 6c 6c 54 77 | 69 6e 2e 77 69 6e 64 6f |->fullTw|in.windo|
|00003c30| 77 2c 0a 09 09 09 09 09 | 20 20 20 54 57 49 4e 44 |w,......| TWIND|
|00003c40| 4f 57 45 56 45 4e 54 53 | 20 29 3b 0a 09 09 09 7d |OWEVENTS| );....}|
|00003c50| 0a 09 09 7d 20 65 6c 73 | 65 20 69 66 28 77 69 6e |...} els|e if(win|
|00003c60| 64 6f 77 20 3d 3d 20 73 | 63 72 65 65 6e 2d 3e 66 |dow == s|creen->f|
|00003c70| 75 6c 6c 54 77 69 6e 2e | 77 69 6e 64 6f 77 29 20 |ullTwin.|window) |
|00003c80| 7b 0a 23 69 66 64 65 66 | 20 44 45 42 55 47 0a 09 |{.#ifdef| DEBUG..|
|00003c90| 09 09 69 66 28 64 65 62 | 75 67 29 0a 09 09 09 09 |..if(deb|ug).....|
|00003ca0| 66 70 75 74 73 28 22 55 | 6e 6d 61 70 57 69 6e 64 |fputs("U|nmapWind|
|00003cb0| 6f 77 20 54 65 6b 5c 6e | 22 2c 20 73 74 64 65 72 |ow Tek\n|", stder|
|00003cc0| 72 29 3b 0a 23 65 6e 64 | 69 66 20 44 45 42 55 47 |r);.#end|if DEBUG|
|00003cd0| 0a 09 09 09 69 66 20 28 | 73 63 72 65 65 6e 2d 3e |....if (|screen->|
|00003ce0| 66 75 6c 6c 54 77 69 6e | 2e 74 69 74 6c 65 62 61 |fullTwin|.titleba|
|00003cf0| 72 29 0a 09 09 09 09 54 | 65 6b 54 69 74 6c 65 55 |r).....T|ekTitleU|
|00003d00| 6e 68 69 6c 69 74 65 28 | 29 3b 0a 09 09 09 73 63 |nhilite(|);....sc|
|00003d10| 72 65 65 6e 2d 3e 54 73 | 68 6f 77 20 3d 20 46 41 |reen->Ts|how = FA|
|00003d20| 4c 53 45 3b 0a 09 09 09 | 69 66 28 73 63 72 65 65 |LSE;....|if(scree|
|00003d30| 6e 2d 3e 73 68 6f 77 29 | 20 7b 0a 09 09 09 09 73 |n->show)| {.....s|
|00003d40| 63 72 65 65 6e 2d 3e 69 | 63 6f 6e 75 6e 6d 61 70 |creen->i|conunmap|
|00003d50| 20 3d 20 54 52 55 45 3b | 0a 09 09 09 09 73 63 72 | = TRUE;|.....scr|
|00003d60| 65 65 6e 2d 3e 73 68 6f | 77 20 3d 20 46 41 4c 53 |een->sho|w = FALS|
|00003d70| 45 3b 0a 09 09 09 09 58 | 55 6e 6d 61 70 57 69 6e |E;.....X|UnmapWin|
|00003d80| 64 6f 77 28 20 73 63 72 | 65 65 6e 2d 3e 66 75 6c |dow( scr|een->ful|
|00003d90| 6c 56 77 69 6e 2e 77 69 | 6e 64 6f 77 20 29 3b 0a |lVwin.wi|ndow );.|
|00003da0| 09 09 09 09 53 79 6e 63 | 55 6e 6d 61 70 28 20 73 |....Sync|Unmap( s|
|00003db0| 63 72 65 65 6e 2d 3e 66 | 75 6c 6c 56 77 69 6e 2e |creen->f|ullVwin.|
|00003dc0| 77 69 6e 64 6f 77 2c 0a | 09 09 09 09 09 20 20 20 |window,.|..... |
|00003dd0| 57 49 4e 44 4f 57 45 56 | 45 4e 54 53 20 29 3b 0a |WINDOWEV|ENTS );.|
|00003de0| 09 09 09 7d 0a 09 09 7d | 0a 09 09 72 65 73 65 6c |...}...}|...resel|
|00003df0| 65 63 74 77 69 6e 64 6f | 77 28 73 63 72 65 65 6e |ectwindo|w(screen|
|00003e00| 29 3b 0a 09 09 73 63 72 | 65 65 6e 2d 3e 74 69 6d |);...scr|een->tim|
|00003e10| 65 72 20 3d 20 30 3b 0a | 09 09 62 72 65 61 6b 3b |er = 0;.|..break;|
|00003e20| 0a 09 20 63 61 73 65 20 | 45 6e 74 65 72 57 69 6e |.. case |EnterWin|
|00003e30| 64 6f 77 3a 0a 09 09 69 | 66 28 73 63 72 65 65 6e |dow:...i|f(screen|
|00003e40| 2d 3e 73 62 29 20 7b 0a | 09 09 09 69 66 28 77 69 |->sb) {.|...if(wi|
|00003e50| 6e 64 6f 77 20 3d 3d 20 | 73 63 72 65 65 6e 2d 3e |ndow == |screen->|
|00003e60| 73 62 2d 3e 62 75 74 74 | 6f 6e 29 20 7b 0a 09 09 |sb->butt|on) {...|
|00003e70| 09 09 69 66 28 28 69 20 | 3d 20 47 65 74 42 75 74 |..if((i |= GetBut|
|00003e80| 74 6f 6e 53 74 61 74 65 | 28 73 63 72 65 65 6e 2d |tonState|(screen-|
|00003e90| 3e 73 62 29 29 20 21 3d | 0a 09 09 09 09 20 42 55 |>sb)) !=|..... BU|
|00003ea0| 54 54 4f 4e 5f 4e 4f 52 | 4d 41 4c 29 0a 09 09 09 |TTON_NOR|MAL)....|
|00003eb0| 09 09 53 65 74 42 75 74 | 74 6f 6e 53 74 61 74 65 |..SetBut|tonState|
|00003ec0| 28 73 63 72 65 65 6e 2d | 3e 73 62 2c 20 69 20 7c |(screen-|>sb, i ||
|00003ed0| 20 48 49 4c 49 54 45 44 | 29 3b 0a 09 09 09 09 62 | HILITED|);.....b|
|00003ee0| 72 65 61 6b 3b 0a 09 09 | 09 7d 20 65 6c 73 65 20 |reak;...|.} else |
|00003ef0| 69 66 28 77 69 6e 64 6f | 77 20 3d 3d 20 73 63 72 |if(windo|w == scr|
|00003f00| 65 65 6e 2d 3e 73 62 2d | 3e 62 61 72 29 0a 09 09 |een->sb-|>bar)...|
|00003f10| 09 09 62 72 65 61 6b 3b | 0a 09 09 7d 0a 09 09 69 |..break;|...}...i|
|00003f20| 66 28 28 77 69 6e 64 6f | 77 20 3d 3d 20 56 57 69 |f((windo|w == VWi|
|00003f30| 6e 64 6f 77 28 73 63 72 | 65 65 6e 29 20 7c 7c 20 |ndow(scr|een) || |
|00003f40| 77 69 6e 64 6f 77 20 3d | 3d 20 54 57 69 6e 64 6f |window =|= TWindo|
|00003f50| 77 28 73 63 72 65 65 6e | 29 29 20 26 26 0a 09 09 |w(screen|)) &&...|
|00003f60| 20 28 28 28 58 45 6e 74 | 65 72 57 69 6e 64 6f 77 | (((XEnt|erWindow|
|00003f70| 45 76 65 6e 74 20 2a 29 | 72 65 70 29 2d 3e 64 65 |Event *)|rep)->de|
|00003f80| 74 61 69 6c 20 26 20 30 | 78 66 66 29 20 21 3d 0a |tail & 0|xff) !=.|
|00003f90| 09 09 20 49 6e 74 6f 4f | 72 46 72 6f 6d 53 75 62 |.. IntoO|rFromSub|
|00003fa0| 77 69 6e 64 6f 77 29 20 | 7b 0a 23 69 66 64 65 66 |window) |{.#ifdef|
|00003fb0| 20 44 45 42 55 47 0a 09 | 09 09 69 66 28 64 65 62 | DEBUG..|..if(deb|
|00003fc0| 75 67 29 0a 09 09 09 09 | 66 70 72 69 6e 74 66 28 |ug).....|fprintf(|
|00003fd0| 73 74 64 65 72 72 2c 20 | 22 45 6e 74 65 72 57 69 |stderr, |"EnterWi|
|00003fe0| 6e 64 6f 77 20 25 73 5c | 6e 22 2c 20 77 69 6e 64 |ndow %s\|n", wind|
|00003ff0| 6f 77 20 3d 3d 0a 09 09 | 09 09 20 56 57 69 6e 64 |ow ==...|.. VWind|
|00004000| 6f 77 28 73 63 72 65 65 | 6e 29 20 3f 20 22 56 54 |ow(scree|n) ? "VT|
|00004010| 22 20 3a 20 22 54 65 6b | 22 29 3b 0a 23 65 6e 64 |" : "Tek|");.#end|
|00004020| 69 66 20 44 45 42 55 47 | 0a 09 09 09 73 63 72 65 |if DEBUG|....scre|
|00004030| 65 6e 2d 3e 61 75 74 6f | 77 69 6e 64 6f 77 20 3d |en->auto|window =|
|00004040| 20 77 69 6e 64 6f 77 3b | 0a 09 09 09 44 6f 45 6e | window;|....DoEn|
|00004050| 74 65 72 4c 65 61 76 65 | 28 73 63 72 65 65 6e 2c |terLeave|(screen,|
|00004060| 20 45 6e 74 65 72 57 69 | 6e 64 6f 77 29 3b 0a 09 | EnterWi|ndow);..|
|00004070| 09 7d 0a 09 09 62 72 65 | 61 6b 3b 0a 09 20 63 61 |.}...bre|ak;.. ca|
|00004080| 73 65 20 4c 65 61 76 65 | 57 69 6e 64 6f 77 3a 0a |se Leave|Window:.|
|00004090| 09 09 69 66 28 73 63 72 | 65 65 6e 2d 3e 73 62 29 |..if(scr|een->sb)|
|000040a0| 20 7b 0a 09 09 09 69 66 | 28 77 69 6e 64 6f 77 20 | {....if|(window |
|000040b0| 3d 3d 20 73 63 72 65 65 | 6e 2d 3e 73 62 2d 3e 62 |== scree|n->sb->b|
|000040c0| 75 74 74 6f 6e 29 20 7b | 0a 09 09 09 09 69 66 28 |utton) {|.....if(|
|000040d0| 28 69 20 3d 20 47 65 74 | 42 75 74 74 6f 6e 53 74 |(i = Get|ButtonSt|
|000040e0| 61 74 65 28 73 63 72 65 | 65 6e 2d 3e 73 62 29 29 |ate(scre|en->sb))|
|000040f0| 20 21 3d 0a 09 09 09 09 | 20 42 55 54 54 4f 4e 5f | !=.....| BUTTON_|
|00004100| 4e 4f 52 4d 41 4c 29 0a | 09 09 09 09 09 53 65 74 |NORMAL).|.....Set|
|00004110| 42 75 74 74 6f 6e 53 74 | 61 74 65 28 73 63 72 65 |ButtonSt|ate(scre|
|00004120| 65 6e 2d 3e 73 62 2c 20 | 69 26 20 7e 48 49 4c 49 |en->sb, |i& ~HILI|
|00004130| 54 45 44 29 3b 0a 09 09 | 09 09 62 72 65 61 6b 3b |TED);...|..break;|
|00004140| 0a 09 09 09 7d 20 65 6c | 73 65 20 69 66 28 77 69 |....} el|se if(wi|
|00004150| 6e 64 6f 77 20 3d 3d 20 | 73 63 72 65 65 6e 2d 3e |ndow == |screen->|
|00004160| 73 62 2d 3e 62 61 72 29 | 0a 09 09 09 09 62 72 65 |sb->bar)|.....bre|
|00004170| 61 6b 3b 0a 09 09 7d 0a | 09 09 69 66 28 28 77 69 |ak;...}.|..if((wi|
|00004180| 6e 64 6f 77 20 3d 3d 20 | 56 57 69 6e 64 6f 77 28 |ndow == |VWindow(|
|00004190| 73 63 72 65 65 6e 29 20 | 7c 7c 20 77 69 6e 64 6f |screen) ||| windo|
|000041a0| 77 20 3d 3d 20 54 57 69 | 6e 64 6f 77 28 73 63 72 |w == TWi|ndow(scr|
|000041b0| 65 65 6e 29 29 20 26 26 | 0a 09 09 20 28 28 28 58 |een)) &&|... (((X|
|000041c0| 45 6e 74 65 72 57 69 6e | 64 6f 77 45 76 65 6e 74 |EnterWin|dowEvent|
|000041d0| 20 2a 29 72 65 70 29 2d | 3e 64 65 74 61 69 6c 20 | *)rep)-|>detail |
|000041e0| 26 20 30 78 66 66 29 20 | 21 3d 0a 09 09 20 49 6e |& 0xff) |!=... In|
|000041f0| 74 6f 4f 72 46 72 6f 6d | 53 75 62 77 69 6e 64 6f |toOrFrom|Subwindo|
|00004200| 77 29 0a 23 69 66 64 65 | 66 20 44 45 42 55 47 0a |w).#ifde|f DEBUG.|
|00004210| 09 09 7b 0a 09 09 09 69 | 66 28 64 65 62 75 67 29 |..{....i|f(debug)|
|00004220| 0a 09 09 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 |.....fpr|intf(std|
|00004230| 65 72 72 2c 20 22 4c 65 | 61 76 65 57 69 6e 64 6f |err, "Le|aveWindo|
|00004240| 77 20 25 73 5c 6e 22 2c | 20 77 69 6e 64 6f 77 20 |w %s\n",| window |
|00004250| 3d 3d 0a 09 09 09 09 20 | 56 57 69 6e 64 6f 77 28 |==..... |VWindow(|
|00004260| 73 63 72 65 65 6e 29 20 | 3f 20 22 56 54 22 20 3a |screen) |? "VT" :|
|00004270| 20 22 54 65 6b 22 29 3b | 0a 23 65 6e 64 69 66 20 | "Tek");|.#endif |
|00004280| 44 45 42 55 47 0a 09 09 | 09 44 6f 45 6e 74 65 72 |DEBUG...|.DoEnter|
|00004290| 4c 65 61 76 65 28 73 63 | 72 65 65 6e 2c 20 4c 65 |Leave(sc|reen, Le|
|000042a0| 61 76 65 57 69 6e 64 6f | 77 29 3b 0a 23 69 66 64 |aveWindo|w);.#ifd|
|000042b0| 65 66 20 44 45 42 55 47 | 0a 09 09 7d 0a 23 65 6e |ef DEBUG|...}.#en|
|000042c0| 64 69 66 20 44 45 42 55 | 47 0a 09 09 62 72 65 61 |dif DEBU|G...brea|
|000042d0| 6b 3b 0a 09 20 63 61 73 | 65 20 46 6f 63 75 73 43 |k;.. cas|e FocusC|
|000042e0| 68 61 6e 67 65 3a 0a 09 | 09 69 66 28 28 28 58 46 |hange:..|.if(((XF|
|000042f0| 6f 63 75 73 43 68 61 6e | 67 65 45 76 65 6e 74 20 |ocusChan|geEvent |
|00004300| 2a 29 72 65 70 29 2d 3e | 64 65 74 61 69 6c 20 3d |*)rep)->|detail =|
|00004310| 3d 20 45 6e 74 65 72 57 | 69 6e 64 6f 77 29 0a 09 |= EnterW|indow)..|
|00004320| 09 09 73 65 6c 65 63 74 | 77 69 6e 64 6f 77 28 73 |..select|window(s|
|00004330| 63 72 65 65 6e 2c 20 46 | 4f 43 55 53 29 3b 0a 09 |creen, F|OCUS);..|
|00004340| 09 65 6c 73 65 0a 09 09 | 09 75 6e 73 65 6c 65 63 |.else...|.unselec|
|00004350| 74 77 69 6e 64 6f 77 28 | 73 63 72 65 65 6e 2c 20 |twindow(|screen, |
|00004360| 46 4f 43 55 53 29 3b 0a | 09 09 62 72 65 61 6b 3b |FOCUS);.|..break;|
|00004370| 0a 09 20 64 65 66 61 75 | 6c 74 3a 0a 09 09 62 72 |.. defau|lt:...br|
|00004380| 65 61 6b 3b 0a 09 7d 0a | 7d 0a 0a 73 65 6c 65 63 |eak;..}.|}..selec|
|00004390| 74 77 69 6e 64 6f 77 28 | 73 63 72 65 65 6e 2c 20 |twindow(|screen, |
|000043a0| 66 6c 61 67 29 0a 72 65 | 67 69 73 74 65 72 20 53 |flag).re|gister S|
|000043b0| 63 72 65 65 6e 20 2a 73 | 63 72 65 65 6e 3b 0a 72 |creen *s|creen;.r|
|000043c0| 65 67 69 73 74 65 72 20 | 69 6e 74 20 66 6c 61 67 |egister |int flag|
|000043d0| 3b 0a 7b 0a 09 69 66 28 | 73 63 72 65 65 6e 2d 3e |;.{..if(|screen->|
|000043e0| 54 65 6b 45 6d 75 29 20 | 7b 0a 09 09 54 65 6b 53 |TekEmu) |{...TekS|
|000043f0| 65 6c 65 63 74 28 29 3b | 0a 09 09 69 66 28 21 54 |elect();|...if(!T|
|00004400| 74 6f 67 67 6c 65 64 29 | 0a 09 09 09 54 43 75 72 |toggled)|....TCur|
|00004410| 73 6f 72 54 6f 67 67 6c | 65 28 54 4f 47 47 4c 45 |sorToggl|e(TOGGLE|
|00004420| 29 3b 0a 09 09 69 66 28 | 73 63 72 65 65 6e 2d 3e |);...if(|screen->|
|00004430| 63 65 6c 6c 73 75 73 65 | 64 29 20 7b 0a 09 09 09 |cellsuse|d) {....|
|00004440| 73 63 72 65 65 6e 2d 3e | 63 6f 6c 6f 72 63 65 6c |screen->|colorcel|
|00004450| 6c 73 5b 32 5d 2e 70 69 | 78 65 6c 20 3d 0a 09 09 |ls[2].pi|xel =...|
|00004460| 09 20 73 63 72 65 65 6e | 2d 3e 54 63 75 72 73 6f |. screen|->Tcurso|
|00004470| 72 63 6f 6c 6f 72 3b 0a | 09 09 09 58 53 74 6f 72 |rcolor;.|...XStor|
|00004480| 65 43 6f 6c 6f 72 28 26 | 73 63 72 65 65 6e 2d 3e |eColor(&|screen->|
|00004490| 63 6f 6c 6f 72 63 65 6c | 6c 73 5b 32 5d 29 3b 0a |colorcel|ls[2]);.|
|000044a0| 09 09 7d 0a 09 09 73 63 | 72 65 65 6e 2d 3e 73 65 |..}...sc|reen->se|
|000044b0| 6c 65 63 74 20 7c 3d 20 | 66 6c 61 67 3b 0a 09 09 |lect |= |flag;...|
|000044c0| 69 66 28 21 54 74 6f 67 | 67 6c 65 64 29 0a 09 09 |if(!Ttog|gled)...|
|000044d0| 09 54 43 75 72 73 6f 72 | 54 6f 67 67 6c 65 28 54 |.TCursor|Toggle(T|
|000044e0| 4f 47 47 4c 45 29 3b 0a | 09 09 72 65 74 75 72 6e |OGGLE);.|..return|
|000044f0| 3b 0a 09 7d 20 65 6c 73 | 65 20 7b 0a 09 09 56 54 |;..} els|e {...VT|
|00004500| 53 65 6c 65 63 74 28 29 | 3b 0a 09 09 69 66 28 73 |Select()|;...if(s|
|00004510| 63 72 65 65 6e 2d 3e 63 | 75 72 73 6f 72 5f 73 74 |creen->c|ursor_st|
|00004520| 61 74 65 20 26 26 0a 09 | 09 20 20 20 28 73 63 72 |ate &&..|. (scr|
|00004530| 65 65 6e 2d 3e 63 75 72 | 73 6f 72 5f 63 6f 6c 20 |een->cur|sor_col |
|00004540| 21 3d 20 73 63 72 65 65 | 6e 2d 3e 63 75 72 5f 63 |!= scree|n->cur_c|
|00004550| 6f 6c 20 7c 7c 0a 09 09 | 20 20 20 20 73 63 72 65 |ol ||...| scre|
|00004560| 65 6e 2d 3e 63 75 72 73 | 6f 72 5f 72 6f 77 20 21 |en->curs|or_row !|
|00004570| 3d 20 73 63 72 65 65 6e | 2d 3e 63 75 72 5f 72 6f |= screen|->cur_ro|
|00004580| 77 29 29 0a 09 09 20 20 | 20 20 48 69 64 65 43 75 |w))... | HideCu|
|00004590| 72 73 6f 72 28 29 3b 0a | 09 09 73 63 72 65 65 6e |rsor();.|..screen|
|000045a0| 2d 3e 73 65 6c 65 63 74 | 20 7c 3d 20 66 6c 61 67 |->select| |= flag|
|000045b0| 3b 0a 09 09 69 66 28 73 | 63 72 65 65 6e 2d 3e 63 |;...if(s|creen->c|
|000045c0| 75 72 73 6f 72 5f 73 74 | 61 74 65 29 0a 09 09 09 |ursor_st|ate)....|
|000045d0| 53 68 6f 77 43 75 72 73 | 6f 72 28 29 3b 0a 09 09 |ShowCurs|or();...|
|000045e0| 72 65 74 75 72 6e 3b 0a | 09 7d 0a 7d 0a 0a 75 6e |return;.|.}.}..un|
|000045f0| 73 65 6c 65 63 74 77 69 | 6e 64 6f 77 28 73 63 72 |selectwi|ndow(scr|
|00004600| 65 65 6e 2c 20 66 6c 61 | 67 29 0a 72 65 67 69 73 |een, fla|g).regis|
|00004610| 74 65 72 20 53 63 72 65 | 65 6e 20 2a 73 63 72 65 |ter Scre|en *scre|
|00004620| 65 6e 3b 0a 72 65 67 69 | 73 74 65 72 20 69 6e 74 |en;.regi|ster int|
|00004630| 20 66 6c 61 67 3b 0a 7b | 0a 09 72 65 67 69 73 74 | flag;.{|..regist|
|00004640| 65 72 20 69 6e 74 20 69 | 3b 0a 0a 09 73 63 72 65 |er int i|;...scre|
|00004650| 65 6e 2d 3e 73 65 6c 65 | 63 74 20 26 3d 20 7e 66 |en->sele|ct &= ~f|
|00004660| 6c 61 67 3b 0a 09 69 66 | 28 21 73 63 72 65 65 6e |lag;..if|(!screen|
|00004670| 2d 3e 73 65 6c 65 63 74 | 29 20 7b 0a 09 09 69 66 |->select|) {...if|
|00004680| 28 73 63 72 65 65 6e 2d | 3e 54 65 6b 45 6d 75 29 |(screen-|>TekEmu)|
|00004690| 20 7b 0a 09 09 09 54 65 | 6b 55 6e 73 65 6c 65 63 | {....Te|kUnselec|
|000046a0| 74 28 29 3b 0a 09 09 09 | 69 66 28 21 54 74 6f 67 |t();....|if(!Ttog|
|000046b0| 67 6c 65 64 29 0a 09 09 | 09 09 54 43 75 72 73 6f |gled)...|..TCurso|
|000046c0| 72 54 6f 67 67 6c 65 28 | 54 4f 47 47 4c 45 29 3b |rToggle(|TOGGLE);|
|000046d0| 0a 09 09 09 69 66 28 73 | 63 72 65 65 6e 2d 3e 63 |....if(s|creen->c|
|000046e0| 65 6c 6c 73 75 73 65 64 | 29 20 7b 0a 09 09 09 09 |ellsused|) {.....|
|000046f0| 69 20 3d 20 28 74 65 72 | 6d 2e 66 6c 61 67 73 20 |i = (ter|m.flags |
|00004700| 26 20 52 45 56 45 52 53 | 45 5f 56 49 44 45 4f 29 |& REVERS|E_VIDEO)|
|00004710| 20 3d 3d 20 30 3b 0a 09 | 09 09 09 73 63 72 65 65 | == 0;..|...scree|
|00004720| 6e 2d 3e 63 6f 6c 6f 72 | 63 65 6c 6c 73 5b 69 5d |n->color|cells[i]|
|00004730| 2e 70 69 78 65 6c 20 3d | 0a 09 09 09 09 20 73 63 |.pixel =|..... sc|
|00004740| 72 65 65 6e 2d 3e 54 63 | 75 72 73 6f 72 63 6f 6c |reen->Tc|ursorcol|
|00004750| 6f 72 3b 0a 09 09 09 09 | 58 53 74 6f 72 65 43 6f |or;.....|XStoreCo|
|00004760| 6c 6f 72 28 0a 09 09 09 | 09 20 26 73 63 72 65 65 |lor(....|. &scree|
|00004770| 6e 2d 3e 63 6f 6c 6f 72 | 63 65 6c 6c 73 5b 69 5d |n->color|cells[i]|
|00004780| 29 3b 0a 09 09 09 7d 0a | 09 09 09 69 66 28 21 54 |);....}.|...if(!T|
|00004790| 74 6f 67 67 6c 65 64 29 | 0a 09 09 09 09 54 43 75 |toggled)|.....TCu|
|000047a0| 72 73 6f 72 54 6f 67 67 | 6c 65 28 54 4f 47 47 4c |rsorTogg|le(TOGGL|
|000047b0| 45 29 3b 0a 09 09 09 72 | 65 74 75 72 6e 3b 0a 09 |E);....r|eturn;..|
|000047c0| 09 7d 20 65 6c 73 65 20 | 7b 0a 09 09 09 56 54 55 |.} else |{....VTU|
|000047d0| 6e 73 65 6c 65 63 74 28 | 29 3b 0a 09 09 09 69 66 |nselect(|);....if|
|000047e0| 28 73 63 72 65 65 6e 2d | 3e 63 75 72 73 6f 72 5f |(screen-|>cursor_|
|000047f0| 73 74 61 74 65 20 26 26 | 0a 09 09 09 20 28 73 63 |state &&|.... (sc|
|00004800| 72 65 65 6e 2d 3e 63 75 | 72 73 6f 72 5f 63 6f 6c |reen->cu|rsor_col|
|00004810| 20 21 3d 20 73 63 72 65 | 65 6e 2d 3e 63 75 72 5f | != scre|en->cur_|
|00004820| 63 6f 6c 20 7c 7c 0a 09 | 09 09 20 73 63 72 65 65 |col ||..|.. scree|
|00004830| 6e 2d 3e 63 75 72 73 6f | 72 5f 72 6f 77 20 21 3d |n->curso|r_row !=|
|00004840| 20 73 63 72 65 65 6e 2d | 3e 63 75 72 5f 72 6f 77 | screen-|>cur_row|
|00004850| 29 29 0a 09 09 09 09 48 | 69 64 65 43 75 72 73 6f |)).....H|ideCurso|
|00004860| 72 28 29 3b 0a 09 09 09 | 69 66 28 73 63 72 65 65 |r();....|if(scree|
|00004870| 6e 2d 3e 63 75 72 73 6f | 72 5f 73 74 61 74 65 29 |n->curso|r_state)|
|00004880| 0a 09 09 09 09 53 68 6f | 77 43 75 72 73 6f 72 28 |.....Sho|wCursor(|
|00004890| 29 3b 0a 09 09 09 72 65 | 74 75 72 6e 3b 0a 09 09 |);....re|turn;...|
|000048a0| 7d 0a 09 7d 0a 7d 0a 0a | 72 65 73 65 6c 65 63 74 |}..}.}..|reselect|
|000048b0| 77 69 6e 64 6f 77 28 73 | 63 72 65 65 6e 29 0a 72 |window(s|creen).r|
|000048c0| 65 67 69 73 74 65 72 20 | 53 63 72 65 65 6e 20 2a |egister |Screen *|
|000048d0| 73 63 72 65 65 6e 3b 0a | 7b 0a 09 57 69 6e 64 6f |screen;.|{..Windo|
|000048e0| 77 20 77 69 6e 3b 0a 09 | 69 6e 74 20 78 2c 20 79 |w win;..|int x, y|
|000048f0| 3b 0a 0a 09 69 66 28 58 | 51 75 65 72 79 4d 6f 75 |;...if(X|QueryMou|
|00004900| 73 65 28 52 6f 6f 74 57 | 69 6e 64 6f 77 2c 20 26 |se(RootW|indow, &|
|00004910| 78 2c 20 26 79 2c 20 26 | 77 69 6e 29 29 20 7b 0a |x, &y, &|win)) {.|
|00004920| 09 09 69 66 28 77 69 6e | 20 26 26 20 28 77 69 6e |..if(win| && (win|
|00004930| 20 3d 3d 20 56 57 69 6e | 64 6f 77 28 73 63 72 65 | == VWin|dow(scre|
|00004940| 65 6e 29 20 7c 7c 20 77 | 69 6e 20 3d 3d 20 54 57 |en) || w|in == TW|
|00004950| 69 6e 64 6f 77 28 73 63 | 72 65 65 6e 29 29 0a 09 |indow(sc|reen))..|
|00004960| 09 20 20 20 20 20 20 20 | 26 26 20 28 21 73 63 72 |. |&& (!scr|
|00004970| 65 65 6e 2d 3e 69 63 6f | 6e 5f 73 68 6f 77 0a 09 |een->ico|n_show..|
|00004980| 09 09 20 20 20 7c 7c 20 | 28 73 63 72 65 65 6e 2d |.. || |(screen-|
|00004990| 3e 61 63 74 69 76 65 5f | 69 63 6f 6e 20 26 26 20 |>active_|icon && |
|000049a0| 74 65 72 6d 2e 66 6c 61 | 67 73 20 26 20 49 43 4f |term.fla|gs & ICO|
|000049b0| 4e 49 4e 50 55 54 29 29 | 29 0a 09 09 09 73 65 6c |NINPUT))|)....sel|
|000049c0| 65 63 74 77 69 6e 64 6f | 77 28 73 63 72 65 65 6e |ectwindo|w(screen|
|000049d0| 2c 20 49 4e 57 49 4e 44 | 4f 57 29 3b 0a 09 09 65 |, INWIND|OW);...e|
|000049e0| 6c 73 65 09 75 6e 73 65 | 6c 65 63 74 77 69 6e 64 |lse.unse|lectwind|
|000049f0| 6f 77 28 73 63 72 65 65 | 6e 2c 20 49 4e 57 49 4e |ow(scree|n, INWIN|
|00004a00| 44 4f 57 29 3b 0a 09 7d | 0a 7d 0a 0a 44 65 69 63 |DOW);..}|.}..Deic|
|00004a10| 6f 6e 57 61 72 70 28 73 | 63 72 65 65 6e 29 0a 72 |onWarp(s|creen).r|
|00004a20| 65 67 69 73 74 65 72 20 | 53 63 72 65 65 6e 20 2a |egister |Screen *|
|00004a30| 73 63 72 65 65 6e 3b 0a | 7b 0a 09 69 66 28 73 63 |screen;.|{..if(sc|
|00004a40| 72 65 65 6e 2d 3e 54 65 | 6b 45 6d 75 29 0a 09 09 |reen->Te|kEmu)...|
|00004a50| 58 57 61 72 70 4d 6f 75 | 73 65 28 54 57 69 6e 64 |XWarpMou|se(TWind|
|00004a60| 6f 77 28 73 63 72 65 65 | 6e 29 2c 20 54 46 75 6c |ow(scree|n), TFul|
|00004a70| 6c 57 69 64 74 68 28 73 | 63 72 65 65 6e 29 20 2f |lWidth(s|creen) /|
|00004a80| 20 32 2c 0a 09 09 20 54 | 46 75 6c 6c 48 65 69 67 | 2,... T|FullHeig|
|00004a90| 68 74 28 73 63 72 65 65 | 6e 29 20 2f 20 32 29 3b |ht(scree|n) / 2);|
|00004aa0| 0a 09 65 6c 73 65 0a 09 | 09 58 57 61 72 70 4d 6f |..else..|.XWarpMo|
|00004ab0| 75 73 65 28 56 57 69 6e | 64 6f 77 28 73 63 72 65 |use(VWin|dow(scre|
|00004ac0| 65 6e 29 2c 20 46 75 6c | 6c 57 69 64 74 68 28 73 |en), Ful|lWidth(s|
|00004ad0| 63 72 65 65 6e 29 20 2f | 20 32 2c 0a 09 09 20 46 |creen) /| 2,... F|
|00004ae0| 75 6c 6c 48 65 69 67 68 | 74 28 73 63 72 65 65 6e |ullHeigh|t(screen|
|00004af0| 29 20 2f 20 32 29 3b 0a | 7d 0a 0a 23 64 65 66 69 |) / 2);.|}..#defi|
|00004b00| 6e 65 09 45 4e 54 45 52 | 4c 45 41 56 45 09 35 30 |ne.ENTER|LEAVE.50|
|00004b10| 30 30 30 30 4c 0a 0a 44 | 6f 45 6e 74 65 72 4c 65 |0000L..D|oEnterLe|
|00004b20| 61 76 65 28 73 63 72 65 | 65 6e 2c 20 74 79 70 65 |ave(scre|en, type|
|00004b30| 29 0a 72 65 67 69 73 74 | 65 72 20 53 63 72 65 65 |).regist|er Scree|
|00004b40| 6e 20 2a 73 63 72 65 65 | 6e 3b 0a 69 6e 74 20 74 |n *scree|n;.int t|
|00004b50| 79 70 65 3b 0a 7b 0a 09 | 69 66 20 28 21 73 63 72 |ype;.{..|if (!scr|
|00004b60| 65 65 6e 2d 3e 61 75 74 | 6f 72 61 69 73 65 20 26 |een->aut|oraise &|
|00004b70| 26 20 21 73 63 72 65 65 | 6e 2d 3e 68 6f 6c 64 6f |& !scree|n->holdo|
|00004b80| 66 66 29 20 7b 0a 09 20 | 20 20 20 69 66 20 28 74 |ff) {.. | if (t|
|00004b90| 79 70 65 20 3d 3d 20 45 | 6e 74 65 72 57 69 6e 64 |ype == E|nterWind|
|00004ba0| 6f 77 29 0a 09 09 20 20 | 20 20 73 65 6c 65 63 74 |ow)... | select|
|00004bb0| 77 69 6e 64 6f 77 28 20 | 73 63 72 65 65 6e 2c 20 |window( |screen, |
|00004bc0| 49 4e 57 49 4e 44 4f 57 | 20 29 3b 0a 09 20 20 20 |INWINDOW| );.. |
|00004bd0| 20 65 6c 73 65 20 20 20 | 20 75 6e 73 65 6c 65 63 | else | unselec|
|00004be0| 74 77 69 6e 64 6f 77 28 | 20 73 63 72 65 65 6e 2c |twindow(| screen,|
|00004bf0| 20 49 4e 57 49 4e 44 4f | 57 20 29 3b 0a 09 20 20 | INWINDO|W );.. |
|00004c00| 20 20 72 65 74 75 72 6e | 3b 0a 09 7d 0a 0a 09 73 | return|;..}...s|
|00004c10| 63 72 65 65 6e 2d 3e 74 | 69 6d 65 72 20 3d 20 74 |creen->t|imer = t|
|00004c20| 79 70 65 3b 0a 09 69 66 | 28 21 73 63 72 65 65 6e |ype;..if|(!screen|
|00004c30| 2d 3e 68 6f 6c 64 6f 66 | 66 29 0a 09 09 54 69 6d |->holdof|f)...Tim|
|00004c40| 65 72 28 45 4e 54 45 52 | 4c 45 41 56 45 29 3b 0a |er(ENTER|LEAVE);.|
|00004c50| 7d 0a 0a 54 69 6d 65 72 | 28 76 61 6c 29 0a 6c 6f |}..Timer|(val).lo|
|00004c60| 6e 67 20 76 61 6c 3b 0a | 7b 0a 09 73 74 72 75 63 |ng val;.|{..struc|
|00004c70| 74 20 69 74 69 6d 65 72 | 76 61 6c 20 69 74 3b 0a |t itimer|val it;.|
|00004c80| 0a 09 62 7a 65 72 6f 28 | 26 69 74 2c 20 73 69 7a |..bzero(|&it, siz|
|00004c90| 65 6f 66 28 69 74 29 29 | 3b 0a 09 69 74 2e 69 74 |eof(it))|;..it.it|
|00004ca0| 5f 76 61 6c 75 65 2e 74 | 76 5f 75 73 65 63 20 3d |_value.t|v_usec =|
|00004cb0| 20 76 61 6c 3b 0a 09 73 | 65 74 69 74 69 6d 65 72 | val;..s|etitimer|
|00004cc0| 28 49 54 49 4d 45 52 5f | 52 45 41 4c 2c 20 26 69 |(ITIMER_|REAL, &i|
|00004cd0| 74 2c 20 28 73 74 72 75 | 63 74 20 69 74 69 6d 65 |t, (stru|ct itime|
|00004ce0| 72 76 61 6c 20 2a 29 30 | 29 3b 0a 7d 0a 0a 6f 6e |rval *)0|);.}..on|
|00004cf0| 61 6c 61 72 6d 28 29 0a | 7b 0a 09 72 65 67 69 73 |alarm().|{..regis|
|00004d00| 74 65 72 20 53 63 72 65 | 65 6e 20 2a 73 63 72 65 |ter Scre|en *scre|
|00004d10| 65 6e 20 3d 20 26 74 65 | 72 6d 2e 73 63 72 65 65 |en = &te|rm.scree|
|00004d20| 6e 3b 0a 0a 09 69 66 28 | 73 63 72 65 65 6e 2d 3e |n;...if(|screen->|
|00004d30| 74 69 6d 65 72 20 3d 3d | 20 30 20 7c 7c 20 73 63 |timer ==| 0 || sc|
|00004d40| 72 65 65 6e 2d 3e 68 6f | 6c 64 6f 66 66 29 20 7b |reen->ho|ldoff) {|
|00004d50| 09 2f 2a 20 65 78 74 72 | 61 6e 65 6f 75 73 20 61 |./* extr|aneous a|
|00004d60| 6c 61 72 6d 20 2a 2f 0a | 09 09 54 69 6d 65 72 28 |larm */.|..Timer(|
|00004d70| 30 4c 29 3b 0a 09 09 72 | 65 74 75 72 6e 3b 0a 09 |0L);...r|eturn;..|
|00004d80| 7d 0a 09 69 66 28 73 63 | 72 65 65 6e 2d 3e 74 69 |}..if(sc|reen->ti|
|00004d90| 6d 65 72 20 3d 3d 20 45 | 6e 74 65 72 57 69 6e 64 |mer == E|nterWind|
|00004da0| 6f 77 29 20 7b 0a 23 69 | 66 64 65 66 20 44 45 42 |ow) {.#i|fdef DEB|
|00004db0| 55 47 0a 09 09 69 66 28 | 64 65 62 75 67 29 0a 09 |UG...if(|debug)..|
|00004dc0| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00004dd0| 2c 20 22 6f 6e 61 6c 61 | 72 6d 3a 20 45 6e 74 65 |, "onala|rm: Ente|
|00004de0| 72 57 69 6e 64 6f 77 20 | 25 73 5c 6e 22 2c 0a 09 |rWindow |%s\n",..|
|00004df0| 09 09 20 73 63 72 65 65 | 6e 2d 3e 61 75 74 6f 72 |.. scree|n->autor|
|00004e00| 61 69 73 65 20 3f 20 28 | 73 63 72 65 65 6e 2d 3e |aise ? (|screen->|
|00004e10| 61 75 74 6f 77 69 6e 64 | 6f 77 20 3d 3d 0a 09 09 |autowind|ow ==...|
|00004e20| 09 20 56 57 69 6e 64 6f | 77 28 73 63 72 65 65 6e |. VWindo|w(screen|
|00004e30| 29 20 3f 20 22 56 54 22 | 20 3a 20 22 54 65 6b 22 |) ? "VT"| : "Tek"|
|00004e40| 29 20 3a 20 22 22 29 3b | 0a 23 65 6e 64 69 66 20 |) : "");|.#endif |
|00004e50| 44 45 42 55 47 0a 09 09 | 73 65 6c 65 63 74 77 69 |DEBUG...|selectwi|
|00004e60| 6e 64 6f 77 28 73 63 72 | 65 65 6e 2c 20 49 4e 57 |ndow(scr|een, INW|
|00004e70| 49 4e 44 4f 57 29 3b 0a | 09 09 69 66 28 73 63 72 |INDOW);.|..if(scr|
|00004e80| 65 65 6e 2d 3e 61 75 74 | 6f 72 61 69 73 65 29 0a |een->aut|oraise).|
|00004e90| 09 09 09 58 52 61 69 73 | 65 57 69 6e 64 6f 77 28 |...XRais|eWindow(|
|00004ea0| 73 63 72 65 65 6e 2d 3e | 61 75 74 6f 77 69 6e 64 |screen->|autowind|
|00004eb0| 6f 77 29 3b 0a 09 7d 20 | 65 6c 73 65 09 2f 2a 20 |ow);..} |else./* |
|00004ec0| 4c 65 61 76 65 57 69 6e | 64 6f 77 20 2a 2f 0a 23 |LeaveWin|dow */.#|
|00004ed0| 69 66 64 65 66 20 44 45 | 42 55 47 0a 09 7b 0a 09 |ifdef DE|BUG..{..|
|00004ee0| 09 69 66 28 64 65 62 75 | 67 29 0a 09 09 09 66 70 |.if(debu|g)....fp|
|00004ef0| 75 74 73 28 22 6f 6e 61 | 6c 61 72 6d 3a 20 4c 65 |uts("ona|larm: Le|
|00004f00| 61 76 65 57 69 6e 64 6f | 77 5c 6e 22 2c 20 73 74 |aveWindo|w\n", st|
|00004f10| 64 65 72 72 29 3b 0a 23 | 65 6e 64 69 66 20 44 45 |derr);.#|endif DE|
|00004f20| 42 55 47 0a 09 09 75 6e | 73 65 6c 65 63 74 77 69 |BUG...un|selectwi|
|00004f30| 6e 64 6f 77 28 73 63 72 | 65 65 6e 2c 20 49 4e 57 |ndow(scr|een, INW|
|00004f40| 49 4e 44 4f 57 29 3b 0a | 23 69 66 64 65 66 20 44 |INDOW);.|#ifdef D|
|00004f50| 45 42 55 47 0a 09 7d 0a | 23 65 6e 64 69 66 20 44 |EBUG..}.|#endif D|
|00004f60| 45 42 55 47 0a 09 73 63 | 72 65 65 6e 2d 3e 74 69 |EBUG..sc|reen->ti|
|00004f70| 6d 65 72 20 3d 20 30 3b | 0a 7d 0a 0a 50 69 78 6d |mer = 0;|.}..Pixm|
|00004f80| 61 70 20 6d 61 6b 65 5f | 68 69 6c 69 74 65 28 66 |ap make_|hilite(f|
|00004f90| 67 2c 20 62 67 29 0a 69 | 6e 74 20 66 67 2c 20 62 |g, bg).i|nt fg, b|
|00004fa0| 67 3b 0a 7b 0a 09 65 78 | 74 65 72 6e 20 50 69 78 |g;.{..ex|tern Pix|
|00004fb0| 6d 61 70 20 4d 61 6b 65 | 5f 74 69 6c 65 28 29 3b |map Make|_tile();|
|00004fc0| 0a 0a 09 72 65 74 75 72 | 6e 28 4d 61 6b 65 5f 74 |...retur|n(Make_t|
|00004fd0| 69 6c 65 28 68 69 6c 69 | 74 65 5f 77 69 64 74 68 |ile(hili|te_width|
|00004fe0| 2c 20 68 69 6c 69 74 65 | 5f 68 65 69 67 68 74 2c |, hilite|_height,|
|00004ff0| 20 68 69 6c 69 74 65 5f | 62 69 74 73 2c 20 66 67 | hilite_|bits, fg|
|00005000| 2c 0a 09 20 62 67 29 29 | 3b 0a 7d 0a 0a 50 69 78 |,.. bg))|;.}..Pix|
|00005010| 6d 61 70 20 6d 61 6b 65 | 5f 67 72 61 79 28 29 0a |map make|_gray().|
|00005020| 7b 0a 09 65 78 74 65 72 | 6e 20 50 69 78 6d 61 70 |{..exter|n Pixmap|
|00005030| 20 4d 61 6b 65 5f 74 69 | 6c 65 28 29 3b 0a 0a 09 | Make_ti|le();...|
|00005040| 72 65 74 75 72 6e 28 4d | 61 6b 65 5f 74 69 6c 65 |return(M|ake_tile|
|00005050| 28 67 72 61 79 5f 77 69 | 64 74 68 2c 20 67 72 61 |(gray_wi|dth, gra|
|00005060| 79 5f 68 65 69 67 68 74 | 2c 20 67 72 61 79 5f 62 |y_height|, gray_b|
|00005070| 69 74 73 2c 20 42 6c 61 | 63 6b 50 69 78 65 6c 2c |its, Bla|ckPixel,|
|00005080| 0a 09 20 57 68 69 74 65 | 50 69 78 65 6c 29 29 3b |.. White|Pixel));|
|00005090| 0a 7d 0a 0a 43 75 72 73 | 6f 72 20 6d 61 6b 65 5f |.}..Curs|or make_|
|000050a0| 74 63 72 6f 73 73 28 66 | 67 2c 20 62 67 2c 20 66 |tcross(f|g, bg, f|
|000050b0| 75 6e 63 29 0a 69 6e 74 | 20 66 67 2c 20 62 67 2c |unc).int| fg, bg,|
|000050c0| 20 66 75 6e 63 3b 0a 7b | 0a 09 72 65 74 75 72 6e | func;.{|..return|
|000050d0| 28 58 43 72 65 61 74 65 | 43 75 72 73 6f 72 28 74 |(XCreate|Cursor(t|
|000050e0| 63 72 6f 73 73 5f 77 69 | 64 74 68 2c 20 74 63 72 |cross_wi|dth, tcr|
|000050f0| 6f 73 73 5f 68 65 69 67 | 68 74 2c 20 74 63 72 6f |oss_heig|ht, tcro|
|00005100| 73 73 5f 62 69 74 73 2c | 0a 09 20 74 63 72 6f 73 |ss_bits,|.. tcros|
|00005110| 73 5f 6d 61 73 6b 5f 62 | 69 74 73 2c 20 74 63 72 |s_mask_b|its, tcr|
|00005120| 6f 73 73 5f 78 5f 68 6f | 74 2c 20 74 63 72 6f 73 |oss_x_ho|t, tcros|
|00005130| 73 5f 79 5f 68 6f 74 2c | 20 66 67 2c 20 62 67 2c |s_y_hot,| fg, bg,|
|00005140| 20 66 75 6e 63 29 29 3b | 0a 7d 0a 0a 43 75 72 73 | func));|.}..Curs|
|00005150| 6f 72 20 6d 61 6b 65 5f | 78 74 65 72 6d 28 66 67 |or make_|xterm(fg|
|00005160| 2c 20 62 67 2c 20 66 75 | 6e 63 29 0a 69 6e 74 20 |, bg, fu|nc).int |
|00005170| 66 67 2c 20 62 67 2c 20 | 66 75 6e 63 3b 0a 7b 0a |fg, bg, |func;.{.|
|00005180| 09 72 65 74 75 72 6e 28 | 58 43 72 65 61 74 65 43 |.return(|XCreateC|
|00005190| 75 72 73 6f 72 28 78 74 | 65 72 6d 5f 77 69 64 74 |ursor(xt|erm_widt|
|000051a0| 68 2c 20 78 74 65 72 6d | 5f 68 65 69 67 68 74 2c |h, xterm|_height,|
|000051b0| 20 78 74 65 72 6d 5f 62 | 69 74 73 2c 0a 09 20 78 | xterm_b|its,.. x|
|000051c0| 74 65 72 6d 5f 6d 61 73 | 6b 5f 62 69 74 73 2c 20 |term_mas|k_bits, |
|000051d0| 78 74 65 72 6d 5f 78 5f | 68 6f 74 2c 20 78 74 65 |xterm_x_|hot, xte|
|000051e0| 72 6d 5f 79 5f 68 6f 74 | 2c 20 66 67 2c 20 62 67 |rm_y_hot|, fg, bg|
|000051f0| 2c 20 66 75 6e 63 29 29 | 3b 0a 7d 0a 0a 43 75 72 |, func))|;.}..Cur|
|00005200| 73 6f 72 20 6d 61 6b 65 | 5f 77 61 69 74 28 66 67 |sor make|_wait(fg|
|00005210| 2c 20 62 67 2c 20 66 75 | 6e 63 29 0a 69 6e 74 20 |, bg, fu|nc).int |
|00005220| 66 67 2c 20 62 67 2c 20 | 66 75 6e 63 3b 0a 7b 0a |fg, bg, |func;.{.|
|00005230| 09 72 65 74 75 72 6e 28 | 58 43 72 65 61 74 65 43 |.return(|XCreateC|
|00005240| 75 72 73 6f 72 28 77 61 | 69 74 5f 77 69 64 74 68 |ursor(wa|it_width|
|00005250| 2c 20 77 61 69 74 5f 68 | 65 69 67 68 74 2c 20 77 |, wait_h|eight, w|
|00005260| 61 69 74 5f 62 69 74 73 | 2c 20 77 61 69 74 6d 61 |ait_bits|, waitma|
|00005270| 73 6b 5f 62 69 74 73 2c | 0a 09 20 77 61 69 74 5f |sk_bits,|.. wait_|
|00005280| 78 5f 68 6f 74 2c 20 77 | 61 69 74 5f 79 5f 68 6f |x_hot, w|ait_y_ho|
|00005290| 74 2c 20 66 67 2c 20 62 | 67 2c 20 66 75 6e 63 29 |t, fg, b|g, func)|
|000052a0| 29 3b 0a 7d 0a 0a 43 75 | 72 73 6f 72 20 6d 61 6b |);.}..Cu|rsor mak|
|000052b0| 65 5f 61 72 72 6f 77 28 | 66 67 2c 20 62 67 2c 20 |e_arrow(|fg, bg, |
|000052c0| 66 75 6e 63 29 0a 69 6e | 74 20 66 67 2c 20 62 67 |func).in|t fg, bg|
|000052d0| 2c 20 66 75 6e 63 3b 0a | 7b 0a 09 72 65 74 75 72 |, func;.|{..retur|
|000052e0| 6e 28 58 43 72 65 61 74 | 65 43 75 72 73 6f 72 28 |n(XCreat|eCursor(|
|000052f0| 6c 65 66 74 5f 70 74 72 | 5f 77 69 64 74 68 2c 20 |left_ptr|_width, |
|00005300| 6c 65 66 74 5f 70 74 72 | 5f 68 65 69 67 68 74 2c |left_ptr|_height,|
|00005310| 20 6c 65 66 74 5f 70 74 | 72 5f 62 69 74 73 2c 0a | left_pt|r_bits,.|
|00005320| 09 20 6c 65 66 74 5f 70 | 74 72 5f 6d 61 73 6b 5f |. left_p|tr_mask_|
|00005330| 62 69 74 73 2c 20 6c 65 | 66 74 5f 70 74 72 5f 78 |bits, le|ft_ptr_x|
|00005340| 5f 68 6f 74 2c 20 6c 65 | 66 74 5f 70 74 72 5f 79 |_hot, le|ft_ptr_y|
|00005350| 5f 68 6f 74 2c 20 66 67 | 2c 20 62 67 2c 20 66 75 |_hot, fg|, bg, fu|
|00005360| 6e 63 29 29 3b 0a 7d 0a | 0a 63 68 61 72 20 2a 75 |nc));.}.|.char *u|
|00005370| 6e 69 71 75 65 73 75 66 | 66 69 78 28 6e 61 6d 65 |niquesuf|fix(name|
|00005380| 29 0a 63 68 61 72 20 2a | 6e 61 6d 65 3b 0a 7b 0a |).char *|name;.{.|
|00005390| 09 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 2a 6e |.registe|r int *n|
|000053a0| 70 2c 20 2a 66 70 2c 20 | 69 3b 0a 09 72 65 67 69 |p, *fp, |i;..regi|
|000053b0| 73 74 65 72 20 57 69 6e | 64 6f 77 20 2a 63 70 3b |ster Win|dow *cp;|
|000053c0| 0a 09 72 65 67 69 73 74 | 65 72 20 69 6e 74 20 74 |..regist|er int t|
|000053d0| 65 6d 70 2c 20 6a 2c 20 | 6b 2c 20 65 78 61 63 74 |emp, j, |k, exact|
|000053e0| 2c 20 2a 6e 75 6d 62 65 | 72 3b 0a 09 63 68 61 72 |, *numbe|r;..char|
|000053f0| 20 2a 77 6e 61 6d 65 3b | 0a 09 57 69 6e 64 6f 77 | *wname;|..Window|
|00005400| 20 2a 63 68 69 6c 64 72 | 65 6e 2c 20 70 61 72 65 | *childr|en, pare|
|00005410| 6e 74 3b 0a 09 69 6e 74 | 20 6e 63 68 69 6c 64 72 |nt;..int| nchildr|
|00005420| 65 6e 3b 0a 09 73 74 61 | 74 69 63 20 63 68 61 72 |en;..sta|tic char|
|00005430| 20 2a 73 75 66 66 69 78 | 2c 20 73 75 66 62 75 66 | *suffix|, sufbuf|
|00005440| 5b 31 30 5d 3b 0a 09 63 | 68 61 72 20 2a 6d 61 6c |[10];..c|har *mal|
|00005450| 6c 6f 63 28 29 3b 0a 0a | 09 69 66 28 73 75 66 66 |loc();..|.if(suff|
|00005460| 69 78 29 0a 09 09 72 65 | 74 75 72 6e 28 73 75 66 |ix)...re|turn(suf|
|00005470| 66 69 78 29 3b 0a 09 73 | 75 66 66 69 78 20 3d 20 |fix);..s|uffix = |
|00005480| 73 75 66 62 75 66 3b 0a | 09 69 66 28 21 58 51 75 |sufbuf;.|.if(!XQu|
|00005490| 65 72 79 54 72 65 65 28 | 52 6f 6f 74 57 69 6e 64 |eryTree(|RootWind|
|000054a0| 6f 77 2c 20 26 70 61 72 | 65 6e 74 2c 20 26 6e 63 |ow, &par|ent, &nc|
|000054b0| 68 69 6c 64 72 65 6e 2c | 20 26 63 68 69 6c 64 72 |hildren,| &childr|
|000054c0| 65 6e 29 20 7c 7c 0a 09 | 20 6e 63 68 69 6c 64 72 |en) ||..| nchildr|
|000054d0| 65 6e 20 3c 20 31 20 7c | 7c 20 28 6e 75 6d 62 65 |en < 1 ||| (numbe|
|000054e0| 72 20 3d 20 28 69 6e 74 | 20 2a 29 6d 61 6c 6c 6f |r = (int| *)mallo|
|000054f0| 63 28 6e 63 68 69 6c 64 | 72 65 6e 20 2a 20 73 69 |c(nchild|ren * si|
|00005500| 7a 65 6f 66 28 69 6e 74 | 29 29 29 0a 09 20 3d 3d |zeof(int|))).. ==|
|00005510| 20 4e 55 4c 4c 29 0a 09 | 09 72 65 74 75 72 6e 28 | NULL)..|.return(|
|00005520| 73 75 66 66 69 78 29 3b | 0a 09 65 78 61 63 74 20 |suffix);|..exact |
|00005530| 3d 20 46 41 4c 53 45 3b | 0a 09 69 20 3d 20 73 74 |= FALSE;|..i = st|
|00005540| 72 6c 65 6e 28 6e 61 6d | 65 29 3b 0a 09 66 6f 72 |rlen(nam|e);..for|
|00005550| 28 6e 70 20 3d 20 6e 75 | 6d 62 65 72 2c 20 63 70 |(np = nu|mber, cp|
|00005560| 20 3d 20 63 68 69 6c 64 | 72 65 6e 2c 20 6a 20 3d | = child|ren, j =|
|00005570| 20 6e 63 68 69 6c 64 72 | 65 6e 20 3b 20 6a 20 3e | nchildr|en ; j >|
|00005580| 20 30 20 3b 20 63 70 2b | 2b 2c 20 6a 2d 2d 29 20 | 0 ; cp+|+, j--) |
|00005590| 7b 0a 09 09 69 66 28 21 | 58 46 65 74 63 68 4e 61 |{...if(!|XFetchNa|
|000055a0| 6d 65 28 2a 63 70 2c 20 | 26 77 6e 61 6d 65 29 20 |me(*cp, |&wname) |
|000055b0| 7c 7c 20 77 6e 61 6d 65 | 20 3d 3d 20 4e 55 4c 4c ||| wname| == NULL|
|000055c0| 29 0a 09 09 09 63 6f 6e | 74 69 6e 75 65 3b 0a 09 |)....con|tinue;..|
|000055d0| 09 69 66 28 73 74 72 6e | 63 6d 70 28 6e 61 6d 65 |.if(strn|cmp(name|
|000055e0| 2c 20 77 6e 61 6d 65 2c | 20 69 29 20 3d 3d 20 30 |, wname,| i) == 0|
|000055f0| 29 20 7b 0a 09 09 09 69 | 66 28 77 6e 61 6d 65 5b |) {....i|f(wname[|
|00005600| 69 5d 20 3d 3d 20 30 20 | 7c 7c 20 73 74 72 63 6d |i] == 0 ||| strcm|
|00005610| 70 28 26 77 6e 61 6d 65 | 5b 69 5d 2c 20 22 20 28 |p(&wname|[i], " (|
|00005620| 54 65 6b 29 22 29 20 3d | 3d 20 30 29 0a 09 09 09 |Tek)") =|= 0)....|
|00005630| 09 65 78 61 63 74 20 3d | 20 54 52 55 45 3b 0a 09 |.exact =| TRUE;..|
|00005640| 09 09 65 6c 73 65 20 69 | 66 28 73 74 72 6e 63 6d |..else i|f(strncm|
|00005650| 70 28 26 77 6e 61 6d 65 | 5b 69 5d 2c 20 22 20 23 |p(&wname|[i], " #|
|00005660| 22 2c 20 32 29 20 3d 3d | 20 30 29 0a 09 09 09 09 |", 2) ==| 0).....|
|00005670| 2a 6e 70 2b 2b 20 3d 20 | 61 74 6f 69 28 26 77 6e |*np++ = |atoi(&wn|
|00005680| 61 6d 65 5b 69 20 2b 20 | 32 5d 29 3b 0a 09 09 7d |ame[i + |2]);...}|
|00005690| 0a 09 09 66 72 65 65 28 | 77 6e 61 6d 65 29 3b 0a |...free(|wname);.|
|000056a0| 09 7d 0a 09 66 72 65 65 | 28 28 63 68 61 72 20 2a |.}..free|((char *|
|000056b0| 29 63 68 69 6c 64 72 65 | 6e 29 3b 0a 09 69 66 28 |)childre|n);..if(|
|000056c0| 65 78 61 63 74 29 20 7b | 0a 09 09 69 66 28 6e 70 |exact) {|...if(np|
|000056d0| 20 3c 3d 20 6e 75 6d 62 | 65 72 29 0a 09 09 09 73 | <= numb|er)....s|
|000056e0| 74 72 63 70 79 28 73 75 | 66 66 69 78 2c 20 22 20 |trcpy(su|ffix, " |
|000056f0| 23 32 22 29 3b 0a 09 09 | 65 6c 73 65 20 7b 0a 09 |#2");...|else {..|
|00005700| 09 09 65 78 61 63 74 20 | 3d 20 6e 70 20 2d 20 6e |..exact |= np - n|
|00005710| 75 6d 62 65 72 3b 0a 09 | 09 09 6e 70 20 3d 20 6e |umber;..|..np = n|
|00005720| 75 6d 62 65 72 3b 0a 09 | 09 09 2f 2a 20 73 68 65 |umber;..|../* she|
|00005730| 6c 6c 20 73 6f 72 74 20 | 2a 2f 0a 09 09 09 66 6f |ll sort |*/....fo|
|00005740| 72 28 69 20 3d 20 65 78 | 61 63 74 20 2f 20 32 20 |r(i = ex|act / 2 |
|00005750| 3b 20 69 20 3e 20 30 20 | 3b 20 69 20 2f 3d 20 32 |; i > 0 |; i /= 2|
|00005760| 29 0a 09 09 09 09 66 6f | 72 28 6b 20 3d 20 69 20 |).....fo|r(k = i |
|00005770| 3b 20 6b 20 3c 20 65 78 | 61 63 74 20 3b 20 6b 2b |; k < ex|act ; k+|
|00005780| 2b 29 0a 09 09 09 09 09 | 66 6f 72 28 6a 20 3d 20 |+)......|for(j = |
|00005790| 6b 20 2d 20 69 20 3b 20 | 6a 20 3e 3d 20 30 20 26 |k - i ; |j >= 0 &|
|000057a0| 26 0a 09 09 09 09 09 20 | 6e 70 5b 6a 5d 20 3e 20 |&...... |np[j] > |
|000057b0| 6e 70 5b 6a 20 2b 20 69 | 5d 20 3b 20 6a 20 2d 3d |np[j + i|] ; j -=|
|000057c0| 20 69 29 20 7b 0a 09 09 | 09 09 09 09 74 65 6d 70 | i) {...|....temp|
|000057d0| 20 3d 20 6e 70 5b 6a 5d | 3b 0a 09 09 09 09 09 09 | = np[j]|;.......|
|000057e0| 6e 70 5b 6a 5d 20 3d 20 | 6e 70 5b 6a 20 2b 20 69 |np[j] = |np[j + i|
|000057f0| 5d 3b 0a 09 09 09 09 09 | 09 6e 70 5b 6a 20 2b 20 |];......|.np[j + |
|00005800| 69 5d 20 3d 20 74 65 6d | 70 3b 0a 09 09 09 09 09 |i] = tem|p;......|
|00005810| 7d 0a 09 09 09 2f 2a 20 | 6d 61 6b 65 20 6e 75 6d |}..../* |make num|
|00005820| 62 65 72 73 20 75 6e 69 | 71 75 65 20 2a 2f 0a 09 |bers uni|que */..|
|00005830| 09 09 66 6f 72 28 66 70 | 20 3d 20 6e 70 20 2b 20 |..for(fp| = np + |
|00005840| 31 2c 20 69 20 3d 20 65 | 78 61 63 74 20 2d 20 31 |1, i = e|xact - 1|
|00005850| 20 3b 20 69 20 3e 20 30 | 20 3b 20 66 70 2b 2b 2c | ; i > 0| ; fp++,|
|00005860| 20 69 2d 2d 29 0a 09 09 | 09 09 69 66 28 2a 66 70 | i--)...|..if(*fp|
|00005870| 20 21 3d 20 2a 6e 70 29 | 0a 09 09 09 09 09 2a 2b | != *np)|......*+|
|00005880| 2b 6e 70 20 3d 20 2a 66 | 70 3b 0a 09 09 09 2f 2a |+np = *f|p;..../*|
|00005890| 20 66 69 6e 64 20 6c 65 | 61 73 74 20 75 6e 69 71 | find le|ast uniq|
|000058a0| 75 65 20 6e 75 6d 62 65 | 72 20 2a 2f 0a 09 09 09 |ue numbe|r */....|
|000058b0| 66 6f 72 28 69 20 3d 20 | 32 2c 20 66 70 20 3d 20 |for(i = |2, fp = |
|000058c0| 6e 75 6d 62 65 72 20 3b | 20 66 70 20 3c 3d 20 6e |number ;| fp <= n|
|000058d0| 70 20 3b 20 66 70 2b 2b | 29 20 7b 0a 09 09 09 09 |p ; fp++|) {.....|
|000058e0| 69 66 28 69 20 3c 20 2a | 66 70 29 0a 09 09 09 09 |if(i < *|fp).....|
|000058f0| 09 62 72 65 61 6b 3b 0a | 09 09 09 09 69 66 28 69 |.break;.|....if(i|
|00005900| 20 3d 3d 20 2a 66 70 29 | 0a 09 09 09 09 09 69 2b | == *fp)|......i+|
|00005910| 2b 3b 0a 09 09 09 7d 0a | 09 09 09 73 70 72 69 6e |+;....}.|...sprin|
|00005920| 74 66 28 73 75 66 66 69 | 78 2c 20 22 20 23 25 64 |tf(suffi|x, " #%d|
|00005930| 22 2c 20 69 29 3b 0a 09 | 09 7d 0a 09 7d 0a 09 66 |", i);..|.}..}..f|
|00005940| 72 65 65 28 28 63 68 61 | 72 20 2a 29 6e 75 6d 62 |ree((cha|r *)numb|
|00005950| 65 72 29 3b 0a 09 72 65 | 74 75 72 6e 28 73 75 66 |er);..re|turn(suf|
|00005960| 66 69 78 29 3b 0a 7d 0a | 0a 42 65 6c 6c 28 29 0a |fix);.}.|.Bell().|
|00005970| 7b 0a 09 65 78 74 65 72 | 6e 20 54 65 72 6d 69 6e |{..exter|n Termin|
|00005980| 61 6c 20 74 65 72 6d 3b | 0a 09 72 65 67 69 73 74 |al term;|..regist|
|00005990| 65 72 20 53 63 72 65 65 | 6e 20 2a 73 63 72 65 65 |er Scree|n *scree|
|000059a0| 6e 20 3d 20 26 74 65 72 | 6d 2e 73 63 72 65 65 6e |n = &ter|m.screen|
|000059b0| 3b 0a 0a 09 69 66 28 73 | 63 72 65 65 6e 2d 3e 76 |;...if(s|creen->v|
|000059c0| 69 73 75 61 6c 62 65 6c | 6c 29 20 7b 0a 09 09 69 |isualbel|l) {...i|
|000059d0| 66 28 73 63 72 65 65 6e | 2d 3e 54 65 6b 45 6d 75 |f(screen|->TekEmu|
|000059e0| 29 20 7b 0a 09 09 09 69 | 66 28 73 63 72 65 65 6e |) {....i|f(screen|
|000059f0| 2d 3e 69 63 6f 6e 5f 73 | 68 6f 77 20 26 26 20 21 |->icon_s|how && !|
|00005a00| 73 63 72 65 65 6e 2d 3e | 61 63 74 69 76 65 5f 69 |screen->|active_i|
|00005a10| 63 6f 6e 29 20 7b 0a 09 | 09 09 09 58 50 69 78 53 |con) {..|...XPixS|
|00005a20| 65 74 28 73 63 72 65 65 | 6e 2d 3e 69 63 6f 6e 54 |et(scree|n->iconT|
|00005a30| 77 69 6e 2e 77 69 6e 64 | 6f 77 2c 20 30 2c 20 30 |win.wind|ow, 0, 0|
|00005a40| 2c 0a 09 09 09 09 20 73 | 63 72 65 65 6e 2d 3e 69 |,..... s|creen->i|
|00005a50| 63 6f 6e 54 77 69 6e 2e | 77 69 64 74 68 2c 20 73 |conTwin.|width, s|
|00005a60| 63 72 65 65 6e 2d 3e 69 | 63 6f 6e 54 77 69 6e 2e |creen->i|conTwin.|
|00005a70| 68 65 69 67 68 74 2c 0a | 09 09 09 09 20 73 63 72 |height,.|.... scr|
|00005a80| 65 65 6e 2d 3e 66 6f 72 | 65 67 72 6f 75 6e 64 29 |een->for|eground)|
|00005a90| 3b 0a 09 09 09 09 58 46 | 6c 75 73 68 28 29 3b 0a |;.....XF|lush();.|
|00005aa0| 09 09 09 09 58 43 6c 65 | 61 72 28 73 63 72 65 65 |....XCle|ar(scree|
|00005ab0| 6e 2d 3e 69 63 6f 6e 54 | 77 69 6e 2e 77 69 6e 64 |n->iconT|win.wind|
|00005ac0| 6f 77 29 3b 0a 09 09 09 | 09 52 65 66 72 65 73 68 |ow);....|.Refresh|
|00005ad0| 49 63 6f 6e 28 73 63 72 | 65 65 6e 2c 20 73 63 72 |Icon(scr|een, scr|
|00005ae0| 65 65 6e 2d 3e 69 63 6f | 6e 54 77 69 6e 2e 77 69 |een->ico|nTwin.wi|
|00005af0| 6e 64 6f 77 29 3b 0a 09 | 09 09 7d 20 65 6c 73 65 |ndow);..|..} else|
|00005b00| 20 7b 0a 09 09 09 09 58 | 50 69 78 46 69 6c 6c 28 | {.....X|PixFill(|
|00005b10| 54 57 69 6e 64 6f 77 28 | 73 63 72 65 65 6e 29 2c |TWindow(|screen),|
|00005b20| 20 30 2c 20 30 2c 0a 09 | 09 09 09 20 54 46 75 6c | 0, 0,..|... TFul|
|00005b30| 6c 57 69 64 74 68 28 73 | 63 72 65 65 6e 29 2c 20 |lWidth(s|creen), |
|00005b40| 54 46 75 6c 6c 48 65 69 | 67 68 74 28 73 63 72 65 |TFullHei|ght(scre|
|00005b50| 65 6e 29 2c 0a 09 09 09 | 09 20 73 63 72 65 65 6e |en),....|. screen|
|00005b60| 2d 3e 66 6f 72 65 67 72 | 6f 75 6e 64 2c 20 28 42 |->foregr|ound, (B|
|00005b70| 69 74 6d 61 70 29 30 2c | 20 47 58 69 6e 76 65 72 |itmap)0,| GXinver|
|00005b80| 74 2c 0a 09 09 09 09 20 | 73 63 72 65 65 6e 2d 3e |t,..... |screen->|
|00005b90| 78 6f 72 70 6c 61 6e 65 | 29 3b 0a 09 09 09 09 58 |xorplane|);.....X|
|00005ba0| 46 6c 75 73 68 28 29 3b | 0a 09 09 09 09 58 50 69 |Flush();|.....XPi|
|00005bb0| 78 46 69 6c 6c 28 54 57 | 69 6e 64 6f 77 28 73 63 |xFill(TW|indow(sc|
|00005bc0| 72 65 65 6e 29 2c 20 30 | 2c 20 30 2c 0a 09 09 09 |reen), 0|, 0,....|
|00005bd0| 09 20 54 46 75 6c 6c 57 | 69 64 74 68 28 73 63 72 |. TFullW|idth(scr|
|00005be0| 65 65 6e 29 2c 20 54 46 | 75 6c 6c 48 65 69 67 68 |een), TF|ullHeigh|
|00005bf0| 74 28 73 63 72 65 65 6e | 29 2c 0a 09 09 09 09 20 |t(screen|),..... |
|00005c00| 73 63 72 65 65 6e 2d 3e | 66 6f 72 65 67 72 6f 75 |screen->|foregrou|
|00005c10| 6e 64 2c 20 28 42 69 74 | 6d 61 70 29 30 2c 20 47 |nd, (Bit|map)0, G|
|00005c20| 58 69 6e 76 65 72 74 2c | 0a 09 09 09 09 20 73 63 |Xinvert,|..... sc|
|00005c30| 72 65 65 6e 2d 3e 78 6f | 72 70 6c 61 6e 65 29 3b |reen->xo|rplane);|
|00005c40| 0a 09 09 09 7d 0a 09 09 | 7d 20 65 6c 73 65 20 7b |....}...|} else {|
|00005c50| 0a 09 09 09 69 66 28 73 | 63 72 65 65 6e 2d 3e 69 |....if(s|creen->i|
|00005c60| 63 6f 6e 5f 73 68 6f 77 | 20 26 26 20 21 73 63 72 |con_show| && !scr|
|00005c70| 65 65 6e 2d 3e 61 63 74 | 69 76 65 5f 69 63 6f 6e |een->act|ive_icon|
|00005c80| 29 20 7b 0a 09 09 09 09 | 58 50 69 78 53 65 74 28 |) {.....|XPixSet(|
|00005c90| 73 63 72 65 65 6e 2d 3e | 69 63 6f 6e 56 77 69 6e |screen->|iconVwin|
|00005ca0| 2e 77 69 6e 64 6f 77 2c | 20 30 2c 20 30 2c 0a 09 |.window,| 0, 0,..|
|00005cb0| 09 09 09 20 73 63 72 65 | 65 6e 2d 3e 69 63 6f 6e |... scre|en->icon|
|00005cc0| 56 77 69 6e 2e 77 69 64 | 74 68 2c 20 73 63 72 65 |Vwin.wid|th, scre|
|00005cd0| 65 6e 2d 3e 69 63 6f 6e | 56 77 69 6e 2e 68 65 69 |en->icon|Vwin.hei|
|00005ce0| 67 68 74 2c 0a 09 09 09 | 09 20 73 63 72 65 65 6e |ght,....|. screen|
|00005cf0| 2d 3e 66 6f 72 65 67 72 | 6f 75 6e 64 29 3b 0a 09 |->foregr|ound);..|
|00005d00| 09 09 09 58 46 6c 75 73 | 68 28 29 3b 0a 09 09 09 |...XFlus|h();....|
|00005d10| 09 58 43 6c 65 61 72 28 | 73 63 72 65 65 6e 2d 3e |.XClear(|screen->|
|00005d20| 69 63 6f 6e 56 77 69 6e | 2e 77 69 6e 64 6f 77 29 |iconVwin|.window)|
|00005d30| 3b 0a 09 09 09 09 52 65 | 66 72 65 73 68 49 63 6f |;.....Re|freshIco|
|00005d40| 6e 28 73 63 72 65 65 6e | 2c 20 73 63 72 65 65 6e |n(screen|, screen|
|00005d50| 2d 3e 69 63 6f 6e 56 77 | 69 6e 2e 77 69 6e 64 6f |->iconVw|in.windo|
|00005d60| 77 29 3b 0a 09 09 09 7d | 20 65 6c 73 65 20 7b 0a |w);....}| else {.|
|00005d70| 09 09 09 09 58 50 69 78 | 53 65 74 28 56 57 69 6e |....XPix|Set(VWin|
|00005d80| 64 6f 77 28 73 63 72 65 | 65 6e 29 2c 20 30 2c 20 |dow(scre|en), 0, |
|00005d90| 30 2c 20 46 75 6c 6c 57 | 69 64 74 68 28 73 63 72 |0, FullW|idth(scr|
|00005da0| 65 65 6e 29 2c 0a 09 09 | 09 09 20 46 75 6c 6c 48 |een),...|.. FullH|
|00005db0| 65 69 67 68 74 28 73 63 | 72 65 65 6e 29 2c 20 73 |eight(sc|reen), s|
|00005dc0| 63 72 65 65 6e 2d 3e 66 | 6f 72 65 67 72 6f 75 6e |creen->f|oregroun|
|00005dd0| 64 29 3b 0a 09 09 09 09 | 58 46 6c 75 73 68 28 29 |d);.....|XFlush()|
|00005de0| 3b 0a 09 09 09 09 58 43 | 6c 65 61 72 28 56 57 69 |;.....XC|lear(VWi|
|00005df0| 6e 64 6f 77 28 73 63 72 | 65 65 6e 29 29 3b 0a 09 |ndow(scr|een));..|
|00005e00| 09 09 09 53 63 72 6e 52 | 65 66 72 65 73 68 28 73 |...ScrnR|efresh(s|
|00005e10| 63 72 65 65 6e 2c 20 30 | 2c 20 30 2c 20 73 63 72 |creen, 0|, 0, scr|
|00005e20| 65 65 6e 2d 3e 6d 61 78 | 5f 72 6f 77 20 2b 20 31 |een->max|_row + 1|
|00005e30| 20 2b 0a 09 09 09 09 20 | 73 63 72 65 65 6e 2d 3e | +..... |screen->|
|00005e40| 73 74 61 74 75 73 6c 69 | 6e 65 2c 20 73 63 72 65 |statusli|ne, scre|
|00005e50| 65 6e 2d 3e 6d 61 78 5f | 63 6f 6c 20 2b 20 31 29 |en->max_|col + 1)|
|00005e60| 3b 0a 09 09 09 7d 0a 09 | 09 7d 0a 09 7d 20 65 6c |;....}..|.}..} el|
|00005e70| 73 65 0a 09 09 58 46 65 | 65 70 28 30 29 3b 0a 7d |se...XFe|ep(0);.}|
|00005e80| 0a 0a 52 65 64 72 61 77 | 28 29 0a 7b 0a 09 65 78 |..Redraw|().{..ex|
|00005e90| 74 65 72 6e 20 54 65 72 | 6d 69 6e 61 6c 20 74 65 |tern Ter|minal te|
|00005ea0| 72 6d 3b 0a 09 72 65 67 | 69 73 74 65 72 20 53 63 |rm;..reg|ister Sc|
|00005eb0| 72 65 65 6e 20 2a 73 63 | 72 65 65 6e 20 3d 20 26 |reen *sc|reen = &|
|00005ec0| 74 65 72 6d 2e 73 63 72 | 65 65 6e 3b 0a 0a 09 69 |term.scr|een;...i|
|00005ed0| 66 28 56 57 69 6e 64 6f | 77 28 73 63 72 65 65 6e |f(VWindo|w(screen|
|00005ee0| 29 20 26 26 20 73 63 72 | 65 65 6e 2d 3e 73 68 6f |) && scr|een->sho|
|00005ef0| 77 29 20 7b 0a 09 09 56 | 54 45 78 70 6f 73 65 28 |w) {...V|TExpose(|
|00005f00| 4e 55 4c 4c 29 3b 0a 09 | 09 69 66 28 73 63 72 65 |NULL);..|.if(scre|
|00005f10| 65 6e 2d 3e 73 63 72 6f | 6c 6c 62 61 72 29 20 7b |en->scro|llbar) {|
|00005f20| 0a 09 09 09 58 43 6c 65 | 61 72 28 73 63 72 65 65 |....XCle|ar(scree|
|00005f30| 6e 2d 3e 73 62 2d 3e 62 | 61 72 29 3b 0a 09 09 09 |n->sb->b|ar);....|
|00005f40| 58 43 6c 65 61 72 28 73 | 63 72 65 65 6e 2d 3e 73 |XClear(s|creen->s|
|00005f50| 62 2d 3e 72 65 67 69 6f | 6e 29 3b 0a 09 09 09 73 |b->regio|n);....s|
|00005f60| 63 72 65 65 6e 2d 3e 73 | 62 2d 3e 62 75 74 74 6f |creen->s|b->butto|
|00005f70| 6e 73 74 61 74 65 20 3d | 20 2d 31 3b 0a 09 09 09 |nstate =| -1;....|
|00005f80| 44 72 61 77 42 75 74 74 | 6f 6e 28 73 63 72 65 65 |DrawButt|on(scree|
|00005f90| 6e 2d 3e 73 62 29 3b 0a | 09 09 09 73 63 72 65 65 |n->sb);.|...scree|
|00005fa0| 6e 2d 3e 73 62 2d 3e 73 | 61 76 65 73 74 61 74 65 |n->sb->s|avestate|
|00005fb0| 20 3d 20 2d 31 3b 0a 09 | 09 09 44 72 61 77 53 61 | = -1;..|..DrawSa|
|00005fc0| 76 65 28 73 63 72 65 65 | 6e 2d 3e 73 62 29 3b 0a |ve(scree|n->sb);.|
|00005fd0| 09 09 7d 0a 09 09 69 66 | 28 54 69 74 6c 65 62 61 |..}...if|(Titleba|
|00005fe0| 72 28 73 63 72 65 65 6e | 29 29 20 7b 0a 09 09 09 |r(screen|)) {....|
|00005ff0| 58 43 6c 65 61 72 28 73 | 63 72 65 65 6e 2d 3e 74 |XClear(s|creen->t|
|00006000| 69 74 6c 65 2e 74 62 61 | 72 29 3b 0a 09 09 09 58 |itle.tba|r);....X|
|00006010| 43 6c 65 61 72 28 73 63 | 72 65 65 6e 2d 3e 74 69 |Clear(sc|reen->ti|
|00006020| 74 6c 65 2e 6c 65 66 74 | 29 3b 0a 09 09 09 58 43 |tle.left|);....XC|
|00006030| 6c 65 61 72 28 73 63 72 | 65 65 6e 2d 3e 74 69 74 |lear(scr|een->tit|
|00006040| 6c 65 2e 72 69 67 68 74 | 29 3b 0a 09 09 09 56 54 |le.right|);....VT|
|00006050| 54 69 74 6c 65 45 78 70 | 6f 73 65 28 4e 55 4c 4c |TitleExp|ose(NULL|
|00006060| 29 3b 0a 09 09 7d 0a 09 | 7d 0a 09 69 66 28 54 57 |);...}..|}..if(TW|
|00006070| 69 6e 64 6f 77 28 73 63 | 72 65 65 6e 29 20 26 26 |indow(sc|reen) &&|
|00006080| 20 73 63 72 65 65 6e 2d | 3e 54 73 68 6f 77 29 20 | screen-|>Tshow) |
|00006090| 7b 0a 09 09 54 65 6b 45 | 78 70 6f 73 65 28 4e 55 |{...TekE|xpose(NU|
|000060a0| 4c 4c 29 3b 0a 09 09 69 | 66 28 54 69 74 6c 65 62 |LL);...i|f(Titleb|
|000060b0| 61 72 28 73 63 72 65 65 | 6e 29 29 20 7b 0a 09 09 |ar(scree|n)) {...|
|000060c0| 09 58 43 6c 65 61 72 28 | 73 63 72 65 65 6e 2d 3e |.XClear(|screen->|
|000060d0| 54 74 69 74 6c 65 2e 74 | 62 61 72 29 3b 0a 09 09 |Ttitle.t|bar);...|
|000060e0| 09 58 43 6c 65 61 72 28 | 73 63 72 65 65 6e 2d 3e |.XClear(|screen->|
|000060f0| 54 74 69 74 6c 65 2e 6c | 65 66 74 29 3b 0a 09 09 |Ttitle.l|eft);...|
|00006100| 09 58 43 6c 65 61 72 28 | 73 63 72 65 65 6e 2d 3e |.XClear(|screen->|
|00006110| 54 74 69 74 6c 65 2e 72 | 69 67 68 74 29 3b 0a 09 |Ttitle.r|ight);..|
|00006120| 09 09 54 65 6b 54 69 74 | 6c 65 45 78 70 6f 73 65 |..TekTit|leExpose|
|00006130| 28 4e 55 4c 4c 29 3b 0a | 09 09 7d 0a 09 7d 0a 7d |(NULL);.|..}..}.}|
|00006140| 0a 0a 49 63 6f 6e 49 6e | 69 74 28 73 63 72 65 65 |..IconIn|it(scree|
|00006150| 6e 2c 20 62 6d 2c 20 54 | 62 6d 29 0a 72 65 67 69 |n, bm, T|bm).regi|
|00006160| 73 74 65 72 20 53 63 72 | 65 65 6e 20 2a 73 63 72 |ster Scr|een *scr|
|00006170| 65 65 6e 3b 0a 63 68 61 | 72 20 2a 62 6d 2c 20 2a |een;.cha|r *bm, *|
|00006180| 54 62 6d 3b 0a 7b 0a 09 | 72 65 67 69 73 74 65 72 |Tbm;.{..|register|
|00006190| 20 69 6e 74 20 77 3b 0a | 0a 09 69 66 28 21 62 6d | int w;.|..if(!bm|
|000061a0| 20 26 26 20 21 54 62 6d | 29 20 7b 09 2f 2a 20 75 | && !Tbm|) {./* u|
|000061b0| 73 65 20 64 65 66 61 75 | 6c 74 20 62 69 74 6d 61 |se defau|lt bitma|
|000061c0| 70 73 20 2a 2f 0a 09 09 | 73 63 72 65 65 6e 2d 3e |ps */...|screen->|
|000061d0| 69 63 6f 6e 62 69 74 6d | 61 70 2e 62 69 74 73 20 |iconbitm|ap.bits |
|000061e0| 3d 20 69 63 6f 6e 5f 62 | 69 74 73 3b 0a 09 09 73 |= icon_b|its;...s|
|000061f0| 63 72 65 65 6e 2d 3e 54 | 69 63 6f 6e 62 69 74 6d |creen->T|iconbitm|
|00006200| 61 70 2e 62 69 74 73 20 | 3d 20 74 65 6b 5f 69 63 |ap.bits |= tek_ic|
|00006210| 6f 6e 5f 62 69 74 73 3b | 0a 09 09 73 63 72 65 65 |on_bits;|...scree|
|00006220| 6e 2d 3e 62 69 74 6d 61 | 70 77 69 64 74 68 20 3d |n->bitma|pwidth =|
|00006230| 20 73 63 72 65 65 6e 2d | 3e 69 63 6f 6e 62 69 74 | screen-|>iconbit|
|00006240| 6d 61 70 2e 77 69 64 74 | 68 20 3d 0a 09 09 20 73 |map.widt|h =... s|
|00006250| 63 72 65 65 6e 2d 3e 54 | 69 63 6f 6e 62 69 74 6d |creen->T|iconbitm|
|00006260| 61 70 2e 77 69 64 74 68 | 20 3d 20 69 63 6f 6e 5f |ap.width| = icon_|
|00006270| 77 69 64 74 68 3b 0a 09 | 09 73 63 72 65 65 6e 2d |width;..|.screen-|
|00006280| 3e 62 69 74 6d 61 70 68 | 65 69 67 68 74 20 3d 20 |>bitmaph|eight = |
|00006290| 73 63 72 65 65 6e 2d 3e | 69 63 6f 6e 62 69 74 6d |screen->|iconbitm|
|000062a0| 61 70 2e 68 65 69 67 68 | 74 20 3d 0a 09 09 20 73 |ap.heigh|t =... s|
|000062b0| 63 72 65 65 6e 2d 3e 54 | 69 63 6f 6e 62 69 74 6d |creen->T|iconbitm|
|000062c0| 61 70 2e 68 65 69 67 68 | 74 20 3d 20 69 63 6f 6e |ap.heigh|t = icon|
|000062d0| 5f 68 65 69 67 68 74 3b | 0a 09 7d 20 65 6c 73 65 |_height;|..} else|
|000062e0| 20 69 66 28 62 6d 20 26 | 26 20 21 2a 62 6d 20 26 | if(bm &|& !*bm &|
|000062f0| 26 20 54 62 6d 20 26 26 | 20 21 2a 54 62 6d 29 09 |& Tbm &&| !*Tbm).|
|00006300| 2f 2a 20 62 6f 74 68 20 | 65 6d 70 74 79 20 6d 65 |/* both |empty me|
|00006310| 61 6e 73 20 6e 6f 20 62 | 69 74 6d 61 70 20 2a 2f |ans no b|itmap */|
|00006320| 0a 09 09 73 63 72 65 65 | 6e 2d 3e 62 69 74 6d 61 |...scree|n->bitma|
|00006330| 70 77 69 64 74 68 20 3d | 20 73 63 72 65 65 6e 2d |pwidth =| screen-|
|00006340| 3e 62 69 74 6d 61 70 68 | 65 69 67 68 74 20 3d 20 |>bitmaph|eight = |
|00006350| 30 3b 0a 09 65 6c 73 65 | 20 7b 09 09 09 2f 2a 20 |0;..else| {.../* |
|00006360| 75 73 65 72 20 64 65 66 | 69 6e 65 64 20 62 69 74 |user def|ined bit|
|00006370| 6d 61 70 28 73 29 20 2a | 2f 0a 09 09 69 66 28 62 |map(s) *|/...if(b|
|00006380| 6d 20 26 26 20 2a 62 6d | 29 20 7b 0a 09 09 09 69 |m && *bm|) {....i|
|00006390| 66 28 28 77 20 3d 20 58 | 52 65 61 64 42 69 74 6d |f((w = X|ReadBitm|
|000063a0| 61 70 46 69 6c 65 28 62 | 6d 2c 20 26 73 63 72 65 |apFile(b|m, &scre|
|000063b0| 65 6e 2d 3e 69 63 6f 6e | 62 69 74 6d 61 70 2e 77 |en->icon|bitmap.w|
|000063c0| 69 64 74 68 2c 0a 09 09 | 09 20 26 73 63 72 65 65 |idth,...|. &scree|
|000063d0| 6e 2d 3e 69 63 6f 6e 62 | 69 74 6d 61 70 2e 68 65 |n->iconb|itmap.he|
|000063e0| 69 67 68 74 2c 20 26 73 | 63 72 65 65 6e 2d 3e 69 |ight, &s|creen->i|
|000063f0| 63 6f 6e 62 69 74 6d 61 | 70 2e 62 69 74 73 2c 0a |conbitma|p.bits,.|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.