1 /*
  2     Copyright 2008-2014
  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 = 3,
 47         add = 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 
102         // object classes
103         OBJECT_CLASS_POINT: 1,
104         OBJECT_CLASS_LINE: 2,
105         OBJECT_CLASS_CIRCLE: 3,
106         OBJECT_CLASS_CURVE: 4,
107         OBJECT_CLASS_AREA: 5,
108         OBJECT_CLASS_OTHER: 6,
109         OBJECT_CLASS_TEXT: 7,
110 
111         // SketchReader constants
112         GENTYPE_ABC: 1, // unused
113         GENTYPE_AXIS: 2,
114         GENTYPE_MID: 3,
115         GENTYPE_REFLECTION: 4,
116         GENTYPE_MIRRORPOINT: 5,
117         GENTYPE_TANGENT: 6,
118         GENTYPE_PARALLEL: 7,
119         GENTYPE_BISECTORLINES: 8,
120         GENTYPE_BOARDIMG: 9,
121         GENTYPE_BISECTOR: 10,
122         GENTYPE_NORMAL: 11,
123         GENTYPE_POINT: 12,
124         GENTYPE_GLIDER: 13,
125         GENTYPE_INTERSECTION: 14,
126         GENTYPE_CIRCLE: 15,
127         GENTYPE_CIRCLE2POINTS: 16,
128         GENTYPE_LINE: 17,
129         GENTYPE_TRIANGLE: 18,
130         GENTYPE_QUADRILATERAL: 19,
131         GENTYPE_TEXT: 20,
132         GENTYPE_POLYGON: 21,
133         GENTYPE_REGULARPOLYGON: 22,
134         GENTYPE_SECTOR: 23,
135         GENTYPE_ANGLE: 24,
136         GENTYPE_PLOT: 25,
137         GENTYPE_SLIDER: 26,
138         GENTYPE_TRUNCATE: 27,
139         GENTYPE_JCODE: 28,
140         GENTYPE_MOVEMENT: 29,
141         GENTYPE_COMBINED: 30,
142         GENTYPE_RULER: 31,
143         GENTYPE_SLOPETRIANGLE: 32,
144         GENTYPE_PERPSEGMENT: 33,
145         GENTYPE_LABELMOVEMENT: 34,
146         // 35 ... 39 // unused ...
147         GENTYPE_DELETE: 41,
148         GENTYPE_COPY: 42,
149         GENTYPE_MIRROR: 43,
150         GENTYPE_ROTATE: 44,
151         GENTYPE_ABLATION: 45,
152         GENTYPE_MIGRATE: 46,
153 //        GENTYPE_TRANSFORM: 47, // unused
154         // 48 ... 50 // unused ...
155 
156         // IMPORTANT:
157         // ----------
158         // For being able to differentiate between the (GUI-specific) CTX and
159         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
160         // to values > 50.
161 
162         GENTYPE_CTX_TYPE_G: 51,
163         GENTYPE_CTX_TYPE_P: 52,
164         GENTYPE_CTX_TRACE: 53,
165         GENTYPE_CTX_VISIBILITY: 54,
166         GENTYPE_CTX_CCVISIBILITY: 55, // unused
167         GENTYPE_CTX_MPVISIBILITY: 56,
168         GENTYPE_CTX_WITHLABEL: 57,
169         GENTYPE_CTX_LABEL: 58,
170         GENTYPE_CTX_FIXED: 59,
171         GENTYPE_CTX_STROKEWIDTH: 60,
172         GENTYPE_CTX_LABELSIZE: 61,
173         GENTYPE_CTX_SIZE: 62,
174         GENTYPE_CTX_FACE: 63,
175         GENTYPE_CTX_STRAIGHT: 64,
176         GENTYPE_CTX_ARROW: 65,
177         GENTYPE_CTX_COLOR: 66,
178         GENTYPE_CTX_RADIUS: 67,
179         GENTYPE_CTX_COORDS: 68,
180         GENTYPE_CTX_TEXT: 69,
181         GENTYPE_CTX_ANGLERADIUS: 70,
182         GENTYPE_CTX_DOTVISIBILITY: 71,
183         GENTYPE_CTX_FILLOPACITY: 72,
184         GENTYPE_CTX_PLOT: 73,
185         GENTYPE_CTX_SCALE: 74,
186         GENTYPE_CTX_INTVAL: 75,
187         GENTYPE_CTX_POINT1: 76,
188         GENTYPE_CTX_POINT2: 77,
189         GENTYPE_CTX_LABELSTICKY: 78,
190         GENTYPE_CTX_TYPE_I: 79,
191         GENTYPE_CTX_HASINNERPOINTS: 80,
192         GENTYPE_CTX_SNAPWIDTH: 81
193     };
194 
195     JXG.extend(JXG, constants);
196 
197     return constants;
198 });
199