1 // XDrawChem 2 // Copyright (C) 2004-2005 Bryan Herger <bherger@users.sourceforge.net> 3 // Copyright (C) 2020 Yaman Qalieh <ybq987@gmail.com> 4 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 15 // You should have received a copy of the GNU General Public License 16 // along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 #ifndef DEFS_H 19 #define DEFS_H 20 21 #include <QString> 22 23 // Ring directories (global, user) 24 extern QString RingDir, HomeDir; 25 26 const QString VERSION = QString::fromLatin1("1.11.0"); 27 28 // version string (makes updates easier :) 29 #ifdef UNIX 30 const QString XDC_VERSION = QString::fromLatin1("XDrawChem ") + VERSION; 31 #endif 32 33 #ifdef WIN32 34 const QString XDC_VERSION = QString::fromLatin1("WinDrawChem ") + VERSION; 35 #endif 36 37 #ifdef MACOSX 38 const QString XDC_VERSION = QString::fromLatin1("MacDrawChem ") + VERSION; 39 #endif 40 41 // define XDC_SERVER default URL 42 //#define XDC_SERVER "http://www.woodsidelabs.com/chemistry" 43 44 // units 45 #define PIXELS 0 46 #define ENGLISH 1 47 #define METRIC 2 48 49 // grid settings 50 #define GRID_NONE 0 51 #define GRID_SQUARE 1 52 #define GRID_HEX 2 53 54 // math constant 55 #define MOL_ARAD 57.29578 56 #ifndef M_PI // M_PI is usually defined on Unix, but not Windows 57 #define M_PI 3.14159246 58 #endif 59 60 // modes (int Render2D::mode) 61 #define MODE_SELECT 90 62 #define MODE_SELECT_LASSO 95 63 #define MODE_SELECT_MOVE_POINT 110 64 #define MODE_SELECT_MOVE_OBJECT 111 65 66 #define MODE_SELECT_MULTIPLE 120 67 #define MODE_SELECT_MULTIPLE_SELECTED 91 68 #define MODE_SELECT_MOVE_MULTIPLE 122 69 #define MODE_SELECT_MULTIPLE_RESIZE 123 70 #define MODE_SELECT_RESIZE_MULTIPLE 124 71 #define MODE_SELECT_MULTIPLE_ROTATE 125 72 #define MODE_SELECT_ROTATE_MULTIPLE 126 73 74 #define MODE_DRAWLINE 200 75 #define MODE_DRAWLINE_DRAWING 201 76 77 #define MODE_DRAWCHAIN 205 78 #define MODE_DRAWCHAIN_DRAWING 206 79 80 #define MODE_DRAWLINE_DASH 210 81 #define MODE_DRAWLINE_DASH_DRAWING 211 82 83 #define MODE_DRAWLINE_UP 220 84 #define MODE_DRAWLINE_UP_DRAWING 221 85 86 #define MODE_DRAWLINE_DOWN 240 87 #define MODE_DRAWLINE_DOWN_DRAWING 241 88 89 #define MODE_DRAWWAVYLINE 250 90 #define MODE_DRAWWAVYLINE_DRAWING 251 91 92 #define MODE_DRAWARROW 260 93 #define MODE_DRAWARROW_DRAWING 261 94 95 #define MODE_DRAWCURVEARROW 270 96 #define MODE_DRAWCURVEARROW_DRAWING 271 97 98 #define MODE_DRAWBRACKET 280 99 #define MODE_DRAWBRACKET_DRAWING 281 100 101 #define MODE_DRAWBEZIER 290 102 #define MODE_DRAWBEZIER_DRAWING 291 103 104 #define MODE_TEXT 298 105 106 #define MODE_ERASE 300 107 #define MODE_ERASING 301 108 109 #define MODE_SYMBOL 500 110 #define MODE_DRAWNEWMAN_ANTI 510 111 #define MODE_DRAWNEWMAN_GAUCHE 511 112 113 #define MODE_RING 550 114 115 #define MODE_TOOL 600 116 #define MODE_TOOL_CALCMW 601 117 #define MODE_TOOL_CALCEF 602 118 #define MODE_TOOL_13CNMR 603 119 #define MODE_TOOL_CALCEA 604 120 #define MODE_TOOL_1HNMR 605 121 #define MODE_TOOL_IR 606 122 #define MODE_TOOL_NAME 607 123 #define MODE_TOOL_TOSMILES 608 124 #define MODE_TOOL_FROMSMILES 609 125 #define MODE_TOOL_CLEANUPMOL 610 126 #define MODE_TOOL_MOLECULE_INFO 611 127 #define MODE_TOOL_GROUP_REACTANT 612 128 #define MODE_TOOL_GROUP_PRODUCT 613 129 #define MODE_TOOL_CUSTOMRING 614 130 #define MODE_TOOL_TOINCHI 615 131 #define MODE_TOOL_FROMINCHI 616 132 #define MODE_TOOL_GROUP_CLEAR 620 133 #define MODE_TOOL_2D3D 630 134 #define MODE_TOOL_PKA 640 135 #define MODE_TOOL_KOW 650 136 #define MODE_TOOL_RETRO 660 137 #define MODE_TOOL_RETRO_ATOMNAME 698 138 #define MODE_TOOL_RETRO_BONDNAME 699 139 140 // list (unique?) reactions/sites this molecule is susceptible to 141 #define MODE_TOOL_REACTIVITY_FORWARD 670 142 // list (unique?) sites that could have been created by known rxn's 143 #define MODE_TOOL_REACTIVITY_RETRO 671 144 // partial charges, maybe do colors, maybe base on AMBER or other FF 145 #define MODE_TOOL_CHARGES 672 146 147 #define MODE_TOOL_TEST 669 148 149 // reaction analysis 150 #define RXN_ENTHALPY_ESTIMATE 1 151 #define RXN_1HNMR 2 152 #define RXN_13CNMR 3 153 #define RXN_TEST 69 154 155 // types (Drawable::Type() and subclasses) 156 #define TYPE_DRAWABLE 0 157 #define TYPE_MOLECULE 1 158 #define TYPE_BOND 10 159 #define TYPE_TEXT 11 160 #define TYPE_ARROW 12 161 #define TYPE_BRACKET 13 162 #define TYPE_SYMBOL 14 163 #define TYPE_CURVEARROW 15 164 #define TYPE_BEZIER 16 165 #define TYPE_BIOTOOLS 20 166 #define TYPE_GRAPHIC_OBJECT 99 167 #define TYPE_GRAPHIC_LINE 100 168 #define TYPE_GRAPHIC_ATOMMARK 101 169 #define TYPE_GRAPHIC_BONDMARK 102 170 171 // bond stereochemistry (Bond::stereo) 172 #define STEREO_UNDEFINED 0 173 #define STEREO_UP 1 174 #define STEREO_DOWN 2 175 #define STEREO_E 3 176 #define STEREO_Z 4 177 178 enum bracketType { 179 squareBracket = 0, 180 curveBracket, 181 braceBracket, 182 boxBracket, 183 ellipseBracket, 184 closedsquareBracket, 185 circleBracket 186 }; 187 188 // bracket types (Bracket::style) 189 #define BRACKET_SQUARE 1 190 #define BRACKET_CURVE 2 191 #define BRACKET_BRACE 3 192 #define BRACKET_BOX 4 193 #define BRACKET_ELLIPSE 5 194 #define BRACKET_CLOSEDSQUARE 6 195 #define BRACKET_CIRCLE 7 196 #define BRACKET_BOX_SHADOW 8 197 #define BRACKET_ELLIPSE_SHADOW 9 198 #define BRACKET_SQUARE_SHADOW 10 199 #define BRACKET_CIRCLE_SHADOW 11 200 201 enum regularArrowType { 202 regularArrow = 0, 203 topharpoonArrow, 204 bottomharpoonArrow, 205 middleArrow, 206 didntworkArrow, 207 dashedArrow, 208 bi1Arrow, 209 bi2Arrow, 210 retroArrow 211 }; 212 213 // arrow styles (Arrow::style) 214 #define ARROW_REGULAR 1 215 #define ARROW_DIDNT_WORK 69 216 #define ARROW_DASH 2 217 #define ARROW_BI1 3 218 #define ARROW_BI2 4 219 #define ARROW_RETRO 5 220 #define ARROW_TOPHARPOON 6 221 #define ARROW_BOTTOMHARPOON 7 222 #define ARROW_MIDDLE 8 223 224 enum curveArrowType { 225 cw90Arrow = 0, 226 ccw90Arrow, 227 cw180Arrow, 228 ccw180Arrow, 229 cw270Arrow, 230 ccw270Arrow, 231 bezierArrow, 232 bezierhalfArrow, 233 bezierfullArrow 234 }; 235 236 // curve arrow styles 237 #define CA_CW90 1 238 #define CA_CW180 2 239 #define CA_CW270 3 240 #define CA_CCW90 4 241 #define CA_CCW180 5 242 #define CA_CCW270 6 243 244 enum symbolType { 245 symbolPlus = 0, 246 symbolMinus, 247 symbolDeltaPlus, 248 symbolDeltaMinus, 249 symbol1E, 250 symbol2E, 251 symbol2ELine, 252 symbolRingUp, 253 symbolPOrbital, 254 symbolPDouble, 255 symbolBead 256 }; 257 258 // symbol styles 259 #define SYM_PLUS 1 260 #define SYM_MINUS 2 261 #define SYM_DELTA_PLUS 3 262 #define SYM_DELTA_MINUS 4 263 #define SYM_2E 5 264 #define SYM_1E 6 265 #define SYM_RING_UP 7 266 #define SYM_P_ORBITAL 8 267 #define SYM_BEAD 9 268 #define SYM_P_DOUBLE 10 269 #define SYM_2E_LINE 11 270 271 // justification flags (Text::justify) 272 #define JUSTIFY_CENTER 1 273 #define JUSTIFY_TOPLEFT 2 274 275 // Sides (Text::NearestCenter) 276 #define TEXT_LEFT 1 277 #define TEXT_RIGHT 2 278 #define TEXT_TOP 3 279 #define TEXT_BOTTOM 4 280 281 // data held in text (Text::DataType) 282 #define TEXT_DATA_NORMAL 1 283 #define TEXT_DATA_MW 2 284 #define TEXT_DATA_FORMULA 3 285 286 // Text shape styles (Text::shape) 287 #define TEXT_SHAPE_NONE 0 288 #define TEXT_SHAPE_ELLIPSE 1 289 #define TEXT_SHAPE_RECTANGLE 2 290 #define TEXT_SHAPE_CIRCLE 3 291 #define TEXT_SHAPE_SQUARE 4 292 293 // Horizontal or vertical arrow (Arrow::Orientation) 294 #define ARROW_HORIZONTAL 1 295 #define ARROW_VERTICAL 2 296 297 // Flip direction 298 #define FLIP_H 1 299 #define FLIP_V 2 300 301 // Group types (Molecule::group_type) 302 #define GROUP_NONE 0 303 #define GROUP_REACTANT 1 304 #define GROUP_PRODUCT 2 305 #define GROUP_SOLVENT 3 306 #define GROUP_CATALYST 4 307 308 // output devices 309 #define OUTPUT_SCREEN 1 310 #define OUTPUT_IMAGE 2 311 #define OUTPUT_PRINTER 3 312 #define OUTPUT_EPS 4 313 314 // Paintable::op Operation types 315 /* OBSOLETE 316 #define OP_LINE 1 317 #define OP_DASH_LINE 2 318 #define OP_TEXT 3 319 #define OP_STRING 100 320 #define OP_CURVE_CW90 4 321 #define OP_CURVE_CCW90 5 322 #define OP_CURVE_CW180 6 323 #define OP_CURVE_CCW180 7 324 #define OP_CURVE_CW270 8 325 #define OP_CURVE_CCW270 9 326 #define OP_PIXMAP 10 327 #define OP_FILLBOX 11 328 #define OP_UP_LINE 12 329 */ 330 331 // page setup 332 #define PAGE_LETTER 1 333 #define PAGE_LEGAL 2 334 #define PAGE_A4 3 335 #define PAGE_640 4 336 #define PAGE_800 5 337 #define PAGE_1024 6 338 #define PAGE_CUSTOM 7 339 #define PAGE_PORTRAIT 100 340 #define PAGE_LANDSCAPE 200 341 342 // CML stuff 343 // track what tag(s) we're in (private int CMLParser::states) 344 #define CML_MOLECULE 10 345 #define CML_NONE 1 346 #define CML_ATOM 2 347 #define CML_BOND 3 348 #define CML_ATOMARRAY 4 349 #define CML_BONDARRAY 5 350 #define CDXML_COLORTABLE 100 351 #define CDXML_FONTTABLE 101 352 #define CDXML_PAGE 102 353 #define CDXML_FRAGMENT 103 354 #define CDXML_NODE 104 355 #define CDXML_BOND 105 356 #define CDXML_GRAPHIC 106 357 #define CDXML_TEXT 107 358 359 #endif // ifndef DEFS_H 360