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