[3ae31e9] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | sqfield.c -- MIDAS-VII sequence display field functions
|
---|
| 4 | Version 9 -- 1989-11-16 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #define DEBUGIT 0
|
---|
| 9 |
|
---|
| 10 | #include "stddefs.h"
|
---|
| 11 | #include "hwdefs.h"
|
---|
| 12 | #include "graphdef.h"
|
---|
| 13 | #include "vsdd.h"
|
---|
| 14 | #include "fields.h"
|
---|
| 15 | #include "curpak.h"
|
---|
| 16 | #include "patch.h"
|
---|
| 17 | #include "macros.h"
|
---|
| 18 |
|
---|
| 19 | #include "midas.h"
|
---|
| 20 | #include "ptdisp.h"
|
---|
| 21 |
|
---|
| 22 | #if DEBUGIT
|
---|
| 23 | extern short debugsw;
|
---|
| 24 |
|
---|
| 25 | short debugqf = 1;
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | extern short (*xy_up)(), (*xy_dn)();
|
---|
| 29 | extern short (*premove)(), (*pstmove)();
|
---|
| 30 | extern short (*curtype)();
|
---|
| 31 |
|
---|
| 32 | extern short select(), nokey(), stdctp5();
|
---|
| 33 | extern short cxkstd(), cykstd(), stdmkey(), stddkey();
|
---|
| 34 | extern short stopsm(), smxupd(), sqyupd();
|
---|
| 35 | extern short postcm();
|
---|
| 36 |
|
---|
| 37 | extern short astat;
|
---|
| 38 | extern short cmfirst;
|
---|
| 39 | extern short cmtype;
|
---|
| 40 | extern short curhold;
|
---|
| 41 | extern short curslin;
|
---|
| 42 | extern short cvtime;
|
---|
| 43 | extern short cvwait;
|
---|
| 44 | extern short ncvwait;
|
---|
| 45 | extern short sqdeflg;
|
---|
| 46 | extern short stccol;
|
---|
| 47 | extern short ss_ptsw;
|
---|
| 48 | extern short ss_sqsw;
|
---|
| 49 | extern short syrate;
|
---|
| 50 | extern short tvcwval;
|
---|
| 51 | extern short vcwval;
|
---|
| 52 |
|
---|
| 53 | extern short crate1[];
|
---|
| 54 |
|
---|
| 55 | extern struct selbox *csbp;
|
---|
| 56 | extern struct selbox sqboxes[];
|
---|
| 57 |
|
---|
| 58 | extern struct seqent seqbuf;
|
---|
| 59 | extern struct seqent seqtab[];
|
---|
| 60 |
|
---|
| 61 | extern char sqdebuf[];
|
---|
| 62 |
|
---|
| 63 | short sqxkey(); /* forward reference */
|
---|
| 64 | short sqekey(); /* forward reference */
|
---|
| 65 | short sqmkey(); /* forward reference */
|
---|
| 66 |
|
---|
| 67 | /* |
---|
| 68 |
|
---|
| 69 | */
|
---|
| 70 |
|
---|
| 71 | struct curpak sq_flds = {
|
---|
| 72 |
|
---|
| 73 | stdctp5, /* curtype */
|
---|
| 74 | nokey, /* premove */
|
---|
| 75 | postcm, /* pstmove */
|
---|
| 76 | cxkstd, /* cx_key */
|
---|
| 77 | cykstd, /* cy_key */
|
---|
| 78 | smxupd, /* cx_upd */
|
---|
| 79 | sqyupd, /* cy_upd */
|
---|
| 80 | stopsm, /* xy_up */
|
---|
| 81 | nokey, /* xy_dn */
|
---|
| 82 | sqxkey, /* x_key */
|
---|
| 83 | sqekey, /* e_key */
|
---|
| 84 | sqmkey, /* m_key */
|
---|
| 85 | sqdkey, /* d_key */
|
---|
| 86 | nokey, /* not_fld */
|
---|
| 87 | (struct fet *)NULL, /* curfet */
|
---|
| 88 | sqboxes, /* csbp */
|
---|
| 89 | crate1, /* cratex */
|
---|
| 90 | crate1, /* cratey */
|
---|
| 91 | CT_SMTH, /* cmtype */
|
---|
| 92 | CTOX(2), /* cxval */
|
---|
| 93 | RTOY(DATAROW) /* cyval */
|
---|
| 94 | };
|
---|
| 95 |
|
---|
| 96 | /* |
---|
| 97 |
|
---|
| 98 | */
|
---|
| 99 |
|
---|
| 100 | /*
|
---|
| 101 | =============================================================================
|
---|
| 102 | sqmkey() -- M key processing for the sequence display
|
---|
| 103 | =============================================================================
|
---|
| 104 | */
|
---|
| 105 |
|
---|
| 106 | sqmkey()
|
---|
| 107 | {
|
---|
| 108 | register short nc;
|
---|
| 109 |
|
---|
| 110 | if (astat) {
|
---|
| 111 |
|
---|
| 112 | if (stccol EQ 48) {
|
---|
| 113 |
|
---|
| 114 | if (ss_ptsw EQ 0) {
|
---|
| 115 |
|
---|
| 116 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
| 117 |
|
---|
| 118 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
| 119 |
|
---|
| 120 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
| 121 |
|
---|
| 122 | cvtime = syrate;
|
---|
| 123 | ncvwait = curhold;
|
---|
| 124 |
|
---|
| 125 | ss_sqsw = -1;
|
---|
| 126 | cmtype = nc;
|
---|
| 127 | cvwait = 1;
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | } else
|
---|
| 131 | stdmkey();
|
---|
| 132 |
|
---|
| 133 | } else {
|
---|
| 134 |
|
---|
| 135 | if (stccol EQ 48) {
|
---|
| 136 |
|
---|
| 137 | ss_sqsw = 0;
|
---|
| 138 | cvwait = 1;
|
---|
| 139 | ncvwait = cvtime;
|
---|
| 140 | cmfirst = TRUE;
|
---|
| 141 |
|
---|
| 142 | if (ss_ptsw EQ 0)
|
---|
| 143 | (*xy_up)();
|
---|
| 144 |
|
---|
| 145 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
| 146 |
|
---|
| 147 | } else
|
---|
| 148 | stdmkey();
|
---|
| 149 | }
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | /* |
---|
| 153 |
|
---|
| 154 | */
|
---|
| 155 |
|
---|
| 156 | /*
|
---|
| 157 | =============================================================================
|
---|
| 158 | sqekey() -- E key processing for the sequence display
|
---|
| 159 | =============================================================================
|
---|
| 160 | */
|
---|
| 161 |
|
---|
| 162 | sqekey()
|
---|
| 163 | {
|
---|
| 164 | register short nc;
|
---|
| 165 |
|
---|
| 166 | if (astat) {
|
---|
| 167 |
|
---|
| 168 | if (stccol EQ 48) {
|
---|
| 169 |
|
---|
| 170 | if (ss_ptsw EQ 0) {
|
---|
| 171 |
|
---|
| 172 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
| 173 |
|
---|
| 174 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
| 175 |
|
---|
| 176 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
| 177 |
|
---|
| 178 | cvtime = syrate;
|
---|
| 179 | ncvwait = curhold;
|
---|
| 180 |
|
---|
| 181 | ss_sqsw = 1;
|
---|
| 182 | cmtype = nc;
|
---|
| 183 | cvwait = 1;
|
---|
| 184 | }
|
---|
| 185 |
|
---|
| 186 | } else
|
---|
| 187 | select();
|
---|
| 188 |
|
---|
| 189 | } else {
|
---|
| 190 |
|
---|
| 191 | if (stccol EQ 48) {
|
---|
| 192 |
|
---|
| 193 | ss_sqsw = 0;
|
---|
| 194 | cvwait = 1;
|
---|
| 195 | ncvwait = cvtime;
|
---|
| 196 | cmfirst = TRUE;
|
---|
| 197 |
|
---|
| 198 | if (ss_ptsw EQ 0)
|
---|
| 199 | (*xy_up)();
|
---|
| 200 |
|
---|
| 201 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
| 202 |
|
---|
| 203 | } else
|
---|
| 204 | select();
|
---|
| 205 | }
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | /* |
---|
| 209 |
|
---|
| 210 | */
|
---|
| 211 |
|
---|
| 212 | /*
|
---|
| 213 | =============================================================================
|
---|
| 214 | sqxkey() -- delete key handler
|
---|
| 215 | =============================================================================
|
---|
| 216 | */
|
---|
| 217 |
|
---|
| 218 | sqxkey()
|
---|
| 219 | {
|
---|
| 220 | if (NOT astat)
|
---|
| 221 | return;
|
---|
| 222 |
|
---|
| 223 | if (inrange(stccol, 2, 4)) {
|
---|
| 224 |
|
---|
| 225 | memsetw(&seqbuf, 0, NSEQW);
|
---|
| 226 | memsetw(&seqtab[curslin], 0, NSEQW);
|
---|
| 227 | dsqlin(sqdebuf, curslin);
|
---|
| 228 | sqdeflg = TRUE;
|
---|
| 229 | dcursq();
|
---|
| 230 |
|
---|
| 231 | } else if (inrange(stccol, 12, 22)) {
|
---|
| 232 |
|
---|
| 233 | seqtab[curslin].seqact1 = 0;
|
---|
| 234 | seqtab[curslin].seqdat1 = 0;
|
---|
| 235 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
| 236 | dsqlin(sqdebuf, curslin);
|
---|
| 237 | sqdeflg = TRUE;
|
---|
| 238 | dcursq();
|
---|
| 239 |
|
---|
| 240 | } else if (inrange(stccol, 24, 34)) {
|
---|
| 241 |
|
---|
| 242 | seqtab[curslin].seqact2 = 0;
|
---|
| 243 | seqtab[curslin].seqdat2 = 0;
|
---|
| 244 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
| 245 | dsqlin(sqdebuf, curslin);
|
---|
| 246 | sqdeflg = TRUE;
|
---|
| 247 | dcursq();
|
---|
| 248 |
|
---|
| 249 | } else if (inrange(stccol, 36, 46)) {
|
---|
| 250 |
|
---|
| 251 | seqtab[curslin].seqact3 = 0;
|
---|
| 252 | seqtab[curslin].seqdat3 = 0;
|
---|
| 253 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
| 254 | dsqlin(sqdebuf, curslin);
|
---|
| 255 | sqdeflg = TRUE;
|
---|
| 256 | dcursq();
|
---|
| 257 | }
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | /* |
---|
| 261 |
|
---|
| 262 | */
|
---|
| 263 |
|
---|
| 264 | /*
|
---|
| 265 | =============================================================================
|
---|
| 266 | sqfield() -- setup field routines for the sequence editor
|
---|
| 267 | =============================================================================
|
---|
| 268 | */
|
---|
| 269 |
|
---|
| 270 | sqfield()
|
---|
| 271 | {
|
---|
| 272 |
|
---|
| 273 | #if DEBUGIT
|
---|
| 274 | if (debugsw AND debugqf)
|
---|
| 275 | printf("sqfield(): ENTRY\n");
|
---|
| 276 | #endif
|
---|
| 277 |
|
---|
| 278 | curset(&sq_flds);
|
---|
| 279 |
|
---|
| 280 | #if DEBUGIT
|
---|
| 281 | if (debugsw AND debugqf)
|
---|
| 282 | printf("sqfield(): EXIT\n");
|
---|
| 283 | #endif
|
---|
| 284 |
|
---|
| 285 | }
|
---|