      1 /*
      2     Copyright 2008-2018
      3         Matthias Ehmann,
      4         Michael Gerhaeuser,
      5         Carsten Miller,
      6         Bianca Valentin,
      7         Alfred Wassermann,
      8         Peter Wilfahrt
      9
     10     This file is part of JSXGraph.
     11
     12     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
     13
     14     You can redistribute it and/or modify it under the terms of the
     15
     16       * GNU Lesser General Public License as published by
     17         the Free Software Foundation, either version 3 of the License, or
     18         (at your option) any later version
     19       OR
     20       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
     21
     22     JSXGraph is distributed in the hope that it will be useful,
     23     but WITHOUT ANY WARRANTY; without even the implied warranty of
     24     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     25     GNU Lesser General Public License for more details.
     26
     27     You should have received a copy of the GNU Lesser General Public License and
     28     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
     29     and <http://opensource.org/licenses/MIT/>.
     30  */
     31
     32
     33 /*global JXG: true, define: true*/
     34 /*jslint nomen: true, plusplus: true*/
     35
     36 /* depends:
     37  jxg
     38  */
     39
     40 define(['jxg'], function (JXG) {
     41
     42     "use strict";
     43
     44     var major = 0,
     45         minor = 99,
     46         patch = 7,
     47         add = 'dev', //false, // 'dev',
     48         version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
     49         constants;
     50
     51     constants = /** @lends JXG */ {
     52         // copyright, version, ...
     53
     54         /**
     55          * Represents the currently used JSXGraph version.
     56          * @type {String}
     57          */
     58         version: version,
     59
     60         /**
     61          * The small gray version indicator in the top left corner of every JSXGraph board (if
     62          * showCopyright is not set to false on board creation).
     63          * @type String
     64          */
     65         licenseText: 'JSXGraph v' + version + ' Copyright (C) see http://jsxgraph.org',
     66
     67         // coords
     68         COORDS_BY_USER: 0x0001,
     69         COORDS_BY_SCREEN: 0x0002,
     70
     71         // object types
     72         OBJECT_TYPE_ARC: 1,
     73         OBJECT_TYPE_ARROW: 2,
     74         OBJECT_TYPE_AXIS: 3,
     75         OBJECT_TYPE_AXISPOINT: 4,
     76         OBJECT_TYPE_TICKS: 5,
     77         OBJECT_TYPE_CIRCLE: 6,
     78         OBJECT_TYPE_CONIC: 7,
     79         OBJECT_TYPE_CURVE: 8,
     80         OBJECT_TYPE_GLIDER: 9,
     81         OBJECT_TYPE_IMAGE: 10,
     82         OBJECT_TYPE_LINE: 11,
     83         OBJECT_TYPE_POINT: 12,
     84         OBJECT_TYPE_SLIDER: 13,
     85         OBJECT_TYPE_CAS: 14,
     86         OBJECT_TYPE_GXTCAS: 15,
     87         OBJECT_TYPE_POLYGON: 16,
     88         OBJECT_TYPE_SECTOR: 17,
     89         OBJECT_TYPE_TEXT: 18,
     90         OBJECT_TYPE_ANGLE: 19,
     91         OBJECT_TYPE_INTERSECTION: 20,
     92         OBJECT_TYPE_TURTLE: 21,
     93         OBJECT_TYPE_VECTOR: 22,
     94         OBJECT_TYPE_OPROJECT: 23,
     95         OBJECT_TYPE_GRID: 24,
     96         OBJECT_TYPE_TANGENT: 25,
     97         OBJECT_TYPE_HTMLSLIDER: 26,
     98         OBJECT_TYPE_CHECKBOX: 27,
     99         OBJECT_TYPE_INPUT: 28,
    100         OBJECT_TYPE_BUTTON: 29,
    101         OBJECT_TYPE_TRANSFORMATION: 30,
    102
    103         // object classes
    104         OBJECT_CLASS_POINT: 1,
    105         OBJECT_CLASS_LINE: 2,
    106         OBJECT_CLASS_CIRCLE: 3,
    107         OBJECT_CLASS_CURVE: 4,
    108         OBJECT_CLASS_AREA: 5,
    109         OBJECT_CLASS_OTHER: 6,
    110         OBJECT_CLASS_TEXT: 7,
    111
    112         // SketchReader constants
    113         GENTYPE_ABC: 1, // unused
    114         GENTYPE_AXIS: 2,
    115         GENTYPE_MID: 3,
    116         GENTYPE_REFLECTION: 4,
    117         GENTYPE_MIRRORELEMENT: 5,
    118         GENTYPE_TANGENT: 6,
    119         GENTYPE_PARALLEL: 7,
    120         GENTYPE_BISECTORLINES: 8,
    121         GENTYPE_BOARDIMG: 9,
    122         GENTYPE_BISECTOR: 10,
    123         GENTYPE_NORMAL: 11,
    124         GENTYPE_POINT: 12,
    125         GENTYPE_GLIDER: 13,
    126         GENTYPE_INTERSECTION: 14,
    127         GENTYPE_CIRCLE: 15,
    128         GENTYPE_CIRCLE2POINTS: 16,
    129         GENTYPE_LINE: 17,
    130         GENTYPE_TRIANGLE: 18,
    131         GENTYPE_QUADRILATERAL: 19,
    132         GENTYPE_TEXT: 20,
    133         GENTYPE_POLYGON: 21,
    134         GENTYPE_REGULARPOLYGON: 22,
    135         GENTYPE_SECTOR: 23,
    136         GENTYPE_ANGLE: 24,
    137         GENTYPE_PLOT: 25,
    138         GENTYPE_SLIDER: 26,
    139         GENTYPE_TRUNCATE: 27,
    140         GENTYPE_JCODE: 28,
    141         GENTYPE_MOVEMENT: 29,
    142         GENTYPE_COMBINED: 30,
    143         GENTYPE_RULER: 31,
    144         GENTYPE_SLOPETRIANGLE: 32,
    145         GENTYPE_PERPSEGMENT: 33,
    146         GENTYPE_LABELMOVEMENT: 34,
    147         GENTYPE_VECTOR: 35,
    148         GENTYPE_NONREFLEXANGLE: 36,
    149         GENTYPE_REFLEXANGLE: 37,
    150         GENTYPE_PATH: 38,
    151         GENTYPE_DERIVATIVE: 39,
    152         // 40 // unused ...
    153         GENTYPE_DELETE: 41,
    154         GENTYPE_COPY: 42,
    155         GENTYPE_MIRROR: 43,
    156         GENTYPE_ROTATE: 44,
    157         GENTYPE_ABLATION: 45,
    158         GENTYPE_MIGRATE: 46,
    159         GENTYPE_VECTORCOPY: 47,
    160 //        GENTYPE_TRANSFORM: 48, // unused
    161         // 49 ... 50 // unused ...
    162
    163         // IMPORTANT:
    164         // ----------
    165         // For being able to differentiate between the (GUI-specific) CTX and
    166         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
    167         // to values > 50.
    168
    169         GENTYPE_CTX_TYPE_G: 51,
    170         GENTYPE_CTX_TYPE_P: 52,
    171         GENTYPE_CTX_TRACE: 53,
    172         GENTYPE_CTX_VISIBILITY: 54,
    173         GENTYPE_CTX_CCVISIBILITY: 55, // unused
    174         GENTYPE_CTX_MPVISIBILITY: 56,
    175         GENTYPE_CTX_WITHLABEL: 57,
    176         GENTYPE_CTX_LABEL: 58,
    177         GENTYPE_CTX_FIXED: 59,
    178         GENTYPE_CTX_STROKEWIDTH: 60,
    179         GENTYPE_CTX_LABELSIZE: 61,
    180         GENTYPE_CTX_SIZE: 62,
    181         GENTYPE_CTX_FACE: 63,
    182         GENTYPE_CTX_STRAIGHT: 64,
    183         GENTYPE_CTX_ARROW: 65,
    184         GENTYPE_CTX_COLOR: 66,
    185         GENTYPE_CTX_RADIUS: 67,
    186         GENTYPE_CTX_COORDS: 68,
    187         GENTYPE_CTX_TEXT: 69,
    188         GENTYPE_CTX_ANGLERADIUS: 70,
    189         GENTYPE_CTX_DOTVISIBILITY: 71,
    190         GENTYPE_CTX_FILLOPACITY: 72,
    191         GENTYPE_CTX_PLOT: 73,
    192         GENTYPE_CTX_SCALE: 74,
    193         GENTYPE_CTX_INTVAL: 75,
    194         GENTYPE_CTX_POINT1: 76,
    195         GENTYPE_CTX_POINT2: 77,
    196         GENTYPE_CTX_LABELSTICKY: 78,
    197         GENTYPE_CTX_TYPE_I: 79,
    198         GENTYPE_CTX_HASINNERPOINTS: 80,
    199         GENTYPE_CTX_SNAPWIDTH: 81,
    200         GENTYPE_CTX_SNAPTOGRID: 82
    201     };
    202
    203     JXG.extend(JXG, constants);
    204
    205     return constants;
    206 });
    207