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