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