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