1 /* 2 * Grace - GRaphing, Advanced Computation and Exploration of data 3 * 4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/ 5 * 6 * Copyright (c) 1991-1995 Paul J Turner, Portland, OR 7 * Copyright (c) 1996-2002 Grace Development Team 8 * 9 * Maintained by Evgeny Stambulchik 10 * 11 * 12 * All Rights Reserved 13 * 14 * This program is free software; you can redistribute it and/or modify 15 * it under the terms of the GNU General Public License as published by 16 * the Free Software Foundation; either version 2 of the License, or 17 * (at your option) any later version. 18 * 19 * This program is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 * 24 * You should have received a copy of the GNU General Public License 25 * along with this program; if not, write to the Free Software 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 */ 28 29 /* 30 * 31 * Global variables of Grace - should be empty :-( 32 * 33 */ 34 35 #ifndef __GLOBALS_H_ 36 #define __GLOBALS_H_ 37 38 #include <stdlib.h> 39 #include <stdio.h> 40 41 #include "defines.h" 42 #include "graphs.h" 43 #include "draw.h" 44 45 #ifdef MAIN 46 # define GLOBAL(var, type, val) type var = val 47 # define GLOBALARR(arr, type, dim, val) type arr[dim] = val 48 49 /* target set */ 50 target target_set; 51 /* timestamp */ 52 plotstr timestamp; 53 /* default properties */ 54 defaults grdefaults; 55 56 /* parameters for non-linear fit */ 57 nonlparms nonl_parms[MAXPARM]; 58 nonlopts nonl_opts; 59 60 /* region definition */ 61 region rg[MAXREGION]; 62 63 #else 64 # define GLOBAL(var, type, val) extern type var 65 # define GLOBALARR(arr, type, dim, val) extern type arr[] 66 67 extern target target_set; 68 extern defaults grdefaults; 69 extern plotstr timestamp; 70 71 extern nonlparms nonl_parms[]; 72 extern nonlopts nonl_opts; 73 74 extern region rg[]; 75 76 #endif 77 78 /* real-time input delay (prevents getting stuck reading) */ 79 GLOBAL(timer_delay, int, 200); 80 81 /* linked scroll */ 82 GLOBAL(scrolling_islinked, int, FALSE); 83 /* scroll fraction */ 84 GLOBAL(scrollper, double, 0.05); 85 /* expand/shrink fraction */ 86 GLOBAL(shexper, double, 0.05); 87 88 /* terminal device */ 89 GLOBAL(tdevice, int, 0); 90 /* hardcopy device */ 91 GLOBAL(hdevice, int, 0); 92 93 /* set mono mode */ 94 GLOBAL(monomode, int, FALSE); 95 /* use GXxor or GXinvert for xor'ing */ 96 GLOBAL(invert, int, TRUE); 97 /* if true, redraw graph each time action is performed */ 98 GLOBAL(auto_redraw, int, TRUE); 99 /* allow double click ops */ 100 GLOBAL(allow_dc, int, TRUE); 101 /* if TRUE, assume yes for everything */ 102 GLOBAL(noask, int, FALSE); 103 104 /* true if running X */ 105 GLOBAL(inwin, int, FALSE); 106 107 /* autoscale after reading in data sets */ 108 GLOBAL(autoscale_onread, int, AUTOSCALE_XY); 109 110 GLOBAL(focus_policy, int, FOCUS_CLICK); 111 GLOBAL(draw_focus_flag, int, TRUE); 112 113 /* lines */ 114 GLOBAL(lines, linetype *, NULL); 115 /* boxes */ 116 GLOBAL(boxes, boxtype *, NULL); 117 /* ellipses */ 118 GLOBAL(ellip, ellipsetype *, NULL); 119 /* strings */ 120 GLOBAL(pstr, plotstr *, NULL); 121 122 /* lines, boxes, ellipses and strings flags */ 123 GLOBAL(box_color, int, 1); 124 GLOBAL(box_lines, int, 1); 125 GLOBAL(box_linew, double, 1.0); 126 GLOBAL(box_fillpat, int, 0); 127 GLOBAL(box_fillcolor, int, 1); 128 GLOBAL(box_loctype, int, COORD_VIEW); 129 130 GLOBAL(ellipse_color, int, 1); 131 GLOBAL(ellipse_lines, int, 1); 132 GLOBAL(ellipse_linew, double, 1.0); 133 GLOBAL(ellipse_fillpat, int, 0); 134 GLOBAL(ellipse_fillcolor, int, 1); 135 GLOBAL(ellipse_loctype, int, COORD_VIEW); 136 137 GLOBAL(line_color, int, 1); 138 GLOBAL(line_lines, int, 1); 139 GLOBAL(line_linew, double, 1.0); 140 GLOBAL(line_arrow_end, int, 0); 141 GLOBAL(line_atype, int, 0); 142 GLOBAL(line_asize, double, 1.0); 143 GLOBAL(line_a_dL_ff, double, 1.0); 144 GLOBAL(line_a_lL_ff, double, 1.0); 145 GLOBAL(line_loctype, int, COORD_VIEW); 146 147 GLOBAL(string_color, int, 1); 148 GLOBAL(string_font, int, 0); 149 GLOBAL(string_rot, int, 0); 150 GLOBAL(string_just, int, 0); 151 GLOBAL(string_size, double, 1.0); 152 GLOBAL(string_loctype, int, COORD_VIEW); 153 154 155 /* used in the parser */ 156 GLOBAL(curtype, int, SET_XY); 157 GLOBAL(cursource, int, SOURCE_DISK); 158 159 /* the current region */ 160 GLOBAL(nr, int, 0); 161 162 /* file for results */ 163 GLOBAL(resfp, FILE *, NULL); 164 165 /* format for saving data sets */ 166 GLOBALARR(sformat, char, 128, "%.8g"); 167 168 #ifdef HAVE_NETCDF 169 GLOBALARR(netcdf_name, char, 512, ""); 170 GLOBALARR(xvar_name, char, 128, ""); 171 GLOBALARR(yvar_name, char, 128, ""); 172 #endif 173 174 /* the safe mode flag */ 175 GLOBAL(safe_mode, int, TRUE); 176 177 #endif /* __GLOBALS_H_ */ 178