source: SH_SHM/trunk/source/newgraph/gcusrdef.h @ 341

Revision 341, 11.1 KB checked in by marcus, 9 years ago (diff)

r180 | walther | 2011-03-09 16:27:03 +0100 (Mi, 09 Mär 2011) | 3 lines

Merging most of the changes from marcus' branch. For full details please see
http://www.seismic-handler.org/portal/log/SH_SHM/branches/marcus?revs=101-106,123-171

Line 
1
2/* file GCUSRDEF.H
3 *      ==========
4 *
5 * version 16, 31-Aug-93
6 *
7 * prototypes of module GRAPHCH.C
8 * K. Stammler, 9-AUG-91
9 */
10
11
12#ifndef __GCUSRDEF
13#define __GCUSRDEF
14
15#ifndef __BASECNST
16#include BASECNST
17#endif
18#ifndef __GRAPHBAS
19#include BC_GRAPHBAS
20#endif
21
22/* channel bits */
23#define GCF_MEM       0x200
24#define GCF_PSF       0x400
25#define GCF_XWDW      0x2000
26#define GCF_STDCH     0x10        /* standard text channel */
27#define GCF_FILE      0x00        /* text file channel */
28#define GCF_NOECHO    0x40        /* no echo bit */
29#define GCF_EXTERN    0x1000      /* external routine */
30#define GCF_ALLCHAN   (GCF_MEM|GCF_PSF|GCF_XWDW)      /* all channels */
31#define GCF_NUMMASK   7
32
33#define GCF_HARDCOPY GCF_MEM
34
35/* window attributes */
36#define GCF_WNAME   0x01
37#define GCF_WCLOSER 0x02
38#define GCF_WFULLER 0x04
39#define GCF_WMOVER  0x08
40#define GCF_WINFO   0x10
41#define GCF_WSIZER  0x20
42
43typedef GBC_COO COOTYPE;
44
45
46/* not implemented routines */
47#define gc_sethc(g,i,v,s)
48#define gc_hardcopy(m,s)
49
50
51/* macros */
52/* #define gc_redraw(c,s) gc_playback(c,c,NULL,s) */
53
54
55/*------------------------------------------------------------------------*/
56
57
58void gc_init( CHMAP map, int attribs, COOTYPE xlo, COOTYPE ylo,
59        COOTYPE width, COOTYPE height, STATUS *status );
60
61/* initialises GEM
62 *
63 * parameters of routine
64 * CHMAP      map;       input; channel map
65 * int        attribs;   input; window attributes
66 * COOTYPE    xlo;       input; x-coo of lower left corner
67 * COOTYPE    ylo;       input; y-coo of lower left corner
68 * COOTYPE    width;     input; widths of window
69 * COOTYPE    height;    input; height of window
70 * STATUS     *status;   output; return status
71 */
72
73
74/*------------------------------------------------------------------------*/
75
76
77void gc_exit( CHMAP map );
78
79/* closes channel
80 *
81 * parameters of routine
82 * CHMAP      map;          input; window to be closed
83 */
84
85
86/*------------------------------------------------------------------------*/
87
88
89void gc_finish( void );
90
91/* closes all channels and terminates graphics
92 *
93 * no parameters
94 */
95
96
97/*------------------------------------------------------------------------*/
98
99
100void gc_resizewdw( CHMAP map, COOTYPE xpos, COOTYPE ypos,
101        COOTYPE width, COOTYPE height, STATUS *status );
102
103/* resizes channel
104 *
105 * parameters of routine
106 * CHMAP      map;            input; channel map
107 * COOTYPE    xpos, ypos;     input; position of window
108 * COOTYPE    width, height;  input; size of window
109 * STATUS     *status;        output; return status
110 */
111
112
113/*------------------------------------------------------------------------*/
114
115
116void gc_popwdw( CHMAP map );
117
118/* pops window on top
119 *
120 * parameters of routine
121 * CHMAP      map;            input; channel map
122 */
123
124
125/*------------------------------------------------------------------------*/
126
127
128void gc_setwdwname( CHMAP map, char name[] );
129
130/* sets new window name
131 *
132 * parameters of routine
133 * CHMAP     map;       input; channel map
134 * char      name[];    input; new name
135 */
136
137
138/*------------------------------------------------------------------------*/
139
140
141void gc_setstyle( CHMAP map, unsigned style, char item[],
142        char value[], STATUS *status );
143
144/* sets style attribute
145 *
146 * parameters of routine
147 * CHMAP      map;       input; channel map
148 * unsigned   style;     input; style block number
149 * char       item[];    input; name of attribute
150 * char       value[];   input; new value of attribute (text)
151 * STATUS     *status;   output; return status
152 */
153
154
155/*------------------------------------------------------------------------*/
156
157
158void gc_setcoo( CHMAP map, COOTYPE x, COOTYPE y, COOTYPE w, COOTYPE h,
159        STATUS *status );
160
161/* sets user coordinates in window.  If x,y,w,h are all equal to zero,
162 * the last call is repeated.
163 *
164 * parameters of routine
165 * CHMAP      map;        input; channel map
166 * COOTYPE    x, y, w, h; input; user coordinates
167 * STATUS     *status;    output; return status
168 */
169
170
171/*------------------------------------------------------------------------*/
172
173
174float gc_aspectratio( CHMAP map );
175
176/* returns ratio of width to height
177 *
178 * parameters of routine
179 * CHMAP      map;      input; channel map
180 *                      returns aspect ratio
181 */
182
183
184/*------------------------------------------------------------------------*/
185
186
187void gc_moveto( CHMAP map, COOTYPE x, COOTYPE y );
188
189/* moves to position (x,y) in user coordinates
190 *
191 * parameters of routine
192 * CHMAP      map;      input; channel map
193 * COOTYPE    x, y;     input; location to move to
194 */
195
196
197/*------------------------------------------------------------------------*/
198
199
200void gc_drawto( CHMAP map, int style, COOTYPE x, COOTYPE y );
201
202/* moves to position (x,y) in user coordinates
203 *
204 * parameters of routine
205 * CHMAP      map;      input; channel map
206 * int        style;    input; style block number
207 * COOTYPE    x, y;     input; location to move to
208 */
209
210
211/*------------------------------------------------------------------------*/
212
213
214
215void gc_setpixel( CHMAP map, int style, COOTYPE x, COOTYPE y );
216
217/* sets pixel at position (x,y) in user coordinates
218 *
219 * parameters of routine
220 * CHMAP      map;      input; channel map
221 * int        style;    input; style block number
222 * COOTYPE    x, y;     input; location to move to
223 */
224
225
226/*------------------------------------------------------------------------*/
227
228
229void gc_arrayplot( CHMAP map, int style, long cnt, int red, COOTYPE xoff,
230        COOTYPE xinc, COOTYPE yoff, COOTYPE yarr[], COOTYPE yzoom, STATUS *status );
231
232/* plots an array of sample data
233 *
234 * parameters of routine
235 * CHMAP      map;       input; channel map
236 * int        style;     input; line style ID
237 * long       cnt;       input; length of data array
238 * int        red;       input; reduction factor for plotting
239 * COOTYPE    xoff;      input; x-position of first sample
240 * COOTYPE    xinc;      input; x increment
241 * COOTYPE    yoff;      input; y-position of first sample
242 * COOTYPE    yarr[];    input; sample data
243 * COOTYPE    yzoom;     input; zoom factor of sample data
244 * STATUS     *status;   output; return status
245 */
246
247
248/*------------------------------------------------------------------------*/
249
250
251void gc_erase( CHMAP map );
252
253/* clears channel
254 *
255 * parameters of routine
256 * CHMAP      map;       input; channel map
257 */
258
259
260/*------------------------------------------------------------------------*/
261
262
263void gc_text( CHMAP map, int style, COOTYPE x, COOTYPE y, char text[] );
264
265/* writes text to window
266 *
267 * parameters of routine
268 * CHMAP      map;        input; channel map
269 * int        style;      input; character style block number
270 * COOTYPE    x, y;       input; text position
271 * char       text[];     input; output text
272 */
273
274
275/*------------------------------------------------------------------------*/
276
277
278void gc_write( CHMAP map, char text[] );
279
280/* writes text to window at current write position
281 *
282 * parameters of routine
283 * CHMAP      map;          input; channel map
284 * char       text[];       input; output text
285 */
286
287
288/*------------------------------------------------------------------------*/
289
290
291void gc_wrtch( CHMAP map, char ch );
292
293/* writes a single character to channel
294 *
295 * parameters of routine
296 * CHMAP      map;         input; channel map
297 * char       ch;          input; char to be written
298 */
299
300
301/*------------------------------------------------------------------------*/
302
303
304int gc_txtwidth( CHMAP map );
305
306/* returns width of channel in characters
307 *
308 * parameters of routine
309 * CHMAP      map;      input; channel map
310 */
311
312
313/*------------------------------------------------------------------------*/
314
315
316int gc_txtheight( CHMAP map );
317
318/* returns height of window in characters
319 *
320 * parameters of routine
321 * CHMAP      wdw;     input; channel map
322 */
323
324
325/*------------------------------------------------------------------------*/
326
327
328float gc_chheight( CHMAP map );
329
330/* returns current character height in window "wdw"
331 *
332 * parameter of routine
333 * CHMAP     map;      input; channel map
334 */
335
336
337/*------------------------------------------------------------------------*/
338
339
340void gc_read( CHMAP map, int maxlth, char text[] );
341
342/* reads text from terminal
343 *
344 * parameters of routine
345 * CHMAP    map;          input; channel map
346 * int      maxlth;       input; maximum length of text
347 * char     text[];       output; text read
348 */
349
350
351/*------------------------------------------------------------------------*/
352
353
354void gc_getloc( CHMAP map, COOTYPE *x, COOTYPE *y, char *ch );
355
356/* requests mouse position in window
357 *
358 * parameters of routine
359 * CHMAP      map;        input; channel map
360 * COOTYPE    *x, *y;     output; location selected
361 * char       *ch;        output; key pressed
362 */
363
364
365/*------------------------------------------------------------------------*/
366
367
368void gc_set_outputdir( char dir[], STATUS *status );
369
370/* sets scratch directory
371 *
372 * parameters of routine
373 * char      dir[];     input; new directory name of scratch path
374 * STATUS    *status;   output; return status
375 */
376
377
378/*------------------------------------------------------------------------*/
379
380
381void gc_set_inputdir( char dir[], STATUS *status );
382
383/* sets input directory
384 *
385 * parameters of routine
386 * char      dir[];     input; new directory name
387 * STATUS    *status;   output; return status
388 */
389
390
391/*------------------------------------------------------------------------*/
392
393
394void gc_setpar( CHMAP map, char item[], char value[], STATUS *status );
395
396/* sets channel specific parameters
397 *
398 * parameters of routine
399 * CHMAP      map;       input; channel map
400 * char       item[];    input; name of item to be changed
401 * char       value[];   input; new value of item
402 * STATUS     *status;   output; return status
403 */
404
405
406/*------------------------------------------------------------------------*/
407
408
409void gc_flushbuffers( void );
410
411/* flushes all output buffers
412 *
413 * no parameters
414 */
415
416
417/*----------------------------------------------------------------------------*/
418
419
420void gc_update( void );
421
422/* updates window content
423 * no parameters
424 */
425
426
427/*------------------------------------------------------------------------*/
428
429
430void gc_playback( CHMAP src, CHMAP dst, char outf[], STATUS *status );
431
432/* copies content of channel src into channel dst
433 *
434 * parameters of routine
435 * CHMAP      src;     input; source channel
436 * CHMAP      dst;     input; destination channel
437 * char       outf[];  output; output filename
438 * STATUS     *status; output; return status
439 */
440
441
442/*------------------------------------------------------------------------*/
443
444
445void gc_set_write_extern( void (*wr_rout)(char text[]) );
446
447/* sets the write routine for the external channel
448 *
449 * parameters of routine
450 * void       (*wr_rout)(char text[]);    input; output routine
451 */
452
453
454/*------------------------------------------------------------------------*/
455
456
457void gc_closeplot( CHMAP map, char outf[], STATUS *status );
458
459/* closes plot file on hardcopy channels
460 *
461 * parameters of routine
462 * CHMAP      map;         input; channel map
463 * char       outf[];      output; name of plotfile
464 * STATUS     *status;     output; return status
465 */
466
467
468/*------------------------------------------------------------------------*/
469
470
471void gc_swap( BOOLEAN on_off );
472
473/* switches x-y swapping on or off
474 *
475 * parameters of routine
476 * BOOLEAN    on_off;    input; TRUE=on, FALSE=off
477 */
478
479
480/*------------------------------------------------------------------------*/
481
482#endif  /* __GCUSRDEF */
Note: See TracBrowser for help on using the repository browser.