~ubuntu-branches/ubuntu/saucy/mapserver/saucy-security

« back to all changes in this revision

Viewing changes to .pc/symbol_index_overflow/mapserver.h

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-12-23 14:02:06 UTC
  • mfrom: (26.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111223140206-n3h9t2hsa8hyslmu
Tags: 6.0.1-2
Added missed stuff for libmapscript-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/******************************************************************************
2
 
 * $Id: mapserver.h 10867 2011-01-14 14:56:21Z dmorissette $
3
 
 *
4
 
 * Project:  MapServer
5
 
 * Purpose:  Primary MapServer include file.
6
 
 * Author:   Steve Lime and the MapServer team.
7
 
 *
8
 
 ******************************************************************************
9
 
 * Copyright (c) 1996-2005 Regents of the University of Minnesota.
10
 
 *
11
 
 * Permission is hereby granted, free of charge, to any person obtaining a
12
 
 * copy of this software and associated documentation files (the "Software"),
13
 
 * to deal in the Software without restriction, including without limitation
14
 
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
 
 * and/or sell copies of the Software, and to permit persons to whom the
16
 
 * Software is furnished to do so, subject to the following conditions:
17
 
 *
18
 
 * The above copyright notice and this permission notice shall be included in 
19
 
 * all copies of this Software or works derived from this Software.
20
 
 *
21
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22
 
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
 
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
 
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
 
 * DEALINGS IN THE SOFTWARE.
28
 
 *****************************************************************************/
29
 
 
30
 
#ifndef MAP_H
31
 
#define MAP_H
32
 
 
33
 
/*
34
 
** MapServer version - to be updated for every release 
35
 
*/
36
 
#define MS_VERSION "5.6.6"
37
 
 
38
 
#define MS_VERSION_MAJOR    5
39
 
#define MS_VERSION_MINOR    6
40
 
#define MS_VERSION_REV      6
41
 
 
42
 
#define MS_VERSION_NUM (MS_VERSION_MAJOR*10000+MS_VERSION_MINOR*100+MS_VERSION_REV)
43
 
 
44
 
 
45
 
/* 
46
 
** Main includes. If a particular header was needed by several .c files then
47
 
** I just put it here. What the hell, it works and it's all right here. -SDL-
48
 
*/
49
 
#include <stdio.h>
50
 
#include <stdlib.h>
51
 
#include <string.h>
52
 
#include <math.h>
53
 
 
54
 
#if defined(_WIN32) && !defined(__CYGWIN__)
55
 
#include <direct.h>
56
 
#include <memory.h>
57
 
#include <malloc.h>
58
 
#include <process.h>
59
 
#include <float.h>
60
 
#else
61
 
#include <unistd.h>
62
 
#endif
63
 
 
64
 
#ifndef DISABLE_CVSID
65
 
#  define MS_CVSID(string)     static char ms_cvsid[] = string; \
66
 
static char *cvsid_aw(void) { return( cvsid_aw() ? ((char *) NULL) : ms_cvsid ); }
67
 
#else
68
 
#  define MS_CVSID(string)
69
 
#endif
70
 
 
71
 
#if defined(_WIN32) && !defined(__CYGWIN__)
72
 
#  define MS_DLL_EXPORT     __declspec(dllexport)
73
 
#else
74
 
#define  MS_DLL_EXPORT
75
 
#endif
76
 
 
77
 
/* definition of  ms_int32/ms_uint32 */
78
 
#include <limits.h>
79
 
#ifndef _WIN32
80
 
#include <stdint.h>
81
 
#endif
82
 
 
83
 
#ifdef _WIN32
84
 
#ifndef SIZE_MAX
85
 
#ifdef _WIN64 
86
 
#define SIZE_MAX _UI64_MAX
87
 
#else
88
 
#define SIZE_MAX UINT_MAX
89
 
#endif
90
 
#endif
91
 
#endif
92
 
 
93
 
#if ULONG_MAX == 0xffffffff
94
 
typedef long            ms_int32;
95
 
typedef unsigned long   ms_uint32;
96
 
#elif UINT_MAX == 0xffffffff
97
 
typedef int             ms_int32;
98
 
typedef unsigned int    ms_uint32;
99
 
#else
100
 
typedef int32_t         ms_int32;
101
 
typedef uint32_t        ms_uint32;
102
 
#endif
103
 
 
104
 
/*forward declaration of rendering object*/
105
 
struct rendererVTable;
106
 
struct tilecache;
107
 
typedef struct rendererVTable rendererVTableObj;
108
 
typedef struct tilecache tileCacheObj;
109
 
 
110
 
 
111
 
 
112
 
/* ms_bitarray is used by the bit mask in mapbit.c */
113
 
typedef ms_uint32 *     ms_bitarray;
114
 
 
115
 
#include "maperror.h"
116
 
#include "mapprimitive.h"
117
 
#include "mapshape.h"
118
 
#include "mapsymbol.h"
119
 
#include "maptree.h" /* quadtree spatial index */
120
 
#include "maphash.h"
121
 
#include "mapio.h"
122
 
 
123
 
#include "mapproject.h"
124
 
#include "cgiutil.h"
125
 
 
126
 
 
127
 
#include <gd.h>
128
 
 
129
 
#if defined USE_PDF
130
 
#include <pdflib.h>
131
 
#endif
132
 
 
133
 
 
134
 
#include <sys/types.h> /* regular expression support */
135
 
 
136
 
/* The regex lib from the system and the regex lib from PHP needs to
137
 
 * be separated here. We separate here via its directory location.
138
 
 */
139
 
#include "mapregex.h"
140
 
 
141
 
 
142
 
#ifdef USE_OGR
143
 
#define CPL_SUPRESS_CPLUSPLUS
144
 
#include "ogr_api.h"
145
 
#endif
146
 
 
147
 
 
148
 
#if defined(_WIN32) && !defined(__CYGWIN__)
149
 
#define snprintf _snprintf
150
 
#endif
151
 
 
152
 
#ifdef __cplusplus
153
 
extern "C" {
154
 
#endif
155
 
 
156
 
/* General defines, wrapable */
157
 
 
158
 
#define MS_TRUE 1 /* logical control variables */
159
 
#define MS_FALSE 0
160
 
#define MS_UNKNOWN -1
161
 
#define MS_ON 1
162
 
#define MS_OFF 0
163
 
#define MS_DEFAULT 2
164
 
#define MS_EMBED 3
165
 
#define MS_DELETE 4
166
 
#define MS_YES 1
167
 
#define MS_NO 0
168
 
 
169
 
/* For layer transparency, allows alpha transparent pixmaps to be used
170
 
   with RGB map images */
171
 
#define MS_GD_ALPHA 1000
172
 
 
173
 
/* Number of layer, class and style ptrs to alloc at once in the 
174
 
   corresponding msGrow...() functions. Replaces former MS_MAXLAYERS, 
175
 
   MS_MAXCLASSES and MS_MAXSTYLES with dynamic allocation (see RFC-17). */
176
 
#define MS_LAYER_ALLOCSIZE 64
177
 
#define MS_CLASS_ALLOCSIZE 8
178
 
#define MS_STYLE_ALLOCSIZE 4
179
 
 
180
 
#define MS_MAX_LABEL_PRIORITY     10
181
 
#define MS_DEFAULT_LABEL_PRIORITY 1
182
 
 
183
 
/* General defines, not wrapable */
184
 
#ifndef SWIG
185
 
#define MS_DEFAULT_MAPFILE_PATTERN "\\.map$"
186
 
 
187
 
#define MS_TEMPLATE_MAGIC_STRING "MapServer Template"
188
 
#define MS_TEMPLATE_EXPR "\\.(xml|wml|html|htm|svg|kml|gml|js|tmpl)$"
189
 
 
190
 
#define MS_INDEX_EXTENSION ".qix"
191
 
 
192
 
#define MS_QUERY_MAGIC_STRING "MapServer Query"
193
 
#define MS_QUERY_EXTENSION ".qy"
194
 
 
195
 
#define MS_DEG_TO_RAD .0174532925199432958
196
 
#define MS_RAD_TO_DEG   57.29577951
197
 
 
198
 
#define MS_RED 0
199
 
#define MS_GREEN 1
200
 
#define MS_BLUE 2
201
 
 
202
 
#define MS_MAXCOLORS 256
203
 
 
204
 
#define MS_MISSING_DATA_IGNORE 0
205
 
#define MS_MISSING_DATA_FAIL 1
206
 
#define MS_MISSING_DATA_LOG 2
207
 
 
208
 
#define MS_BUFFER_LENGTH 2048 /* maximum input line length */
209
 
#define MS_URL_LENGTH 1024
210
 
#define MS_MAXPATHLEN 1024
211
 
 
212
 
#define MS_MAXIMAGESIZE_DEFAULT 2048
213
 
 
214
 
#define MS_MAXPROJARGS 20
215
 
#define MS_MAXJOINS 20
216
 
#define MS_ITEMNAMELEN 32
217
 
#define MS_NAMELEN 20
218
 
 
219
 
#define MS_MINSYMBOLSIZE 0   /* in pixels */
220
 
#define MS_MAXSYMBOLSIZE 500
221
 
 
222
 
#define MS_MINSYMBOLWIDTH 0   /* in pixels */
223
 
#define MS_MAXSYMBOLWIDTH 32
224
 
 
225
 
#define MS_URL 0 /* template types */
226
 
#define MS_FILE 1
227
 
 
228
 
#define MS_MINFONTSIZE 4
229
 
#define MS_MAXFONTSIZE 256
230
 
 
231
 
#define MS_LABELCACHEINITSIZE 100
232
 
#define MS_LABELCACHEINCREMENT 10
233
 
 
234
 
#define MS_RESULTCACHEINITSIZE 10
235
 
#define MS_RESULTCACHEINCREMENT 10
236
 
 
237
 
#define MS_FEATUREINITSIZE 10 /* how many points initially can a feature have */
238
 
#define MS_FEATUREINCREMENT 10
239
 
 
240
 
#define MS_EXPRESSION 2000 /* todo: make this an enum */
241
 
#define MS_REGEX 2001
242
 
#define MS_STRING 2002
243
 
#define MS_NUMBER 2003
244
 
#define MS_COMMENT 2004
245
 
#define MS_IREGEX 2005
246
 
#define MS_ISTRING 2006
247
 
#define MS_BINDING 2007
248
 
 
249
 
/* boolean options for the expression object. */
250
 
#define MS_EXP_INSENSITIVE 1
251
 
 
252
 
/* General macro definitions */
253
 
#define MS_MIN(a,b) (((a)<(b))?(a):(b))
254
 
#define MS_MAX(a,b) (((a)>(b))?(a):(b))
255
 
#define MS_ABS(a) (((a)<0) ? -(a) : (a))
256
 
#define MS_SGN(a) (((a)<0) ? -1 : 1)
257
 
 
258
 
#define MS_NINT_GENERIC(x) ((x) >= 0.0 ? ((long) ((x)+.5)) : ((long) ((x)-.5)))
259
 
 
260
 
#ifdef _MSC_VER
261
 
#define msIsNan(x) _isnan(x)
262
 
#else
263
 
#define msIsNan(x) isnan(x)
264
 
#endif
265
 
 
266
 
/* see http://mega-nerd.com/FPcast/ for some discussion of fast
267
 
   conversion to nearest int.  We avoid lrint() for now because it
268
 
   would be hard to include math.h "properly". */
269
 
 
270
 
#if defined(WE_HAVE_THE_C99_LRINT) && !defined(USE_GENERIC_MS_NINT)
271
 
#   define MS_NINT(x) lrint(x)
272
 
/*#   define MS_NINT(x) lround(x) */
273
 
#elif defined(_MSC_VER) && defined(_WIN32) && !defined(USE_GENERIC_MS_NINT)
274
 
    static __inline long int MS_NINT (double flt) 
275
 
    {   int intgr;
276
 
  
277
 
    _asm
278
 
        {       fld flt
279
 
                    fistp intgr
280
 
                    } ;
281
 
                        
282
 
    return intgr ;
283
 
    } 
284
 
#elif defined(i386) && defined(__GNUC_PREREQ) && !defined(USE_GENERIC_MS_NINT)
285
 
    static __inline long int MS_NINT( double __x ) 
286
 
    {
287
 
        long int __lrintres;                                                        
288
 
        __asm__ __volatile__                                                        
289
 
          ("fistpl %0"                                                              
290
 
           : "=m" (__lrintres) : "t" (__x) : "st");                                 
291
 
        return __lrintres;
292
 
    }
293
 
#else
294
 
#  define MS_NINT(x)      MS_NINT_GENERIC(x)
295
 
#endif
296
 
 
297
 
 
298
 
#define MS_PEN_TRANSPARENT -1
299
 
#define MS_PEN_UNSET     -4
300
 
 
301
 
/* #define MS_VALID_EXTENT(minx, miny, maxx, maxy)  (((minx<maxx) && (miny<maxy))?MS_TRUE:MS_FALSE) */
302
 
#define MS_VALID_EXTENT(rect)  (((rect.minx < rect.maxx && rect.miny < rect.maxy))?MS_TRUE:MS_FALSE)
303
 
 
304
 
#define MS_INIT_COLOR(color,r,g,b) { (color).red = r; (color).green = g; (color).blue = b; (color).pen = MS_PEN_UNSET; }
305
 
#define MS_VALID_COLOR(color) (((color).red==-1 || (color).green==-1 || (color).blue==-1)?MS_FALSE:MS_TRUE)
306
 
#define MS_TRANSPARENT_COLOR(color) (((color).red==-255 || (color).green==-255 || (color).blue==-255)?MS_TRUE:MS_FALSE)
307
 
#define MS_COMPARE_COLORS(a,b) (((a).red!=(b).red || (a).green!=(b).green || (a).blue!=(b).blue)?MS_FALSE:MS_TRUE)
308
 
#define MS_COLOR_GETRGB(color) (MS_VALID_COLOR(color)?((color).red *0x10000 + (color).green *0x100 + (color).blue):-1)
309
 
 
310
 
#define MS_IMAGE_MIME_TYPE(format) (format->mimetype ? format->mimetype : "unknown")
311
 
#define MS_IMAGE_EXTENSION(format)  (format->extension ? format->extension : "unknown")
312
 
 
313
 
#define MS_DRIVER_GD(format)  (strncasecmp((format)->driver,"gd/",3)==0)
314
 
#define MS_DRIVER_SWF(format) (strncasecmp((format)->driver,"swf",3)==0)
315
 
#define MS_DRIVER_GDAL(format)  (strncasecmp((format)->driver,"gdal/",5)==0)
316
 
#define MS_DRIVER_PDF(format) (strncasecmp((format)->driver,"pdf",3)==0)
317
 
#define MS_DRIVER_IMAGEMAP(format)  (strncasecmp((format)->driver,"imagemap",8)==0)
318
 
#define MS_DRIVER_SVG(format) (strncasecmp((format)->driver,"svg",3)==0)
319
 
#define MS_DRIVER_AGG(format) (strncasecmp((format)->driver,"agg/",4)==0)
320
 
#define MS_DRIVER_CAIRO(format) (strncasecmp((format)->driver,"cairo/",6)==0)
321
 
#define MS_DRIVER_OGL(format) (strncasecmp((format)->driver,"ogl/",4)==0)
322
 
#define MS_DRIVER_TEMPLATE(format) (strncasecmp((format)->driver,"template",8)==0)
323
 
 
324
 
#define MS_RENDER_WITH_GD       1
325
 
#define MS_RENDER_WITH_SWF      2
326
 
#define MS_RENDER_WITH_RAWDATA  3
327
 
#define MS_RENDER_WITH_PDF      4
328
 
#define MS_RENDER_WITH_IMAGEMAP 5
329
 
#define MS_RENDER_WITH_SVG      6
330
 
#define MS_RENDER_WITH_AGG      7
331
 
#define MS_RENDER_WITH_TEMPLATE 8 /* query results only */
332
 
#define MS_RENDER_WITH_CAIRO_RASTER   9
333
 
#define MS_RENDER_WITH_CAIRO_PDF 10
334
 
#define MS_RENDER_WITH_CAIRO_SVG 11
335
 
#define MS_RENDER_WITH_OGL      12
336
 
 
337
 
#define MS_RENDERER_GD(format)  ((format)->renderer == MS_RENDER_WITH_GD)
338
 
#define MS_RENDERER_SWF(format) ((format)->renderer == MS_RENDER_WITH_SWF)
339
 
#define MS_RENDERER_RAWDATA(format) ((format)->renderer == MS_RENDER_WITH_RAWDATA)
340
 
#define MS_RENDERER_PDF(format) ((format)->renderer == MS_RENDER_WITH_PDF)
341
 
#define MS_RENDERER_IMAGEMAP(format) ((format)->renderer == MS_RENDER_WITH_IMAGEMAP)
342
 
#define MS_RENDERER_SVG(format) ((format)->renderer == MS_RENDER_WITH_SVG)
343
 
#define MS_RENDERER_AGG(format) ((format)->renderer == MS_RENDER_WITH_AGG)
344
 
#define MS_RENDERER_PLUGIN(format) ((format)->renderer >= MS_RENDER_WITH_CAIRO_RASTER)
345
 
#define MS_RENDERER_TEMPLATE(format) ((format)->renderer == MS_RENDER_WITH_TEMPLATE)
346
 
 
347
 
#define MS_CELLSIZE(min,max,d) ((max - min)/(d-1)) /* where min/max are from an MapServer pixel center-to-pixel center extent */
348
 
#define MS_OWS_CELLSIZE(min,max,d) ((max - min)/d) /* where min/max are from an OGC pixel outside edge-to-pixel outside edge extent */
349
 
#define MS_MAP2IMAGE_X(x,minx,cx) (MS_NINT((x - minx)/cx))
350
 
#define MS_MAP2IMAGE_Y(y,maxy,cy) (MS_NINT((maxy - y)/cy))
351
 
#define MS_IMAGE2MAP_X(x,minx,cx) (minx + cx*x)
352
 
#define MS_IMAGE2MAP_Y(y,maxy,cy) (maxy - cy*y)
353
 
 
354
 
/* this version of MS_MAP2IMAGE takes 1/cellsize and is much faster */
355
 
#define MS_MAP2IMAGE_X_IC(x,minx,icx) (MS_NINT((x - minx)*icx))
356
 
#define MS_MAP2IMAGE_Y_IC(y,maxy,icy) (MS_NINT((maxy - y)*icy))
357
 
 
358
 
#define MS_MAP2IMAGE_X_IC_DBL(x,minx,icx) ((x - minx)*icx)
359
 
#define MS_MAP2IMAGE_Y_IC_DBL(y,maxy,icy) ((maxy - y)*icy)
360
 
 
361
 
/* For CARTO symbols */
362
 
#define MS_PI    3.14159265358979323846
363
 
#define MS_PI2   1.57079632679489661923  /* (MS_PI / 2) */
364
 
#define MS_3PI2  4.71238898038468985769  /* (3 * MS_PI2) */
365
 
#define MS_2PI   6.28318530717958647693  /* (2 * MS_PI) */
366
 
 
367
 
#define MS_ENCRYPTION_KEY_SIZE  16   /* Key size: 128 bits = 16 bytes */
368
 
 
369
 
#define GET_LAYER(map, pos) map->layers[pos]
370
 
#define MS_REFCNT_INCR(obj) obj->refcount++
371
 
#define MS_REFCNT_DECR(obj) (--(obj->refcount))
372
 
#define MS_REFCNT_INIT(obj) obj->refcount=1
373
 
#define MS_REFCNT_DECR_IS_NOT_ZERO(obj) (MS_REFCNT_DECR(obj))>0
374
 
#define MS_REFCNT_DECR_IS_ZERO(obj) (MS_REFCNT_DECR(obj))<=0
375
 
 
376
 
#endif
377
 
 
378
 
/* General enumerated types - needed by scripts */
379
 
enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL};
380
 
enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_PERCENTAGES, MS_NAUTICALMILES};
381
 
enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL};
382
 
enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART};
383
 
enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP};
384
 
 
385
 
#define MS_POSITIONS_LENGTH 12
386
 
enum MS_POSITIONS_ENUM {MS_UL=101, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY, MS_FOLLOW}; /* Added MS_FOLLOW for bug #1620 implementation. */
387
 
 
388
 
enum MS_BITMAP_FONT_SIZES {MS_TINY , MS_SMALL, MS_MEDIUM, MS_LARGE, MS_GIANT};
389
 
enum MS_QUERYMAP_STYLES {MS_NORMAL, MS_HILITE, MS_SELECTED};
390
 
enum MS_CONNECTION_TYPE {MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_SDE, MS_OGR, MS_UNUSED_1, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYGIS, MS_RASTER, MS_PLUGIN };
391
 
enum MS_JOIN_CONNECTION_TYPE {MS_DB_XBASE, MS_DB_CSV, MS_DB_MYSQL, MS_DB_ORACLE, MS_DB_POSTGRES};
392
 
enum MS_JOIN_TYPE {MS_JOIN_ONE_TO_ONE, MS_JOIN_ONE_TO_MANY};
393
 
 
394
 
#define MS_SINGLE 0 /* modes for searching (spatial/database) */
395
 
#define MS_MULTIPLE 1
396
 
 
397
 
enum MS_QUERY_MODE {MS_QUERY_SINGLE, MS_QUERY_MULTIPLE};
398
 
enum MS_QUERY_TYPE {MS_QUERY_IS_NULL, MS_QUERY_BY_POINT, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_ATTRIBUTE, MS_QUERY_BY_INDEX, MS_QUERY_BY_OPERATOR};
399
 
 
400
 
enum MS_ALIGN_VALUE {MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT}; 
401
 
 
402
 
enum MS_CAPS_JOINS_AND_CORNERS {MS_CJC_NONE, MS_CJC_BEVEL, MS_CJC_BUTT, MS_CJC_MITER, MS_CJC_ROUND, MS_CJC_SQUARE, MS_CJC_TRIANGLE}; 
403
 
enum MS_RETURN_VALUE {MS_SUCCESS, MS_FAILURE, MS_DONE};
404
 
enum MS_IMAGEMODE { MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA, MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE, MS_IMAGEMODE_NULL };
405
 
 
406
 
enum MS_GEOS_OPERATOR {MS_GEOS_EQUALS, MS_GEOS_DISJOINT, MS_GEOS_TOUCHES, MS_GEOS_OVERLAPS, MS_GEOS_CROSSES, MS_GEOS_INTERSECTS, MS_GEOS_WITHIN, MS_GEOS_CONTAINS, MS_GEOS_BEYOND, MS_GEOS_DWITHIN};
407
 
#define MS_FILE_DEFAULT MS_FILE_MAP   
408
 
 
409
 
#ifndef SWIG
410
 
/* Filter object */    
411
 
typedef enum 
412
 
{
413
 
    FILTER_NODE_TYPE_UNDEFINED = -1,
414
 
    FILTER_NODE_TYPE_LOGICAL = 0,
415
 
    FILTER_NODE_TYPE_SPATIAL = 1,
416
 
    FILTER_NODE_TYPE_COMPARISON = 2,
417
 
    FILTER_NODE_TYPE_PROPERTYNAME = 3,
418
 
    FILTER_NODE_TYPE_BBOX = 4,
419
 
    FILTER_NODE_TYPE_LITERAL = 5,
420
 
    FILTER_NODE_TYPE_BOUNDARY = 6,
421
 
    FILTER_NODE_TYPE_GEOMETRY_POINT = 7,
422
 
    FILTER_NODE_TYPE_GEOMETRY_LINE = 8,
423
 
    FILTER_NODE_TYPE_GEOMETRY_POLYGON = 9,
424
 
    FILTER_NODE_TYPE_FEATUREID = 10
425
 
} FilterNodeType;
426
 
 
427
 
 
428
 
/************************************************************************/
429
 
/*                          FilterEncodingNode                          */
430
 
/************************************************************************/
431
 
 
432
 
typedef struct _FilterNode
433
 
{
434
 
    FilterNodeType      eType;
435
 
    char                *pszValue;
436
 
    void                *pOther;
437
 
    char                *pszSRS;
438
 
    struct _FilterNode  *psLeftNode;
439
 
    struct _FilterNode  *psRightNode;
440
 
} FilterEncodingNode;
441
 
 
442
 
/************************************************************************/
443
 
/*                             labelPathObj                             */
444
 
/*                                                                      */
445
 
/*      Label path object - used to hold path and bounds of curved      */
446
 
/*      labels - Bug #1620 implementation.                              */
447
 
/************************************************************************/
448
 
 
449
 
typedef struct {
450
 
  multipointObj path;
451
 
  shapeObj bounds;
452
 
  double *angles;
453
 
} labelPathObj;
454
 
#endif /*SWIG*/
455
 
 
456
 
/************************************************************************/
457
 
/*                              fontSetObj                              */
458
 
/*                                                                      */
459
 
/*      used to hold aliases for TRUETYPE fonts                         */
460
 
/************************************************************************/
461
 
 
462
 
typedef struct {
463
 
#ifdef SWIG
464
 
    %immutable;
465
 
#endif
466
 
    char *filename; 
467
 
    int numfonts;
468
 
    hashTableObj fonts;
469
 
#ifdef SWIG
470
 
    %mutable;
471
 
#endif
472
 
 
473
 
#ifndef SWIG
474
 
    struct map_obj *map;
475
 
#endif
476
 
} fontSetObj;
477
 
 
478
 
/************************************************************************/
479
 
/*                         featttureListNodeObj                         */
480
 
/*                                                                      */
481
 
/*      for inline features, shape caches and queries                   */
482
 
/************************************************************************/
483
 
#ifndef SWIG
484
 
typedef struct listNode {
485
 
    shapeObj shape;
486
 
    struct listNode *next;
487
 
    struct listNode *tailifhead; /* this is the tail node in the list, if this is the head element, otherwise NULL */
488
 
} featureListNodeObj;
489
 
 
490
 
typedef featureListNodeObj * featureListNodeObjPtr;
491
 
#endif
492
 
 
493
 
/************************************************************************/
494
 
/*                              paletteObj                              */
495
 
/*                                                                      */
496
 
/*      used to hold colors while a map file is read                    */
497
 
/************************************************************************/
498
 
#ifndef SWIG
499
 
typedef struct {
500
 
    colorObj colors[MS_MAXCOLORS-1];
501
 
    int      colorvalue[MS_MAXCOLORS-1];
502
 
    int numcolors;
503
 
} paletteObj;
504
 
#endif
505
 
 
506
 
/************************************************************************/
507
 
/*                            expressionObj                             */
508
 
/************************************************************************/
509
 
 
510
 
#ifndef SWIG
511
 
typedef struct {
512
 
    char *string;
513
 
    int type;
514
 
    /* container for expression options such as case-insensitiveness */
515
 
    /* This is a boolean container. */
516
 
    int flags;
517
 
    
518
 
    /* logical expression options */
519
 
    char **items;
520
 
    int *indexes;
521
 
    int numitems;
522
 
    
523
 
    /* regular expression options */
524
 
    ms_regex_t regex; /* compiled regular expression to be matched */
525
 
    int compiled;
526
 
} expressionObj;
527
 
#endif
528
 
 
529
 
/************************************************************************/
530
 
/*                               joinObj                                */
531
 
/*                                                                      */
532
 
/*      simple way to access other XBase files, one-to-one or           */
533
 
/*      one-to-many supported                                           */
534
 
/************************************************************************/
535
 
 
536
 
#ifndef SWIG
537
 
typedef struct {
538
 
    char *name;
539
 
    char **items, **values; /* items/values (process 1 record at a time) */
540
 
    int numitems;
541
 
    
542
 
    char *table;
543
 
    char *from, *to; /* item names */
544
 
    
545
 
    void *joininfo; /* vendor specific (i.e. XBase, MySQL, etc.) stuff to allow for persistant access */
546
 
    
547
 
    char *header, *footer;
548
 
#ifndef __cplusplus
549
 
    char *template;
550
 
#else
551
 
    char *_template;
552
 
#endif
553
 
    
554
 
    enum MS_JOIN_TYPE type;
555
 
    char *connection;
556
 
    enum MS_JOIN_CONNECTION_TYPE connectiontype;
557
 
} joinObj;
558
 
#endif
559
 
 
560
 
/************************************************************************/
561
 
/*                           outputFormatObj                            */
562
 
/*                                                                      */
563
 
/*      see mapoutput.c for most related code.                          */
564
 
/************************************************************************/
565
 
 
566
 
typedef struct {
567
 
    char *name;
568
 
    char *mimetype;
569
 
    char *driver;
570
 
    char *extension;
571
 
    int  renderer;  /* MS_RENDER_WITH_* */
572
 
    int  imagemode; /* MS_IMAGEMODE_* value. */
573
 
    int  transparent;
574
 
    int  bands;
575
 
    int  numformatoptions;
576
 
    char **formatoptions;
577
 
    int  refcount;
578
 
    int inmapfile; /* boolean value for writing */
579
 
    rendererVTableObj *vtable;
580
 
} outputFormatObj;
581
 
 
582
 
/* The following is used for "don't care" values in transparent, interlace and
583
 
   imagequality values. */
584
 
#define MS_NOOVERRIDE  -1111 
585
 
 
586
 
/************************************************************************/
587
 
/*                             queryObj                                 */
588
 
/*                                                                      */
589
 
/*      encapsulates the information necessary to perform a query       */
590
 
/************************************************************************/
591
 
#ifndef SWIG
592
 
typedef struct {
593
 
  int type; /* MS_QUERY_TYPE */
594
 
  int mode; /* MS_QUERY_MODE */
595
 
 
596
 
  int layer;
597
 
 
598
 
  pointObj point; /* by point */
599
 
  double buffer;
600
 
  int maxresults;
601
 
 
602
 
  rectObj rect; /* by rect */
603
 
  shapeObj *shape; /* by shape & operator (OGC filter) */
604
 
 
605
 
  long shapeindex; /* by index */
606
 
  long tileindex; 
607
 
  int clear_resultcache;
608
 
 
609
 
  char *item; /* by attribute */
610
 
  char *str;
611
 
 
612
 
  int op; /* by GEOS operator */
613
 
 
614
 
  int slayer; /* selection layer, used for msQueryByFeatures() (note this is not a query mode per se) */
615
 
} queryObj;
616
 
#endif
617
 
 
618
 
/************************************************************************/
619
 
/*                             queryMapObj                              */
620
 
/*                                                                      */
621
 
/*      used to visualize query results                                 */
622
 
/************************************************************************/
623
 
typedef struct {
624
 
    int height, width;
625
 
    int status;
626
 
    int style; /* HILITE, SELECTED or NORMAL */
627
 
    colorObj color;
628
 
} queryMapObj;
629
 
 
630
 
/* Define supported bindings here (only covers existing bindings at first). Not accessible directly using MapScript. */
631
 
#define MS_STYLE_BINDING_LENGTH 8
632
 
enum MS_STYLE_BINDING_ENUM { MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_WIDTH, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR, MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL, MS_STYLE_BINDING_OUTLINEWIDTH, MS_STYLE_BINDING_OPACITY};
633
 
#define MS_LABEL_BINDING_LENGTH 6
634
 
enum MS_LABEL_BINDING_ENUM { MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR, MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT, MS_LABEL_BINDING_PRIORITY};
635
 
 
636
 
/************************************************************************/
637
 
/*                         attributeBindingObj                          */
638
 
/************************************************************************/
639
 
#ifndef SWIG
640
 
typedef struct {
641
 
  char *item;
642
 
  int index;
643
 
} attributeBindingObj;
644
 
#endif
645
 
 
646
 
 
647
 
/************************************************************************/
648
 
/*                               labelObj                               */
649
 
/*                                                                      */
650
 
/*      parameters needed to annotate a layer, legend or scalebar       */
651
 
/************************************************************************/
652
 
 
653
 
typedef struct {
654
 
  char *font;
655
 
  enum MS_FONT_TYPE type;
656
 
    
657
 
  colorObj color;
658
 
  colorObj outlinecolor;
659
 
  int outlinewidth;
660
 
  
661
 
  colorObj shadowcolor;
662
 
  int shadowsizex, shadowsizey;
663
 
 
664
 
  colorObj backgroundcolor;
665
 
  colorObj backgroundshadowcolor;
666
 
  int backgroundshadowsizex, backgroundshadowsizey;
667
 
 
668
 
  double size;
669
 
  double minsize, maxsize;
670
 
 
671
 
  int position;
672
 
  int offsetx, offsety;
673
 
 
674
 
  double angle;
675
 
  int autoangle; /* true or false */
676
 
  int autofollow;  /* true or false, bug #1620 implementation */
677
 
 
678
 
  int buffer; /* space to reserve around a label */
679
 
 
680
 
  int antialias;
681
 
  int align;
682
 
 
683
 
  char wrap;
684
 
  int maxlength;
685
 
  int minlength;
686
 
  double space_size_10; /*cached size of a single space character -
687
 
                       used for label text alignment of rfc40 */
688
 
 
689
 
  int minfeaturesize; /* minimum feature size (in pixels) to label */
690
 
  int autominfeaturesize; /* true or false */
691
 
 
692
 
  double minscaledenom,maxscaledenom;
693
 
  
694
 
  int mindistance;
695
 
  int repeatdistance;
696
 
  int partials; /* can labels run of an image */
697
 
 
698
 
  int force; /* labels *must* be drawn */
699
 
 
700
 
  char *encoding;
701
 
 
702
 
  int priority;  /* Priority level 1 to MS_MAX_LABEL_PRIORITY, default=1 */
703
 
 
704
 
#ifndef SWIG
705
 
  attributeBindingObj bindings[MS_LABEL_BINDING_LENGTH];
706
 
  int numbindings;
707
 
#endif
708
 
 
709
 
} labelObj;
710
 
 
711
 
/************************************************************************/
712
 
/*                                webObj                                */
713
 
/*                                                                      */
714
 
/*      holds parameters for a mapserver/mapscript interface            */
715
 
/************************************************************************/
716
 
 
717
 
typedef struct {
718
 
  char *log;
719
 
  char *imagepath, *imageurl;
720
 
 
721
 
#ifdef SWIG
722
 
%immutable;
723
 
#endif /* SWIG */
724
 
  struct map_obj *map;
725
 
#ifdef SWIG
726
 
%mutable;
727
 
#endif /* SWIG */
728
 
 
729
 
#ifndef __cplusplus
730
 
  char *template;
731
 
#else
732
 
  char *_template;
733
 
#endif
734
 
 
735
 
  char *header, *footer;
736
 
  char *empty, *error; /* error handling */
737
 
  rectObj extent; /* clipping extent */
738
 
  double minscaledenom, maxscaledenom;
739
 
  char *mintemplate, *maxtemplate;
740
 
 
741
 
  char *queryformat; /* what format is the query to be returned, given as a MIME type */
742
 
  char *legendformat;
743
 
  char *browseformat;
744
 
 
745
 
#ifdef SWIG
746
 
%immutable;
747
 
#endif /* SWIG */
748
 
  hashTableObj metadata;
749
 
  hashTableObj validation;
750
 
#ifdef SWIG
751
 
%mutable;
752
 
#endif /* SWIG */
753
 
 
754
 
} webObj;
755
 
 
756
 
/************************************************************************/
757
 
/*                               styleObj                               */
758
 
/*                                                                      */
759
 
/*      holds parameters for symbolization, multiple styles may be      */
760
 
/*      applied within a classObj                                       */
761
 
/************************************************************************/
762
 
 
763
 
typedef struct {
764
 
#ifdef SWIG
765
 
%immutable;
766
 
#endif /* SWIG */
767
 
  int refcount;
768
 
#ifdef SWIG
769
 
%mutable;
770
 
#endif /* SWIG */
771
 
  
772
 
#ifndef SWIG
773
 
  /*private vars for rfc48*/
774
 
  char *_geomtransformexpression;
775
 
  int _geomtransform;
776
 
#endif
777
 
  
778
 
  /*should an angle be automatically computed*/
779
 
  int autoangle;
780
 
 
781
 
  colorObj color;
782
 
  colorObj backgroundcolor;
783
 
  colorObj outlinecolor;
784
 
 
785
 
  int opacity;
786
 
 
787
 
  /* Stuff to handle Color Range Styles */
788
 
  colorObj mincolor;
789
 
  colorObj maxcolor;
790
 
  double minvalue;
791
 
  double maxvalue;
792
 
  char *rangeitem;
793
 
  int rangeitemindex;
794
 
  
795
 
  int symbol;
796
 
  char *symbolname;
797
 
 
798
 
  double size;
799
 
  double minsize, maxsize;
800
 
 
801
 
  int patternlength;  /*moved from symbolObj in version 6.0*/                     
802
 
  double pattern[MS_MAXPATTERNLENGTH]; /*moved from symbolObj in version 6.0*/ 
803
 
  
804
 
  double gap; /*moved from symbolObj in version 6.0*/
805
 
  int position; /*moved from symbolObj in version 6.0*/
806
 
  
807
 
  int linecap, linejoin; /*moved from symbolObj in version 6.0*/
808
 
  double linejoinmaxsize; /*moved from symbolObj in version 6.0*/
809
 
  
810
 
  double width;
811
 
  double outlinewidth;
812
 
  double minwidth, maxwidth;
813
 
 
814
 
  double offsetx, offsety; /* for shadows, hollow symbols, etc... */
815
 
 
816
 
  double angle;
817
 
 
818
 
  int antialias;
819
 
 
820
 
  double minscaledenom, maxscaledenom;
821
 
 
822
 
#ifndef SWIG
823
 
  attributeBindingObj bindings[MS_STYLE_BINDING_LENGTH];
824
 
  int numbindings;
825
 
#endif
826
 
} styleObj;
827
 
 
828
 
/************************************************************************/
829
 
/*                               classObj                               */
830
 
/*                                                                      */
831
 
/*      basic symbolization and classification information              */
832
 
/************************************************************************/
833
 
 
834
 
typedef struct class_obj{
835
 
#ifndef SWIG
836
 
  expressionObj expression; /* the expression to be matched */
837
 
#endif
838
 
 
839
 
  int status;
840
 
 
841
 
#ifndef SWIG
842
 
  styleObj **styles;
843
 
  int maxstyles;
844
 
#endif
845
 
 
846
 
  int numstyles;
847
 
 
848
 
#ifdef SWIG
849
 
%immutable;
850
 
#endif /* SWIG */
851
 
  labelObj label;
852
 
#ifdef SWIG
853
 
%mutable;
854
 
#endif /* SWIG */
855
 
 
856
 
  char *name; /* should be unique within a layer */
857
 
  char *title; /* used for legend labeling */
858
 
 
859
 
#ifndef SWIG
860
 
  expressionObj text;
861
 
#endif /* not SWIG */
862
 
 
863
 
#ifndef __cplusplus
864
 
  char *template;
865
 
#else /* __cplusplus */
866
 
  char *_template;
867
 
#endif /* __cplusplus */
868
 
 
869
 
  int type;
870
 
 
871
 
#ifdef SWIG
872
 
%immutable;
873
 
#endif /* SWIG */
874
 
  hashTableObj metadata;
875
 
  hashTableObj validation;
876
 
#ifdef SWIG
877
 
%mutable;
878
 
#endif /* SWIG */
879
 
 
880
 
  double minscaledenom, maxscaledenom;
881
 
#ifdef SWIG
882
 
%immutable;
883
 
#endif /* SWIG */
884
 
  int refcount;
885
 
  struct layer_obj *layer;
886
 
#ifdef SWIG
887
 
%mutable;
888
 
#endif /* SWIG */
889
 
  int debug;
890
 
 
891
 
  char *keyimage;
892
 
  
893
 
   char *group;
894
 
} classObj;
895
 
 
896
 
/************************************************************************/
897
 
/*                         labelCacheMemberObj                          */
898
 
/*                                                                      */
899
 
/*      structures to implement label caching and collision             */
900
 
/*      avoidance etc                                                   */
901
 
/*                                                                      */
902
 
/*        Note: These are scriptable, but are read only.                */
903
 
/************************************************************************/
904
 
 
905
 
#ifdef SWIG
906
 
%immutable;
907
 
#endif /* SWIG */
908
 
typedef struct {
909
 
  char *text;
910
 
  double featuresize;
911
 
 
912
 
  styleObj *styles; /* copied from the classObj, only present if there is a marker to be drawn */
913
 
  int numstyles;
914
 
 
915
 
  labelObj label; /* copied from the classObj */
916
 
 
917
 
  int layerindex; /* indexes */
918
 
  int classindex;
919
 
  int tileindex;
920
 
  int shapeindex;
921
 
 
922
 
  int shapetype; /* source geometry type */
923
 
 
924
 
  pointObj point; /* label point */
925
 
  shapeObj *poly; /* label bounding box */
926
 
 
927
 
  int status; /* has this label been drawn or not */
928
 
 
929
 
#ifndef SWIG
930
 
  labelPathObj *labelpath;  /* Path & bounds of curved labels.  Bug #1620 implementation */
931
 
#endif /* SWIG */
932
 
  
933
 
} labelCacheMemberObj;
934
 
 
935
 
/************************************************************************/
936
 
/*                         markerCacheMemberObj                         */
937
 
/************************************************************************/
938
 
typedef struct {
939
 
  int id; /* corresponding label */
940
 
  shapeObj *poly; /* marker bounding box (POINT layers only) */
941
 
} markerCacheMemberObj;
942
 
 
943
 
/************************************************************************/
944
 
/*                          labelCacheSlotObj                           */
945
 
/************************************************************************/
946
 
typedef struct {
947
 
  labelCacheMemberObj *labels;
948
 
  int numlabels;
949
 
  int cachesize;
950
 
  markerCacheMemberObj *markers;
951
 
  int nummarkers;
952
 
  int markercachesize;
953
 
} labelCacheSlotObj;
954
 
 
955
 
/************************************************************************/
956
 
/*                            labelCacheObj                             */
957
 
/************************************************************************/
958
 
typedef struct {
959
 
    /* One labelCacheSlotObj for each priority level */
960
 
    labelCacheSlotObj slots[MS_MAX_LABEL_PRIORITY];
961
 
    /* numlabels is deprecated, maintained only for backwards compatibility
962
 
     * between MS 4.10 and 5.0 and should be removed in a future release.
963
 
     * The slots[].numlabels are the real values to rely on.
964
 
     */
965
 
    int numlabels;
966
 
} labelCacheObj;
967
 
 
968
 
/************************************************************************/
969
 
/*                         resultCacheMemberObj                         */
970
 
/************************************************************************/
971
 
typedef struct {
972
 
  long shapeindex;
973
 
  int tileindex;
974
 
  int classindex;
975
 
} resultCacheMemberObj;
976
 
#ifdef SWIG
977
 
%mutable;
978
 
#endif /* SWIG */
979
 
 
980
 
 
981
 
/************************************************************************/
982
 
/*                            resultCacheObj                            */
983
 
/************************************************************************/
984
 
typedef struct {
985
 
 
986
 
#ifndef SWIG
987
 
  resultCacheMemberObj *results;
988
 
  int cachesize;
989
 
#endif /* not SWIG */
990
 
 
991
 
#ifdef SWIG
992
 
%immutable;
993
 
#endif /* SWIG */
994
 
  int numresults;
995
 
  rectObj bounds;
996
 
#ifdef SWIG
997
 
%mutable;
998
 
#endif /* SWIG */
999
 
 
1000
 
  /*used to force the result retreiving to use getshape instead of msLayerResultGetShape #3305*/
1001
 
  int usegetshape;
1002
 
 
1003
 
} resultCacheObj;
1004
 
 
1005
 
 
1006
 
/************************************************************************/
1007
 
/*                             symbolSetObj                             */
1008
 
/************************************************************************/
1009
 
typedef struct {
1010
 
  char *filename;
1011
 
  int imagecachesize;
1012
 
#ifdef SWIG
1013
 
  %immutable;
1014
 
#endif /* SWIG */
1015
 
  int numsymbols;
1016
 
  int maxsymbols;
1017
 
#ifdef SWIG
1018
 
%mutable;
1019
 
#endif /* SWIG */
1020
 
#ifndef SWIG
1021
 
  int refcount;
1022
 
  symbolObj** symbol;
1023
 
  struct map_obj *map;
1024
 
  fontSetObj *fontset; /* a pointer to the main mapObj version */
1025
 
  struct imageCacheObj *imagecache;
1026
 
#endif /* not SWIG */
1027
 
} symbolSetObj;
1028
 
 
1029
 
/************************************************************************/
1030
 
/*                           referenceMapObj                            */
1031
 
/************************************************************************/
1032
 
typedef struct {
1033
 
  rectObj extent;
1034
 
  int height, width;
1035
 
  colorObj color;
1036
 
  colorObj outlinecolor;
1037
 
  char *image;
1038
 
  int status;
1039
 
  int marker;
1040
 
  char *markername;
1041
 
  int markersize;
1042
 
  int minboxsize;
1043
 
  int maxboxsize;
1044
 
#ifdef SWIG
1045
 
%immutable;
1046
 
#endif /* SWIG */
1047
 
  struct map_obj *map;
1048
 
#ifdef SWIG
1049
 
%mutable;
1050
 
#endif /* SWIG */
1051
 
} referenceMapObj;
1052
 
 
1053
 
/************************************************************************/
1054
 
/*                             scalebarObj                              */
1055
 
/************************************************************************/
1056
 
typedef struct {
1057
 
  colorObj imagecolor;
1058
 
  int height, width;
1059
 
  int style;
1060
 
  int intervals;
1061
 
  labelObj label;
1062
 
  colorObj color;
1063
 
  colorObj backgroundcolor;
1064
 
  colorObj outlinecolor;
1065
 
  int units;
1066
 
  int status; /* ON, OFF or EMBED */
1067
 
  int position; /* for embeded scalebars */
1068
 
#ifndef SWIG
1069
 
  int transparent;
1070
 
  int interlace;
1071
 
#endif /* not SWIG */
1072
 
  int postlabelcache;
1073
 
  int align;
1074
 
} scalebarObj;
1075
 
 
1076
 
/************************************************************************/
1077
 
/*                              legendObj                               */
1078
 
/************************************************************************/
1079
 
 
1080
 
typedef struct {
1081
 
  colorObj imagecolor;
1082
 
#ifdef SWIG
1083
 
        %immutable;
1084
 
#endif
1085
 
  labelObj label;
1086
 
#ifdef SWIG
1087
 
        %mutable;
1088
 
#endif
1089
 
  int keysizex, keysizey;
1090
 
  int keyspacingx, keyspacingy;
1091
 
  colorObj outlinecolor; /* Color of outline of box, -1 for no outline */
1092
 
  int status; /* ON, OFF or EMBED */
1093
 
  int height, width;
1094
 
  int position; /* for embeded legends */
1095
 
#ifndef SWIG
1096
 
  int transparent;
1097
 
  int interlace;
1098
 
#endif /* not SWIG */
1099
 
  int postlabelcache;
1100
 
#ifndef __cplusplus
1101
 
   char *template;
1102
 
#else /* __cplusplus */
1103
 
   char *_template;
1104
 
#endif /* __cplusplus */
1105
 
#ifdef SWIG
1106
 
%immutable;
1107
 
#endif /* SWIG */
1108
 
  struct map_obj *map;
1109
 
#ifdef SWIG
1110
 
%mutable;
1111
 
#endif /* SWIG */
1112
 
} legendObj;
1113
 
 
1114
 
/************************************************************************/
1115
 
/*                             graticuleObj                             */
1116
 
/************************************************************************/
1117
 
#ifndef SWIG
1118
 
typedef struct
1119
 
{
1120
 
  double    dwhichlatitude;
1121
 
  double    dwhichlongitude;
1122
 
  double    dstartlatitude;
1123
 
  double    dstartlongitude;
1124
 
  double    dendlatitude;
1125
 
  double    dendlongitude;
1126
 
  double    dincrementlatitude;
1127
 
  double    dincrementlongitude;
1128
 
  double    minarcs;
1129
 
  double    maxarcs;
1130
 
  double    minincrement;
1131
 
  double    maxincrement;
1132
 
  double    minsubdivides;
1133
 
  double    maxsubdivides;
1134
 
  int     bvertical;
1135
 
  int     blabelaxes;
1136
 
  int     ilabelstate;
1137
 
  int     ilabeltype;
1138
 
  rectObj   extent;
1139
 
  lineObj   *pboundinglines;
1140
 
  pointObj  *pboundingpoints;
1141
 
  char    *labelformat;
1142
 
} graticuleObj;
1143
 
 
1144
 
typedef struct
1145
 
{
1146
 
  int nTop;
1147
 
  pointObj *pasTop;
1148
 
  char  **papszTopLabels;
1149
 
  int nBottom;
1150
 
  pointObj *pasBottom;
1151
 
  char  **papszBottomLabels;
1152
 
  int nLeft;
1153
 
  pointObj *pasLeft;
1154
 
  char  **papszLeftLabels;
1155
 
  int nRight;
1156
 
  pointObj *pasRight;
1157
 
  char  **papszRightLabels;
1158
 
  
1159
 
}graticuleIntersectionObj;
1160
 
 
1161
 
struct layerVTable;
1162
 
typedef struct layerVTable layerVTableObj;
1163
 
 
1164
 
#endif /*SWIG*/
1165
 
 
1166
 
/************************************************************************/
1167
 
/*                               layerObj                               */
1168
 
/*                                                                      */
1169
 
/*      base unit of a map.                                             */
1170
 
/************************************************************************/
1171
 
 
1172
 
typedef struct layer_obj {
1173
 
 
1174
 
  char *classitem; /* .DBF item to be used for symbol lookup */
1175
 
 
1176
 
#ifndef SWIG
1177
 
  int classitemindex;
1178
 
  resultCacheObj *resultcache; /* holds the results of a query against this layer */
1179
 
  int annotate; /* boolean flag for annotation */
1180
 
  double scalefactor; /* computed, not set */
1181
 
#ifndef __cplusplus
1182
 
  classObj **class; /* always at least 1 class */
1183
 
#else /* __cplusplus */
1184
 
  classObj **_class;
1185
 
#endif /* __cplusplus */
1186
 
#endif /* not SWIG */
1187
 
 
1188
 
#ifdef SWIG
1189
 
%immutable;
1190
 
#endif /* SWIG */
1191
 
  /* reference counting, RFC24 */
1192
 
  int refcount;
1193
 
  int numclasses;
1194
 
  int maxclasses;
1195
 
  int index;
1196
 
  struct map_obj *map;
1197
 
#ifdef SWIG
1198
 
%mutable;
1199
 
#endif /* SWIG */
1200
 
 
1201
 
  char *header, *footer; /* only used with multi result queries */
1202
 
 
1203
 
#ifndef __cplusplus
1204
 
  char *template; /* global template, used across all classes */
1205
 
#else /* __cplusplus */
1206
 
  char *_template;
1207
 
#endif /* __cplusplus */
1208
 
 
1209
 
  char *name; /* should be unique */
1210
 
  char *group; /* shouldn't be unique it's supposed to be a group right? */
1211
 
 
1212
 
  int status; /* on or off */
1213
 
  char *data; /* filename, can be relative or full path */
1214
 
 
1215
 
  enum MS_LAYER_TYPE type;
1216
 
 
1217
 
  double tolerance; /* search buffer for point and line queries (in toleranceunits) */
1218
 
  int toleranceunits;
1219
 
 
1220
 
  double symbolscaledenom; /* scale at which symbols are default size */
1221
 
  double minscaledenom, maxscaledenom;
1222
 
  double labelminscaledenom, labelmaxscaledenom;
1223
 
  double mingeowidth, maxgeowidth; /* map width (in map units) at which the layer should be drawn */
1224
 
 
1225
 
  int sizeunits; /* applies to all classes */
1226
 
 
1227
 
  int maxfeatures;
1228
 
 
1229
 
  colorObj offsite; /* transparent pixel value for raster images */
1230
 
 
1231
 
  int transform; /* does this layer have to be transformed to file coordinates */
1232
 
 
1233
 
  int labelcache, postlabelcache; /* on or off */
1234
 
 
1235
 
  char *labelitem;
1236
 
#ifndef SWIG
1237
 
  int labelitemindex;
1238
 
#endif /* not SWIG */
1239
 
 
1240
 
  char *tileitem;
1241
 
  char *tileindex; /* layer index file for tiling support */
1242
 
 
1243
 
#ifndef SWIG
1244
 
  int tileitemindex;
1245
 
  projectionObj projection; /* projection information for the layer */
1246
 
  int project; /* boolean variable, do we need to project this layer or not */
1247
 
#endif /* not SWIG */
1248
 
 
1249
 
  int units; /* units of the projection */
1250
 
 
1251
 
#ifndef SWIG
1252
 
  featureListNodeObjPtr features; /* linked list so we don't need a counter */
1253
 
  featureListNodeObjPtr currentfeature; /* pointer to the current feature */
1254
 
#endif /* SWIG */
1255
 
 
1256
 
  char *connection;
1257
 
  char *plugin_library;
1258
 
  char *plugin_library_original; /* this is needed for mapfile writing */
1259
 
  enum MS_CONNECTION_TYPE connectiontype;
1260
 
 
1261
 
#ifndef SWIG
1262
 
  layerVTableObj *vtable;
1263
 
 
1264
 
  /* SDL has converted OracleSpatial, SDE, Graticules, MyGIS */
1265
 
  void *layerinfo; /* all connection types should use this generic pointer to a vendor specific structure */
1266
 
  void *wfslayerinfo; /* For WFS layers, will contain a msWFSLayerInfo struct */
1267
 
#endif /* not SWIG */
1268
 
 
1269
 
  /* attribute/classification handling components */
1270
 
#ifdef SWIG
1271
 
%immutable;
1272
 
#endif /* SWIG */
1273
 
  int numitems;
1274
 
#ifdef SWIG
1275
 
%mutable;
1276
 
#endif /* SWIG */
1277
 
 
1278
 
#ifndef SWIG
1279
 
  char **items;
1280
 
  void *iteminfo; /* connection specific information necessary to retrieve values */
1281
 
  expressionObj filter; /* connection specific attribute filter */
1282
 
  int bandsitemindex;
1283
 
  int filteritemindex;
1284
 
  int styleitemindex;
1285
 
#endif /* not SWIG */
1286
 
 
1287
 
  char *bandsitem; /* which item in a tile contains bands to use (tiled raster data only) */
1288
 
  char *filteritem;
1289
 
  char *styleitem; /* item to be used for style lookup - can also be 'AUTO' */
1290
 
 
1291
 
  char *requires; /* context expressions, simple enough to not use expressionObj */
1292
 
  char *labelrequires;
1293
 
 
1294
 
#ifdef SWIG
1295
 
%immutable;
1296
 
#endif /* SWIG */
1297
 
  hashTableObj metadata;
1298
 
  hashTableObj validation;
1299
 
#ifdef SWIG
1300
 
%mutable;
1301
 
#endif /* SWIG */
1302
 
 
1303
 
  int opacity; /* opacity (was transparency) value 0-100 */
1304
 
  
1305
 
  int dump;
1306
 
  int debug;
1307
 
#ifndef SWIG
1308
 
  char **processing;
1309
 
  joinObj *joins;
1310
 
#endif /* not SWIG */
1311
 
#ifdef SWIG
1312
 
%immutable;
1313
 
#endif /* SWIG */
1314
 
  
1315
 
#ifndef SWIGJAVA  
1316
 
  rectObj extent;
1317
 
#endif /* not SWIGJAVA */
1318
 
 
1319
 
  int numprocessing;
1320
 
  int numjoins;
1321
 
#ifdef SWIG
1322
 
%mutable;
1323
 
#endif /* SWIG */
1324
 
 
1325
 
  char *classgroup;
1326
 
} layerObj;
1327
 
 
1328
 
/************************************************************************/
1329
 
/*                                mapObj                                */
1330
 
/*                                                                      */
1331
 
/*      encompasses everything used in an Internet mapping              */
1332
 
/*      application.                                                    */
1333
 
/************************************************************************/
1334
 
 
1335
 
/* MAP OBJECT -  */
1336
 
typedef struct map_obj{ /* structure for a map */
1337
 
  char *name; /* small identifier for naming etc. */
1338
 
  int status; /* is map creation on or off */
1339
 
  int height, width;
1340
 
  int maxsize;
1341
 
 
1342
 
#ifndef SWIG
1343
 
  layerObj **layers;
1344
 
#endif /* SWIG */
1345
 
 
1346
 
#ifdef SWIG
1347
 
%immutable;
1348
 
#endif /* SWIG */
1349
 
  /* reference counting, RFC24 */
1350
 
  int refcount;
1351
 
  int numlayers; /* number of layers in mapfile */
1352
 
  int maxlayers; /* allocated size of layers[] array */
1353
 
 
1354
 
  symbolSetObj symbolset;
1355
 
  fontSetObj fontset;
1356
 
 
1357
 
  labelCacheObj labelcache; /* we need this here so multiple feature processors can access it */
1358
 
#ifdef SWIG
1359
 
%mutable;
1360
 
#endif /* SWIG */
1361
 
 
1362
 
  int transparent; /* TODO - Deprecated */
1363
 
  int interlace; /* TODO - Deprecated */
1364
 
  int imagequality; /* TODO - Deprecated */
1365
 
 
1366
 
  rectObj extent; /* map extent array */
1367
 
  double cellsize; /* in map units */
1368
 
 
1369
 
 
1370
 
#ifndef SWIG
1371
 
  geotransformObj gt; /* rotation / geotransform */
1372
 
  rectObj saved_extent;
1373
 
#endif /*SWIG*/
1374
 
 
1375
 
  enum MS_UNITS units; /* units of the projection */
1376
 
  double scaledenom; /* scale of the output image */
1377
 
  double resolution;
1378
 
  double defresolution; /* default resolution: used for calculate the scalefactor */
1379
 
 
1380
 
  char *shapepath; /* where are the shape files located */
1381
 
  char *mappath; /* path of the mapfile, all path are relative to this path */
1382
 
 
1383
 
#ifndef SWIG
1384
 
  paletteObj palette; /* holds a map palette */
1385
 
#endif /*SWIG*/
1386
 
  colorObj imagecolor; /* holds the initial image color value */
1387
 
 
1388
 
#ifdef SWIG
1389
 
%immutable;
1390
 
#endif /* SWIG */
1391
 
  int numoutputformats;
1392
 
  outputFormatObj **outputformatlist;
1393
 
  outputFormatObj *outputformat;
1394
 
 
1395
 
  char *imagetype; /* name of current outputformat */
1396
 
#ifdef SWIG
1397
 
  %mutable;
1398
 
#endif /* SWIG */
1399
 
 
1400
 
#ifndef SWIG
1401
 
  projectionObj projection; /* projection information for output map */
1402
 
  projectionObj latlon; /* geographic projection definition */
1403
 
#endif /* not SWIG */
1404
 
 
1405
 
#ifdef SWIG
1406
 
%immutable;
1407
 
#endif /* SWIG */  
1408
 
  referenceMapObj reference;
1409
 
  scalebarObj scalebar;
1410
 
  legendObj legend;
1411
 
 
1412
 
  queryMapObj querymap;
1413
 
 
1414
 
  webObj web;
1415
 
#ifdef SWIG
1416
 
%mutable;
1417
 
#endif /* SWIG */
1418
 
 
1419
 
  int *layerorder;
1420
 
 
1421
 
  int debug;
1422
 
 
1423
 
  char *datapattern, *templatepattern; /* depricated, use VALIDATION ... END block instead */
1424
 
 
1425
 
#ifdef SWIG
1426
 
%immutable;
1427
 
#endif /* SWIG */
1428
 
  hashTableObj configoptions;
1429
 
#ifdef SWIG
1430
 
%mutable;
1431
 
#endif /* SWIG */
1432
 
 
1433
 
#ifndef SWIG
1434
 
  /* Private encryption key information - see mapcrypto.c */
1435
 
  int encryption_key_loaded;        /* MS_TRUE once key has been loaded */
1436
 
  unsigned char encryption_key[MS_ENCRYPTION_KEY_SIZE]; /* 128bits encryption key */
1437
 
 
1438
 
  queryObj query;
1439
 
#endif
1440
 
} mapObj;
1441
 
 
1442
 
 
1443
 
/************************************************************************/
1444
 
/*                                pdfObj                                */
1445
 
/************************************************************************/
1446
 
 
1447
 
#ifdef USE_PDF
1448
 
typedef struct {
1449
 
  mapObj *map;
1450
 
  PDF *pdf;
1451
 
  void    *imagetmp;  /* used when the FORMATOPTION "OUTPUT_TYPE=RASTER" */
1452
 
} PDFObj; 
1453
 
#endif
1454
 
 
1455
 
/************************************************************************/
1456
 
/*                                SVGObj                                */
1457
 
/************************************************************************/
1458
 
#ifndef SWIG
1459
 
typedef struct  {
1460
 
  mapObj *map;
1461
 
  FILE *stream;
1462
 
  char *filename;
1463
 
  int streamclosed; /* track if a save image is done */
1464
 
  int compressed; /*track if output is set to be svgz */
1465
 
} SVGObj;
1466
 
#endif /*SWIG*/
1467
 
 
1468
 
/************************************************************************/
1469
 
/*                               imageObj                               */
1470
 
/*                                                                      */
1471
 
/*      A wrapper for GD and other images.                              */
1472
 
/************************************************************************/
1473
 
typedef struct {
1474
 
#ifdef SWIG
1475
 
%immutable;
1476
 
#endif
1477
 
  int width, height;
1478
 
  double resolution;
1479
 
  double resolutionfactor;
1480
 
 
1481
 
  char *imagepath, *imageurl;
1482
 
 
1483
 
  outputFormatObj *format;
1484
 
#ifndef SWIG
1485
 
  void *imageextra; /* AGG specific */
1486
 
  tileCacheObj *tilecache;
1487
 
  int ntiles;
1488
 
#endif
1489
 
  int buffer_format; /* tells if the alpha channel is GD or AGG style  */
1490
 
#ifdef SWIG
1491
 
%mutable;
1492
 
#endif
1493
 
  int renderer;
1494
 
#ifndef SWIG
1495
 
  int size;
1496
 
#endif
1497
 
 
1498
 
#ifndef SWIG
1499
 
  union {
1500
 
        void *plugin;
1501
 
    gdImagePtr gd;
1502
 
#ifdef USE_MING_FLASH
1503
 
    void *swf;
1504
 
#endif
1505
 
#ifdef USE_PDF
1506
 
    PDFObj *pdf;
1507
 
#endif
1508
 
 
1509
 
    SVGObj *svg;
1510
 
 
1511
 
    char *imagemap;
1512
 
    short *raw_16bit;
1513
 
    float *raw_float;
1514
 
    unsigned char *raw_byte;
1515
 
  } img;
1516
 
#endif
1517
 
} imageObj;
1518
 
 
1519
 
 
1520
 
/************************************************************************/
1521
 
/*                             layerVTable                              */
1522
 
/*                                                                      */
1523
 
/*      contains function pointers to the layer operations.  If you     */
1524
 
/*      add new functions to here, remember to update                   */
1525
 
/*      populateVirtualTable in maplayer.c                              */
1526
 
/************************************************************************/
1527
 
#ifndef SWIG
1528
 
struct layerVTable {
1529
 
    int (*LayerInitItemInfo)(layerObj *layer);
1530
 
    void (*LayerFreeItemInfo)(layerObj *layer);
1531
 
    int (*LayerOpen)(layerObj *layer);
1532
 
    int (*LayerIsOpen)(layerObj *layer);
1533
 
    int (*LayerWhichShapes)(layerObj *layer, rectObj rect);
1534
 
    int (*LayerNextShape)(layerObj *layer, shapeObj *shape);
1535
 
    int (*LayerResultsGetShape)(layerObj *layer, shapeObj *shape, 
1536
 
                         int tile, long record);
1537
 
    int (*LayerGetShape)(layerObj *layer, shapeObj *shape, 
1538
 
                         int tile, long record);
1539
 
    int (*LayerClose)(layerObj *layer);
1540
 
    int (*LayerGetItems)(layerObj *layer);
1541
 
    int (*LayerGetExtent)(layerObj *layer, rectObj *extent);
1542
 
    int (*LayerGetAutoStyle)(mapObj *map, layerObj *layer, classObj *c, 
1543
 
                             int tile, long record);
1544
 
 
1545
 
    int (*LayerCloseConnection)(layerObj *layer);
1546
 
 
1547
 
    int (*LayerSetTimeFilter)(layerObj *layer, 
1548
 
                              const char *timestring, 
1549
 
                              const char *timefield);
1550
 
 
1551
 
    int (*LayerApplyFilterToLayer)(FilterEncodingNode *psNode, mapObj *map,
1552
 
                                   int iLayerIndex, 
1553
 
                                   int bOnlySpatialFilter);
1554
 
 
1555
 
    int (*LayerCreateItems)(layerObj *layer, int nt);
1556
 
    int (*LayerGetNumFeatures)(layerObj *layer);
1557
 
};
1558
 
#endif /*SWIG*/
1559
 
 
1560
 
/* Function prototypes, wrapable */
1561
 
MS_DLL_EXPORT int msSaveImage(mapObj *map, imageObj *img, char *filename);
1562
 
MS_DLL_EXPORT void msFreeImage(imageObj *img);
1563
 
MS_DLL_EXPORT int msSetup(void);
1564
 
MS_DLL_EXPORT void msCleanup(void);
1565
 
MS_DLL_EXPORT mapObj *msLoadMapFromString(char *buffer, char *new_mappath);
1566
 
 
1567
 
/* Function prototypes, not wrapable */
1568
 
 
1569
 
#ifndef SWIG
1570
 
 
1571
 
/*
1572
 
** helper functions not part of the general API but needed in
1573
 
** a few other places (like mapscript)... found in mapfile.c
1574
 
*/
1575
 
int getString(char **s);
1576
 
int getDouble(double *d);
1577
 
int getInteger(int *i);
1578
 
int getSymbol(int n, ...);
1579
 
int getCharacter(char *c);
1580
 
 
1581
 
int msBuildPluginLibraryPath(char **dest, const char *lib_str, mapObj *map);
1582
 
 
1583
 
MS_DLL_EXPORT int  hex2int(char *hex);
1584
 
 
1585
 
MS_DLL_EXPORT void initJoin(joinObj *join);
1586
 
MS_DLL_EXPORT void initSymbol(symbolObj *s);
1587
 
MS_DLL_EXPORT int initMap(mapObj *map);
1588
 
MS_DLL_EXPORT layerObj *msGrowMapLayers( mapObj *map );
1589
 
MS_DLL_EXPORT int initLayer(layerObj *layer, mapObj *map);
1590
 
MS_DLL_EXPORT int freeLayer( layerObj * );
1591
 
MS_DLL_EXPORT classObj *msGrowLayerClasses( layerObj *layer );
1592
 
MS_DLL_EXPORT int initClass(classObj *_class);
1593
 
MS_DLL_EXPORT int freeClass( classObj * );
1594
 
MS_DLL_EXPORT styleObj *msGrowClassStyles( classObj *_class );
1595
 
MS_DLL_EXPORT int msMaybeAllocateStyle(classObj* c, int idx);
1596
 
MS_DLL_EXPORT void initLabel(labelObj *label);
1597
 
MS_DLL_EXPORT void resetClassStyle(classObj *_class);
1598
 
MS_DLL_EXPORT int initStyle(styleObj *style);
1599
 
MS_DLL_EXPORT int freeStyle(styleObj *style);
1600
 
MS_DLL_EXPORT void initReferenceMap(referenceMapObj *ref);
1601
 
MS_DLL_EXPORT void initScalebar(scalebarObj *scalebar);
1602
 
MS_DLL_EXPORT void initGrid( graticuleObj *pGraticule );
1603
 
MS_DLL_EXPORT void initWeb(webObj *web);
1604
 
MS_DLL_EXPORT void freeWeb(webObj *web);
1605
 
MS_DLL_EXPORT void initResultCache(resultCacheObj *resultcache);
1606
 
 
1607
 
MS_DLL_EXPORT featureListNodeObjPtr insertFeatureList(featureListNodeObjPtr *list, shapeObj *shape);
1608
 
MS_DLL_EXPORT void freeFeatureList(featureListNodeObjPtr list);
1609
 
 
1610
 
/* To be used *only* within the mapfile loading phase */
1611
 
MS_DLL_EXPORT int loadExpressionString(expressionObj *exp, char *value);
1612
 
/* Use this next, thread safe wrapper, function everywhere else */
1613
 
MS_DLL_EXPORT int msLoadExpressionString(expressionObj *exp, char *value);
1614
 
MS_DLL_EXPORT char *msGetExpressionString(expressionObj *exp);
1615
 
MS_DLL_EXPORT void freeExpression(expressionObj *exp);
1616
 
MS_DLL_EXPORT char *msGetExpressionString(expressionObj *exp);
1617
 
 
1618
 
MS_DLL_EXPORT void msLayerSubstituteString(layerObj *layer, const char *from, const char *to);
1619
 
MS_DLL_EXPORT void msApplyDefaultSubstitutions(mapObj *map);
1620
 
 
1621
 
MS_DLL_EXPORT int getClassIndex(layerObj *layer, char *str);
1622
 
 
1623
 
/* For maplabel and mappdf */
1624
 
int labelInImage(int width, int height, shapeObj *lpoly, int buffer);
1625
 
int intersectLabelPolygons(shapeObj *p1, shapeObj *p2);
1626
 
pointObj get_metrics_line(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, lineObj *poly);
1627
 
pointObj get_metrics(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, shapeObj *poly);
1628
 
double dist(pointObj a, pointObj b);
1629
 
   
1630
 
/*
1631
 
** Main API Functions
1632
 
*/
1633
 
 
1634
 
/* mapobject.c */
1635
 
 
1636
 
MS_DLL_EXPORT void msFreeMap(mapObj *map);
1637
 
MS_DLL_EXPORT mapObj *msNewMapObj(void);
1638
 
MS_DLL_EXPORT const char *msGetConfigOption( mapObj *map, const char *key);
1639
 
MS_DLL_EXPORT int msSetConfigOption( mapObj *map, const char *key, const char *value);
1640
 
MS_DLL_EXPORT int msTestConfigOption( mapObj *map, const char *key, 
1641
 
                                      int default_result );
1642
 
MS_DLL_EXPORT void msApplyMapConfigOptions( mapObj *map );
1643
 
MS_DLL_EXPORT int msMapComputeGeotransform( mapObj *map );
1644
 
 
1645
 
MS_DLL_EXPORT void msMapPixelToGeoref( mapObj *map, double *x, double *y );
1646
 
MS_DLL_EXPORT void msMapGeorefToPixel( mapObj *map, double *x, double *y );
1647
 
 
1648
 
MS_DLL_EXPORT int msMapSetExtent(mapObj *map, double minx, double miny, 
1649
 
                                 double maxx, double maxy);
1650
 
MS_DLL_EXPORT int msMapOffsetExtent( mapObj *map, double x, double y);
1651
 
MS_DLL_EXPORT int msMapScaleExtent( mapObj *map, double zoomfactor, 
1652
 
                                         double minscaledenom, double maxscaledenom);
1653
 
MS_DLL_EXPORT int msMapSetCenter( mapObj *map, pointObj *center);
1654
 
MS_DLL_EXPORT int msMapSetRotation( mapObj *map, double rotation_angle );
1655
 
MS_DLL_EXPORT int msMapSetSize( mapObj *map, int width, int height );
1656
 
MS_DLL_EXPORT int msMapSetSize( mapObj *map, int width, int height );
1657
 
MS_DLL_EXPORT int msMapSetFakedExtent( mapObj *map );
1658
 
MS_DLL_EXPORT int msMapRestoreRealExtent( mapObj *map );
1659
 
MS_DLL_EXPORT int msMapLoadOWSParameters( mapObj *map, cgiRequestObj *request,
1660
 
                                          const char *wmtver_string );
1661
 
MS_DLL_EXPORT int msMapIgnoreMissingData( mapObj *map );
1662
 
 
1663
 
/* mapfile.c */
1664
 
 
1665
 
MS_DLL_EXPORT int msValidateParameter(char *value, char *pattern1, char *pattern2, char *pattern3, char *pattern4);
1666
 
MS_DLL_EXPORT int msGetLayerIndex(mapObj *map, char *name);
1667
 
MS_DLL_EXPORT int msGetSymbolIndex(symbolSetObj *set, char *name, int try_addimage_if_notfound);
1668
 
MS_DLL_EXPORT mapObj  *msLoadMap(char *filename, char *new_mappath);
1669
 
MS_DLL_EXPORT int msSaveMap(mapObj *map, char *filename);
1670
 
MS_DLL_EXPORT void msFreeCharArray(char **array, int num_items);
1671
 
MS_DLL_EXPORT int msUpdateScalebarFromString(scalebarObj *scalebar, char *string, int url_string);
1672
 
MS_DLL_EXPORT int msUpdateQueryMapFromString(queryMapObj *querymap, char *string, int url_string);
1673
 
MS_DLL_EXPORT int msUpdateLabelFromString(labelObj *label, char *string);
1674
 
MS_DLL_EXPORT int msUpdateReferenceMapFromString(referenceMapObj *ref, char *string, int url_string);
1675
 
MS_DLL_EXPORT int msUpdateLegendFromString(legendObj *legend, char *string, int url_string);
1676
 
MS_DLL_EXPORT int msUpdateWebFromString(webObj *web, char *string, int url_string);
1677
 
MS_DLL_EXPORT int msUpdateStyleFromString(styleObj *style, char *string, int url_string);
1678
 
MS_DLL_EXPORT int msUpdateClassFromString(classObj *_class, char *string, int url_string);
1679
 
MS_DLL_EXPORT int msUpdateLayerFromString(layerObj *layer, char *string, int url_string);
1680
 
MS_DLL_EXPORT int msUpdateMapFromURL(mapObj *map, char *variable, char *string);
1681
 
MS_DLL_EXPORT int msEvalRegex(char *e, char *s);
1682
 
MS_DLL_EXPORT void msFree(void *p);
1683
 
MS_DLL_EXPORT char **msTokenizeMap(char *filename, int *numtokens);
1684
 
MS_DLL_EXPORT int msInitLabelCache(labelCacheObj *cache);
1685
 
MS_DLL_EXPORT int msFreeLabelCache(labelCacheObj *cache);
1686
 
MS_DLL_EXPORT int msCheckConnection(layerObj * layer); /* connection pooling functions (mapfile.c) */
1687
 
MS_DLL_EXPORT void msCloseConnections(mapObj *map); 
1688
 
 
1689
 
#if defined USE_PDF
1690
 
MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash); /* mappdf.c */
1691
 
#endif /* USE_PDF */
1692
 
 
1693
 
MS_DLL_EXPORT void msOGRCleanup(void);
1694
 
MS_DLL_EXPORT void msGDALCleanup(void);
1695
 
MS_DLL_EXPORT void msGDALInitialize(void);
1696
 
   
1697
 
 
1698
 
MS_DLL_EXPORT imageObj *msDrawScalebar(mapObj *map); /* in mapscale.c */
1699
 
MS_DLL_EXPORT int msCalculateScale(rectObj extent, int units, int width, int height, double resolution, double *scaledenom);
1700
 
MS_DLL_EXPORT double GetDeltaExtentsUsingScale(double scale, int units, double centerLat, int width, double resolution);
1701
 
MS_DLL_EXPORT double Pix2Georef(int nPixPos, int nPixMin, int nPixMax, double dfGeoMin, double dfGeoMax, int bULisYOrig);
1702
 
MS_DLL_EXPORT double msInchesPerUnit(int units, double center_lat);
1703
 
MS_DLL_EXPORT int msEmbedScalebar(mapObj *map, imageObj *img);
1704
 
 
1705
 
MS_DLL_EXPORT int msPointInRect(pointObj *p, rectObj *rect); /* in mapsearch.c */
1706
 
MS_DLL_EXPORT int msRectOverlap(rectObj *a, rectObj *b);
1707
 
MS_DLL_EXPORT int msRectContained(rectObj *a, rectObj *b);
1708
 
 
1709
 
MS_DLL_EXPORT void msRectToFormattedString(rectObj *rect, char *format,
1710
 
                                           char *buffer, int buffer_length);
1711
 
MS_DLL_EXPORT void msPointToFormattedString(pointObj *point, const char*format,
1712
 
                                           char *buffer, int buffer_length);
1713
 
 
1714
 
MS_DLL_EXPORT void msMergeRect(rectObj *a, rectObj *b);
1715
 
MS_DLL_EXPORT double msDistancePointToPoint(pointObj *a, pointObj *b);
1716
 
MS_DLL_EXPORT double msSquareDistancePointToPoint(pointObj *a, pointObj *b);
1717
 
MS_DLL_EXPORT double msDistancePointToSegment(pointObj *p, pointObj *a, pointObj *b);
1718
 
MS_DLL_EXPORT double msSquareDistancePointToSegment(pointObj *p, pointObj *a, pointObj *b);
1719
 
MS_DLL_EXPORT double msDistancePointToShape(pointObj *p, shapeObj *shape);
1720
 
MS_DLL_EXPORT double msSquareDistancePointToShape(pointObj *p, shapeObj *shape);
1721
 
MS_DLL_EXPORT double msDistanceSegmentToSegment(pointObj *pa, pointObj *pb, pointObj *pc, pointObj *pd);
1722
 
MS_DLL_EXPORT double msDistanceShapeToShape(shapeObj *shape1, shapeObj *shape2);
1723
 
MS_DLL_EXPORT int msIntersectSegments(pointObj *a, pointObj *b, pointObj *c, pointObj *d);
1724
 
MS_DLL_EXPORT int msPointInPolygon(pointObj *p, lineObj *c);
1725
 
MS_DLL_EXPORT int msIntersectMultipointPolygon(shapeObj *multipoint, shapeObj *polygon);
1726
 
MS_DLL_EXPORT int msIntersectPointPolygon(pointObj *p, shapeObj *polygon);
1727
 
MS_DLL_EXPORT int msIntersectPolylinePolygon(shapeObj *line, shapeObj *poly);
1728
 
MS_DLL_EXPORT int msIntersectPolygons(shapeObj *p1, shapeObj *p2);
1729
 
MS_DLL_EXPORT int msIntersectPolylines(shapeObj *line1, shapeObj *line2);
1730
 
 
1731
 
MS_DLL_EXPORT int msInitQuery(queryObj *query); /* in mapquery.c */
1732
 
MS_DLL_EXPORT void msFreeQuery(queryObj *query);
1733
 
MS_DLL_EXPORT int msSaveQuery(mapObj *map, char *filename);
1734
 
MS_DLL_EXPORT int msLoadQuery(mapObj *map, char *filename);
1735
 
MS_DLL_EXPORT int msExecuteQuery(mapObj *map);
1736
 
 
1737
 
MS_DLL_EXPORT int msQueryByIndex(mapObj *map); /* various query methods, all rely on the queryObj hung off the mapObj */
1738
 
MS_DLL_EXPORT int msQueryByAttributes(mapObj *map);
1739
 
MS_DLL_EXPORT int msQueryByPoint(mapObj *map);
1740
 
MS_DLL_EXPORT int msQueryByRect(mapObj *map);
1741
 
MS_DLL_EXPORT int msQueryByFeatures(mapObj *map);
1742
 
MS_DLL_EXPORT int msQueryByShape(mapObj *map);
1743
 
MS_DLL_EXPORT int msQueryByOperator(mapObj *map);
1744
 
 
1745
 
MS_DLL_EXPORT int msGetQueryResultBounds(mapObj *map, rectObj *bounds);
1746
 
MS_DLL_EXPORT int msIsLayerQueryable(layerObj *lp);
1747
 
MS_DLL_EXPORT void msQueryFree(mapObj *map, int qlayer); /* todo: rename */
1748
 
MS_DLL_EXPORT int msRasterQueryByShape(mapObj *map, layerObj *layer, shapeObj *selectshape);
1749
 
MS_DLL_EXPORT int msRasterQueryByRect(mapObj *map, layerObj *layer, rectObj queryRect);
1750
 
MS_DLL_EXPORT int msRasterQueryByPoint(mapObj *map, layerObj *layer, int mode, pointObj p, double buffer, int maxresults );
1751
 
 
1752
 
/* in mapstring.c */
1753
 
MS_DLL_EXPORT void msStringTrim(char *str); 
1754
 
MS_DLL_EXPORT void msStringTrimBlanks(char *string); 
1755
 
MS_DLL_EXPORT char *msStringTrimLeft(char *string);
1756
 
MS_DLL_EXPORT char *msStringChop(char *string);
1757
 
MS_DLL_EXPORT void msStringTrimEOL(char *string);
1758
 
MS_DLL_EXPORT char *msReplaceSubstring(char *str, const char *old, const char *sznew);
1759
 
MS_DLL_EXPORT void msReplaceChar(char *str, char old, char sznew);
1760
 
MS_DLL_EXPORT char *msCaseReplaceSubstring(char *str, const char *old, const char *sznew);
1761
 
MS_DLL_EXPORT char *msStripPath(char *fn);
1762
 
MS_DLL_EXPORT char *msGetPath(char *fn);
1763
 
MS_DLL_EXPORT char *msBuildPath(char *pszReturnPath, const char *abs_path, const char *path);
1764
 
MS_DLL_EXPORT char *msBuildPath3(char *pszReturnPath, const char *abs_path, const char *path1, const char *path2);
1765
 
MS_DLL_EXPORT char *msTryBuildPath(char *szReturnPath, const char *abs_path, const char *path);
1766
 
MS_DLL_EXPORT char *msTryBuildPath3(char *szReturnPath, const char *abs_path, const char *path1, const char *path2);
1767
 
MS_DLL_EXPORT char **msStringSplit(const char *string, char cd, int *num_tokens);
1768
 
MS_DLL_EXPORT char **msStringTokenize( const char *pszLine, const char *pszDelim, int *num_tokens, int preserve_quote);
1769
 
MS_DLL_EXPORT int msCountChars(char *str, char ch);
1770
 
MS_DLL_EXPORT char *msLongToString(long value);
1771
 
MS_DLL_EXPORT char *msDoubleToString(double value, int force_f);
1772
 
MS_DLL_EXPORT char *msIntToString(int value);
1773
 
MS_DLL_EXPORT void msStringToUpper(char *string);
1774
 
MS_DLL_EXPORT void msStringToLower(char *string);
1775
 
MS_DLL_EXPORT int msEncodeChar(const char);
1776
 
MS_DLL_EXPORT char *msEncodeUrlExcept(const char*, const char);
1777
 
MS_DLL_EXPORT char *msEncodeUrl(const char*);
1778
 
MS_DLL_EXPORT char *msEncodeHTMLEntities(const char *string);
1779
 
MS_DLL_EXPORT void msDecodeHTMLEntities(const char *string);
1780
 
MS_DLL_EXPORT int msIsXMLTagValid(const char *string);
1781
 
MS_DLL_EXPORT char *msStringConcatenate(char *pszDest, char *pszSrc);
1782
 
MS_DLL_EXPORT char *msJoinStrings(char **array, int arrayLength, const char *delimeter);
1783
 
MS_DLL_EXPORT char *msHashString(const char *pszStr);
1784
 
MS_DLL_EXPORT char *msCommifyString(char *str);
1785
 
MS_DLL_EXPORT const char *msCaseFindSubstring(const char *haystack, const char *needle);
1786
 
MS_DLL_EXPORT int msHexToInt(char *hex);
1787
 
MS_DLL_EXPORT char *msGetEncodedString(const char *string, const char *encoding);
1788
 
MS_DLL_EXPORT char *msConvertWideStringToUTF8 (const wchar_t* string, const char* encoding);
1789
 
MS_DLL_EXPORT int msGetNextGlyph(const char **in_ptr, char *out_string);
1790
 
MS_DLL_EXPORT int msGetNumGlyphs(const char *in_ptr);
1791
 
MS_DLL_EXPORT int msGetUnicodeEntity(const char *inptr, int *unicode);
1792
 
MS_DLL_EXPORT int msStringIsInteger(const char *string);
1793
 
MS_DLL_EXPORT int msUTF8ToUniChar(const char *str, int *chPtr); /* maptclutf.c */
1794
 
MS_DLL_EXPORT char* msGetFirstLine(char* text);
1795
 
 
1796
 
#ifdef NEED_STRDUP
1797
 
MS_DLL_EXPORT char *strdup(char *s);
1798
 
#endif /* NEED_STRDUP */
1799
 
 
1800
 
#ifdef NEED_STRRSTR
1801
 
MS_DLL_EXPORT char *strrstr(char *string, char *find);
1802
 
#endif /* NEED_STRRSTR */
1803
 
 
1804
 
#ifdef NEED_STRCASESTR
1805
 
MS_DLL_EXPORT char *strcasestr(const char *s, const char *find);
1806
 
#endif /* NEED_STRCASESTR */
1807
 
 
1808
 
#ifdef NEED_STRNCASECMP
1809
 
MS_DLL_EXPORT int strncasecmp(const char *s1, const char *s2, int len);
1810
 
#endif /* NEED_STRNCASECMP */
1811
 
 
1812
 
#ifdef NEED_STRCASECMP
1813
 
MS_DLL_EXPORT int strcasecmp(const char *s1, const char *s2);
1814
 
#endif /* NEED_STRCASECMP */
1815
 
 
1816
 
#ifdef NEED_STRLCAT
1817
 
MS_DLL_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
1818
 
#endif /* NEED_STRLCAT */
1819
 
 
1820
 
/* in mapsymbol.c */
1821
 
/* Use this function *only* with mapfile loading phase */
1822
 
MS_DLL_EXPORT int loadSymbolSet(symbolSetObj *symbolset, mapObj *map);
1823
 
/* Use this threadsafe wrapper everywhere else */
1824
 
MS_DLL_EXPORT int msLoadSymbolSet(symbolSetObj *symbolset, mapObj *map);
1825
 
MS_DLL_EXPORT int msCopySymbol(symbolObj *dst, symbolObj *src, mapObj *map);
1826
 
MS_DLL_EXPORT int msCopySymbolSet(symbolSetObj *dst, symbolSetObj *src, mapObj *map);
1827
 
MS_DLL_EXPORT void msInitSymbolSet(symbolSetObj *symbolset);
1828
 
MS_DLL_EXPORT symbolObj *msGrowSymbolSet( symbolSetObj *symbolset );
1829
 
MS_DLL_EXPORT int msAddImageSymbol(symbolSetObj *symbolset, char *filename);
1830
 
MS_DLL_EXPORT int msFreeSymbolSet(symbolSetObj *symbolset);
1831
 
MS_DLL_EXPORT int msFreeSymbol(symbolObj *symbol);
1832
 
MS_DLL_EXPORT int msAddNewSymbol(mapObj *map, char *name);
1833
 
MS_DLL_EXPORT int msAppendSymbol(symbolSetObj *symbolset, symbolObj *symbol);
1834
 
MS_DLL_EXPORT symbolObj *msRemoveSymbol(symbolSetObj *symbolset, int index);
1835
 
MS_DLL_EXPORT int msSaveSymbolSet(symbolSetObj *symbolset, const char *filename);
1836
 
MS_DLL_EXPORT int msLoadImageSymbol(symbolObj *symbol, const char *filename);
1837
 
MS_DLL_EXPORT symbolObj *msRotateSymbol(symbolObj *symbol, double angle);
1838
 
 
1839
 
MS_DLL_EXPORT imageObj *msSymbolGetImageGD(symbolObj *symbol, outputFormatObj *format);
1840
 
MS_DLL_EXPORT int msSymbolSetImageGD(symbolObj *symbol, imageObj *image);
1841
 
 
1842
 
MS_DLL_EXPORT int msGetMarkerSize(symbolSetObj *symbolset, styleObj *style, int *width, int *height, double scalefactor);
1843
 
MS_DLL_EXPORT int msGetCharacterSize(char *character, int size, char *font, rectObj *rect);
1844
 
MS_DLL_EXPORT double msSymbolGetDefaultSize(symbolObj *s);
1845
 
MS_DLL_EXPORT void freeImageCache(struct imageCacheObj *ic);
1846
 
 
1847
 
MS_DLL_EXPORT imageObj *msDrawLegend(mapObj *map, int scale_independent); /* in maplegend.c */
1848
 
MS_DLL_EXPORT int msLegendCalcSize(mapObj *map, int scale_independent, int *size_x, int *size_y, layerObj *lp);
1849
 
MS_DLL_EXPORT int msEmbedLegend(mapObj *map, imageObj *img);
1850
 
MS_DLL_EXPORT int msDrawLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height, imageObj *img, int dstX, int dstY);
1851
 
MS_DLL_EXPORT imageObj *msCreateLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height);
1852
 
   
1853
 
MS_DLL_EXPORT int msLoadFontSet(fontSetObj *fontSet, mapObj *map); /* in maplabel.c */
1854
 
MS_DLL_EXPORT int msInitFontSet(fontSetObj *fontset);
1855
 
MS_DLL_EXPORT int msFreeFontSet(fontSetObj *fontset);
1856
 
MS_DLL_EXPORT char *msTransformLabelText(mapObj *map, imageObj* image, labelObj *label, char *text);
1857
 
MS_DLL_EXPORT int msGetLabelSize(imageObj *img, char *string, labelObj *label, rectObj *rect, fontSetObj *fontSet, double scalefactor, int adjustBaseline,double **advances);
1858
 
MS_DLL_EXPORT int msAddLabel(mapObj *map, int layerindex, int classindex, shapeObj *shape, pointObj *point, labelPathObj *labelpath, char *string, double featuresize, labelObj *label);
1859
 
MS_DLL_EXPORT void msTestLabelCacheCollisions(labelCacheObj *labelcache, labelObj *labelPtr, int mapwidth, int mapheight, int buffer, labelCacheMemberObj *cachePtr, int current_priority, int current_label, int mindistance, double label_size);
1860
 
MS_DLL_EXPORT labelCacheMemberObj *msGetLabelCacheMember(labelCacheObj *labelcache, int i);
1861
 
 
1862
 
MS_DLL_EXPORT gdFontPtr msGetBitmapFont(int size);
1863
 
MS_DLL_EXPORT int msImageTruetypePolyline(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
1864
 
MS_DLL_EXPORT int msImageTruetypeArrow(symbolSetObj *symbolset, gdImagePtr img, shapeObj *p, styleObj *style, double scalefactor);
1865
 
 
1866
 
MS_DLL_EXPORT void msFreeShape(shapeObj *shape); /* in mapprimitive.c */
1867
 
MS_DLL_EXPORT void msFreeLabelPathObj(labelPathObj *path);
1868
 
MS_DLL_EXPORT shapeObj *msShapeFromWKT(const char *string);
1869
 
MS_DLL_EXPORT char *msShapeToWKT(shapeObj *shape);
1870
 
MS_DLL_EXPORT void msInitShape(shapeObj *shape);
1871
 
MS_DLL_EXPORT void msShapeDeleteLine( shapeObj *shape, int line );
1872
 
MS_DLL_EXPORT int msCopyShape(shapeObj *from, shapeObj *to);
1873
 
MS_DLL_EXPORT int *msGetOuterList(shapeObj *shape);
1874
 
MS_DLL_EXPORT int *msGetInnerList(shapeObj *shape, int r, int *outerlist);
1875
 
MS_DLL_EXPORT void msComputeBounds(shapeObj *shape);
1876
 
MS_DLL_EXPORT void msRectToPolygon(rectObj rect, shapeObj *poly);
1877
 
MS_DLL_EXPORT void msClipPolylineRect(shapeObj *shape, rectObj rect);
1878
 
MS_DLL_EXPORT void msClipPolygonRect(shapeObj *shape, rectObj rect);
1879
 
MS_DLL_EXPORT void msTransformShape(shapeObj *shape, rectObj extent, double cellsize, imageObj *image);
1880
 
MS_DLL_EXPORT void msOffsetPointRelativeTo(pointObj *point, layerObj *layer);
1881
 
MS_DLL_EXPORT void msOffsetShapeRelativeTo(shapeObj *shape, layerObj *layer);
1882
 
MS_DLL_EXPORT void msTransformShapeToPixel(shapeObj *shape, rectObj extent, double cellsize);
1883
 
MS_DLL_EXPORT void msTransformPixelToShape(shapeObj *shape, rectObj extent, double cellsize);
1884
 
MS_DLL_EXPORT void msImageCartographicPolyline(gdImagePtr im, shapeObj *p, styleObj *style, symbolObj *symbol, int c, double size, double scalefactor);
1885
 
MS_DLL_EXPORT void msPolylineComputeLineSegments(shapeObj *shape, double ***segment_lengths, double **line_lengths, int *max_line_index, double *max_line_length, int *segment_index, double *total_length);
1886
 
MS_DLL_EXPORT pointObj** msPolylineLabelPoint(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, int *numpoints, int center_on_longest_segment);
1887
 
MS_DLL_EXPORT pointObj** msPolylineLabelPointExtended(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, int *numpoints, int *regularLines, int numlines, int center_on_longest_segment);
1888
 
MS_DLL_EXPORT void msPolylineLabelPointLineString(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, double** segment_lengths, 
1889
 
                                                  int line_index, double line_length, double total_length, int segment_index, 
1890
 
                                                  int* labelpoints_index, int* labelpoints_size, pointObj ***labelpoints, int center_on_longest_segment);
1891
 
MS_DLL_EXPORT labelPathObj** msPolylineLabelPath(imageObj *img, shapeObj *p, int min_length, fontSetObj *fontset, char *string, labelObj *label, double scalefactor, int *numpaths, int** regular_lines, int* num_regular_Lines);
1892
 
MS_DLL_EXPORT void msPolylineLabelPathLineString(imageObj *img, shapeObj *p, int min_length, fontSetObj *fontset, char *string, labelObj *label, double scalefactor,
1893
 
                                                 int line_index, double** segment_lengths, double line_length, double total_length, 
1894
 
                                                 int* labelpaths_index, int* labelpaths_size, labelPathObj ***labelpaths, int** regular_lines, int *regular_lines_index, int* regular_lines_size);
1895
 
MS_DLL_EXPORT int msPolygonLabelPoint(shapeObj *p, pointObj *lp, double min_dimension);
1896
 
MS_DLL_EXPORT int msAddLine(shapeObj *p, lineObj *new_line);
1897
 
MS_DLL_EXPORT int msAddLineDirectly(shapeObj *p, lineObj *new_line);
1898
 
MS_DLL_EXPORT int msAddPointToLine(lineObj *line, pointObj *point );
1899
 
MS_DLL_EXPORT double msGetPolygonArea(shapeObj *p);
1900
 
MS_DLL_EXPORT int msGetPolygonCentroid(shapeObj *p, pointObj *lp, double *miny, double *maxy);
1901
 
 
1902
 
MS_DLL_EXPORT int msDrawRasterLayer(mapObj *map, layerObj *layer, imageObj *image); /* in mapraster.c */
1903
 
MS_DLL_EXPORT imageObj *msDrawReferenceMap(mapObj *map);
1904
 
 
1905
 
MS_DLL_EXPORT size_t msGetBitArraySize(int numbits); /* in mapbits.c */
1906
 
MS_DLL_EXPORT ms_bitarray msAllocBitArray(int numbits);
1907
 
MS_DLL_EXPORT int msGetBit(ms_bitarray array, int index);
1908
 
MS_DLL_EXPORT void msSetBit(ms_bitarray array, int index, int value);
1909
 
MS_DLL_EXPORT void msSetAllBits(ms_bitarray array, int index, int value);
1910
 
MS_DLL_EXPORT void msFlipBit(ms_bitarray array, int index);
1911
 
MS_DLL_EXPORT int msGetNextBit(ms_bitarray array, int index, int size);
1912
 
 
1913
 
MS_DLL_EXPORT int msLayerInitItemInfo(layerObj *layer);
1914
 
MS_DLL_EXPORT void msLayerFreeItemInfo(layerObj *layer); 
1915
 
 
1916
 
MS_DLL_EXPORT int msLayerOpen(layerObj *layer); /* in maplayer.c */
1917
 
MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
1918
 
MS_DLL_EXPORT void msLayerClose(layerObj *layer);
1919
 
MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
1920
 
MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int get_all, char *metadata); 
1921
 
MS_DLL_EXPORT int msLayerNextShape(layerObj *layer, shapeObj *shape);
1922
 
MS_DLL_EXPORT int msLayerGetItems(layerObj *layer);
1923
 
MS_DLL_EXPORT int msLayerSetItems(layerObj *layer, char **items, int numitems);
1924
 
MS_DLL_EXPORT int msLayerResultsGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1925
 
MS_DLL_EXPORT int msLayerGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1926
 
MS_DLL_EXPORT int msLayerGetExtent(layerObj *layer, rectObj *extent);
1927
 
MS_DLL_EXPORT int msLayerSetExtent( layerObj *layer, double minx, double miny, double maxx, double maxy);
1928
 
MS_DLL_EXPORT int msLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, int tile, long record);
1929
 
MS_DLL_EXPORT void msLayerAddProcessing( layerObj *layer, const char *directive );
1930
 
MS_DLL_EXPORT void msLayerSetProcessingKey( layerObj *layer, const char *key, 
1931
 
                                            const char *value);
1932
 
MS_DLL_EXPORT char *msLayerGetProcessing( layerObj *layer, int proc_index);
1933
 
MS_DLL_EXPORT char *msLayerGetProcessingKey( layerObj *layer, const char *);
1934
 
MS_DLL_EXPORT int msLayerClearProcessing( layerObj *layer );
1935
 
MS_DLL_EXPORT char* msLayerGetFilterString( layerObj *layer );
1936
 
 
1937
 
MS_DLL_EXPORT int msLayerSetTimeFilter(layerObj *lp, const char *timestring, 
1938
 
                                       const char *timefield);
1939
 
/* Helper functions for layers */ 
1940
 
MS_DLL_EXPORT int msLayerMakeBackticsTimeFilter(layerObj *lp, const char *timestring, 
1941
 
                                                 const char *timefield);
1942
 
 
1943
 
MS_DLL_EXPORT int msLayerMakePlainTimeFilter(layerObj *lp, const char *timestring, 
1944
 
                                             const char *timefield);
1945
 
 
1946
 
MS_DLL_EXPORT int msLayerApplyCondSQLFilterToLayer(FilterEncodingNode *psNode, mapObj *map, 
1947
 
                                                   int iLayerIndex, int bOnlySpatialFilter);
1948
 
 
1949
 
MS_DLL_EXPORT int msLayerApplyPlainFilterToLayer(FilterEncodingNode *psNode, mapObj *map, 
1950
 
                                                 int iLayerIndex, int bOnlySpatialFilter);
1951
 
 
1952
 
 
1953
 
/* maplayer.c */
1954
 
MS_DLL_EXPORT int msLayerGetNumFeatures(layerObj *layer);
1955
 
 
1956
 
/* These are special because SWF is using these */
1957
 
int msOGRLayerNextShape(layerObj *layer, shapeObj *shape);
1958
 
int msOGRLayerGetItems(layerObj *layer);
1959
 
void msOGRLayerFreeItemInfo(layerObj *layer);
1960
 
int msOGRLayerGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1961
 
int msOGRLayerResultGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1962
 
int msOGRLayerGetExtent(layerObj *layer, rectObj *extent);
1963
 
 
1964
 
#ifdef USE_OGR
1965
 
MS_DLL_EXPORT int msOGRGeometryToShape(OGRGeometryH hGeometry, shapeObj *shape,
1966
 
                         OGRwkbGeometryType type);
1967
 
#endif /* USE_OGR */
1968
 
 
1969
 
MS_DLL_EXPORT int drawSDE(mapObj *map, layerObj *layer, gdImagePtr img);
1970
 
 
1971
 
MS_DLL_EXPORT int msInitializeVirtualTable(layerObj *layer);
1972
 
MS_DLL_EXPORT int msConnectLayer(layerObj *layer, const int connectiontype, 
1973
 
                                 const char *library_str);
1974
 
 
1975
 
MS_DLL_EXPORT int msINLINELayerInitializeVirtualTable(layerObj *layer);
1976
 
MS_DLL_EXPORT int msShapeFileLayerInitializeVirtualTable(layerObj *layer);
1977
 
MS_DLL_EXPORT int msTiledSHPLayerInitializeVirtualTable(layerObj *layer);
1978
 
MS_DLL_EXPORT int msSDELayerInitializeVirtualTable(layerObj *layer);
1979
 
MS_DLL_EXPORT int msOGRLayerInitializeVirtualTable(layerObj *layer);
1980
 
MS_DLL_EXPORT int msPostGISLayerInitializeVirtualTable(layerObj *layer);
1981
 
MS_DLL_EXPORT int msOracleSpatialLayerInitializeVirtualTable(layerObj *layer);
1982
 
MS_DLL_EXPORT int msWFSLayerInitializeVirtualTable(layerObj *layer);
1983
 
MS_DLL_EXPORT int msGraticuleLayerInitializeVirtualTable(layerObj *layer);
1984
 
MS_DLL_EXPORT int msMYGISLayerInitializeVirtualTable(layerObj *layer);
1985
 
MS_DLL_EXPORT int msRASTERLayerInitializeVirtualTable(layerObj *layer);
1986
 
MS_DLL_EXPORT int msPluginLayerInitializeVirtualTable(layerObj *layer);
1987
 
 
1988
 
/* ==================================================================== */
1989
 
/*      Prototypes for functions in mapdraw.c                           */
1990
 
/* ==================================================================== */
1991
 
MS_DLL_EXPORT void msClearLayerPenValues(layerObj *layer);
1992
 
MS_DLL_EXPORT void msClearScalebarPenValues(scalebarObj *scalebar);
1993
 
MS_DLL_EXPORT void msClearLegendPenValues(legendObj *legend);
1994
 
MS_DLL_EXPORT void msClearReferenceMapPenValues(referenceMapObj *referencemap);
1995
 
MS_DLL_EXPORT void msClearQueryMapPenValues(queryMapObj *querymap);
1996
 
MS_DLL_EXPORT void msClearPenValues(mapObj *map);
1997
 
 
1998
 
MS_DLL_EXPORT imageObj *msPrepareImage(mapObj *map, int allow_nonsquare);
1999
 
MS_DLL_EXPORT imageObj *msDrawMap(mapObj *map, int querymap);
2000
 
MS_DLL_EXPORT int msLayerIsVisible(mapObj *map, layerObj *layer);
2001
 
MS_DLL_EXPORT int msDrawLayer(mapObj *map, layerObj *layer, imageObj *image);
2002
 
MS_DLL_EXPORT int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image);
2003
 
MS_DLL_EXPORT int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image);
2004
 
MS_DLL_EXPORT int msDrawWMSLayer(mapObj *map, layerObj *layer, imageObj *image);
2005
 
MS_DLL_EXPORT int msDrawWFSLayer(mapObj *map, layerObj *layer, imageObj *image);
2006
 
MS_DLL_EXPORT int msDrawShape(mapObj *map, layerObj *layer, shapeObj *shape, imageObj *image, int style, int querymapMode);
2007
 
MS_DLL_EXPORT int msDrawPoint(mapObj *map, layerObj *layer, pointObj *point, imageObj *image, int classindex, char *labeltext);
2008
 
 
2009
 
  /*Range Support*/
2010
 
MS_DLL_EXPORT int msShapeToRange(styleObj *style, shapeObj *shape);
2011
 
MS_DLL_EXPORT int msValueToRange(styleObj *style, double fieldVal);
2012
 
 
2013
 
MS_DLL_EXPORT void msCircleDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2014
 
MS_DLL_EXPORT void msCircleDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2015
 
MS_DLL_EXPORT void msDrawMarkerSymbol(symbolSetObj *symbolset,imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2016
 
MS_DLL_EXPORT void msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2017
 
MS_DLL_EXPORT void msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2018
 
 
2019
 
MS_DLL_EXPORT int msDrawLabel(mapObj *map, imageObj *image, pointObj labelPnt, char *string, labelObj *label, double scalefactor);
2020
 
MS_DLL_EXPORT int msDrawText(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2021
 
MS_DLL_EXPORT int msDrawTextLine(imageObj *image, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2022
 
MS_DLL_EXPORT int msDrawLabelCache(imageObj *image, mapObj *map);
2023
 
 
2024
 
MS_DLL_EXPORT void msImageStartLayer(mapObj *map, layerObj *layer, imageObj *image);
2025
 
MS_DLL_EXPORT void msImageEndLayer(mapObj *map, layerObj *layer, imageObj *image);
2026
 
 
2027
 
MS_DLL_EXPORT void msDrawStartShape(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2028
 
MS_DLL_EXPORT void msDrawEndShape(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2029
 
/* ==================================================================== */
2030
 
/*      End of Prototypes for functions in mapdraw.c                    */
2031
 
/* ==================================================================== */
2032
 
 
2033
 
/* ==================================================================== */
2034
 
/*      Prototypes for functions in mapimagemap.c                       */
2035
 
/* ==================================================================== */
2036
 
MS_DLL_EXPORT imageObj *msImageCreateIM(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2037
 
MS_DLL_EXPORT imageObj *msImageLoadIM( const char *filename );
2038
 
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
2039
 
MS_DLL_EXPORT imageObj *msImageLoadGDCtx( gdIOCtx *ctx, const char *driver );
2040
 
MS_DLL_EXPORT void msImageInitIM( imageObj *image );
2041
 
MS_DLL_EXPORT void msImageStartLayerIM(mapObj *map, layerObj *layer, imageObj *image);
2042
 
MS_DLL_EXPORT int msSaveImageIM(imageObj* img, char *filename, outputFormatObj *format);
2043
 
MS_DLL_EXPORT int msSaveImageIM_LL(imageObj* img, char *filename, int type, int transparent, int interlace, int quality);
2044
 
MS_DLL_EXPORT void msFreeImagexsIM(imageObj* img);
2045
 
MS_DLL_EXPORT void msFreeImageIM(imageObj* img);
2046
 
MS_DLL_EXPORT void msCircleDrawLineSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, double r, styleObj *style, double scalefactor);
2047
 
MS_DLL_EXPORT void msCircleDrawShadeSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, double r, styleObj *style, double scalefactor);
2048
 
MS_DLL_EXPORT void msDrawMarkerSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, styleObj *style, double scalefactor);
2049
 
MS_DLL_EXPORT void msDrawLineSymbolIM(symbolSetObj *symbolset, imageObj* img, shapeObj *p, styleObj *style, double scalefactor);
2050
 
MS_DLL_EXPORT void msDrawShadeSymbolIM(symbolSetObj *symbolset, imageObj* img, shapeObj *p, styleObj *style, double scalefactor);
2051
 
MS_DLL_EXPORT int msDrawTextIM(imageObj* img, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2052
 
MS_DLL_EXPORT int msDrawLabelCacheIM(imageObj* img, mapObj *map);
2053
 
/* ==================================================================== */
2054
 
/*      End of Prototypes for functions in mapimagemap.c                */
2055
 
/* ==================================================================== */
2056
 
 
2057
 
/* ==================================================================== */
2058
 
/*      Prototypes for functions in mapgd.c                             */
2059
 
/* ==================================================================== */
2060
 
MS_DLL_EXPORT imageObj *msImageLoadGDCtx(gdIOCtx* ctx, const char *driver);
2061
 
MS_DLL_EXPORT int msCompareColors(colorObj *c1, colorObj *c2);
2062
 
MS_DLL_EXPORT void msPreAllocateColorsGD(imageObj *image, mapObj *map);
2063
 
MS_DLL_EXPORT imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2064
 
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
2065
 
MS_DLL_EXPORT void msImageInitGD( imageObj *image, colorObj *background );
2066
 
MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
2067
 
 
2068
 
#define RESOLVE_PEN_GD(img,color) { if( (color).pen == MS_PEN_UNSET ) msImageSetPenGD( img, &(color) ); }
2069
 
 
2070
 
MS_DLL_EXPORT gdIOCtx *msNewGDFileCtx(FILE *file);
2071
 
MS_DLL_EXPORT int msSaveImageGD(imageObj *img, char *filename, outputFormatObj *format);
2072
 
MS_DLL_EXPORT unsigned char *msSaveImageBufferGD(imageObj *img, int *bufsize, outputFormatObj *format);
2073
 
MS_DLL_EXPORT int msSaveImageGDCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
2074
 
MS_DLL_EXPORT int msSaveImageGD_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
2075
 
MS_DLL_EXPORT void msFreeImageGD(imageObj *img);
2076
 
 
2077
 
MS_DLL_EXPORT void msCircleDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
2078
 
MS_DLL_EXPORT void msCircleDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
2079
 
MS_DLL_EXPORT void msDrawMarkerSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, styleObj *style, double scalefactor);
2080
 
MS_DLL_EXPORT void msDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
2081
 
MS_DLL_EXPORT void msDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
2082
 
 
2083
 
MS_DLL_EXPORT int msDrawTextGD(imageObj *img, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2084
 
MS_DLL_EXPORT int msDrawTextLineGD(imageObj *img, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2085
 
 
2086
 
MS_DLL_EXPORT void msImageCopyMerge (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct);
2087
 
MS_DLL_EXPORT void msImageCopyMergeNoAlpha (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct, colorObj *transparent);
2088
 
 
2089
 
#ifdef USE_AGG
2090
 
/* ==================================================================== */
2091
 
/*      Prototypes for functions in mapagg.cpp                          */
2092
 
/* ==================================================================== */
2093
 
 
2094
 
MS_DLL_EXPORT imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2095
 
MS_DLL_EXPORT void msImageInitAGG( imageObj *image, colorObj *background );
2096
 
 
2097
 
MS_DLL_EXPORT int msSaveImageAGG(imageObj *img, char *filename, outputFormatObj *format);
2098
 
MS_DLL_EXPORT unsigned char *msSaveImageBufferAGG(imageObj *img, int *bufsize, outputFormatObj *format);
2099
 
MS_DLL_EXPORT int msSaveImageAGGCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
2100
 
MS_DLL_EXPORT int msSaveImageAGG_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
2101
 
MS_DLL_EXPORT void msFreeImageAGG(imageObj *img);
2102
 
 
2103
 
MS_DLL_EXPORT void msPieSliceAGG(imageObj *image, styleObj *style, double center_x, double center_y, double diameter, double start, double end);
2104
 
MS_DLL_EXPORT void msFilledRectangleAGG (imageObj *image, styleObj *style, double c1_x, double c1_y, double c2_x, double c2_y );
2105
 
MS_DLL_EXPORT void msCircleDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2106
 
MS_DLL_EXPORT void msCircleDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2107
 
MS_DLL_EXPORT void msDrawMarkerSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2108
 
MS_DLL_EXPORT void msDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2109
 
MS_DLL_EXPORT void msDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image,shapeObj *p, styleObj *style, double scalefactor);
2110
 
int msGetTruetypeTextBBoxAGG(imageObj *img, char *font, double size, char *string, rectObj *rect, double **advances);
2111
 
int msGetRasterTextBBoxAGG(imageObj *img, int size, char *string, rectObj *rect);
2112
 
MS_DLL_EXPORT int msDrawTextAGG(imageObj *imgage, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2113
 
 
2114
 
MS_DLL_EXPORT int msDrawTextLineAGG(imageObj *image, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2115
 
 
2116
 
MS_DLL_EXPORT void msTransformShapeAGG(shapeObj *shape, rectObj extent, double cellsize);
2117
 
 
2118
 
MS_DLL_EXPORT void msFreeSymbolCacheAGG(void *buffer);
2119
 
 
2120
 
MS_DLL_EXPORT void msAlphaGD2AGG(imageObj *im);
2121
 
MS_DLL_EXPORT void msAlphaAGG2GD(imageObj *im);
2122
 
MS_DLL_EXPORT void msImageCopyMergeAGG (imageObj *dst, imageObj *src, int pct);
2123
 
#endif  /* USE_AGG  */
2124
 
 
2125
 
/* various JOIN functions (in mapjoin.c) */
2126
 
MS_DLL_EXPORT int msJoinConnect(layerObj *layer, joinObj *join);
2127
 
MS_DLL_EXPORT int msJoinPrepare(joinObj *join, shapeObj *shape);
2128
 
MS_DLL_EXPORT int msJoinNext(joinObj *join);
2129
 
MS_DLL_EXPORT int msJoinClose(joinObj *join);
2130
 
 
2131
 
/*in mapraster.c */
2132
 
MS_DLL_EXPORT int msDrawRasterLayerLow(mapObj *map, layerObj *layer, imageObj *image);
2133
 
MS_DLL_EXPORT int msAddColorGD(mapObj *map, gdImagePtr img, int cmt, int r, int g, int b);
2134
 
#ifdef USE_AGG
2135
 
MS_DLL_EXPORT int msAddColorAGG(mapObj *map, gdImagePtr img, int cmt, int r, int g, int b);
2136
 
#endif
2137
 
MS_DLL_EXPORT int msGetClass(layerObj *layer, colorObj *color);
2138
 
MS_DLL_EXPORT int msGetClass_Float(layerObj *layer, float fValue);
2139
 
 
2140
 
/* in mapdrawgdal.c */
2141
 
MS_DLL_EXPORT int msDrawRasterLayerGDAL(mapObj *map, layerObj *layer, imageObj *image, void *hDSVoid );
2142
 
MS_DLL_EXPORT int msGetGDALGeoTransform(void *hDS, mapObj *map, layerObj *layer, double *padfGeoTransform );
2143
 
MS_DLL_EXPORT int *msGetGDALBandList( layerObj *layer, void *hDS, int max_bands, int *band_count );
2144
 
MS_DLL_EXPORT double msGetGDALNoDataValue( layerObj *layer, void *hBand, int *pbGotNoData );
2145
 
 
2146
 
/* in mapchart.c */
2147
 
MS_DLL_EXPORT int msDrawChartLayer(mapObj *map, layerObj *layer, imageObj *image);
2148
 
 
2149
 
/* ==================================================================== */
2150
 
/*      End of prototypes for functions in mapgd.c                      */
2151
 
/* ==================================================================== */
2152
 
 
2153
 
/* ==================================================================== */
2154
 
/*      Prototypes for functions in maputil.c                           */
2155
 
/* ==================================================================== */
2156
 
 
2157
 
MS_DLL_EXPORT int msExtentsOverlap(mapObj *map, layerObj *layer);
2158
 
 
2159
 
/* For mappdf */
2160
 
MS_DLL_EXPORT int getRgbColor(mapObj *map,int i,int *r,int *g,int *b); /* maputil.c */
2161
 
MS_DLL_EXPORT int msBindLayerToShape(layerObj *layer, shapeObj *shape, int querymapMode);
2162
 
MS_DLL_EXPORT int msValidateContexts(mapObj *map);
2163
 
MS_DLL_EXPORT int msEvalContext(mapObj *map, layerObj *layer, char *context);
2164
 
MS_DLL_EXPORT int msEvalExpression(expressionObj *expression, int itemindex, char **items, int numitems);
2165
 
MS_DLL_EXPORT int msShapeGetClass(layerObj *layer, shapeObj *shape, double scaledenom, int *classgroup, int numclasses);
2166
 
MS_DLL_EXPORT char *msShapeGetAnnotation(layerObj *layer, shapeObj *shape);
2167
 
MS_DLL_EXPORT int msAdjustImage(rectObj rect, int *width, int *height);
2168
 
MS_DLL_EXPORT double msAdjustExtent(rectObj *rect, int width, int height);
2169
 
MS_DLL_EXPORT int msConstrainExtent(rectObj *bounds, rectObj *rect, double overlay);
2170
 
MS_DLL_EXPORT int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *nCount);
2171
 
MS_DLL_EXPORT unsigned char *msSaveImageBuffer(imageObj* image, int *size_ptr, outputFormatObj *format);
2172
 
MS_DLL_EXPORT shapeObj* msOffsetPolyline(shapeObj* shape, double offsetx, double offsety);
2173
 
/* Functions to chnage the drawing order of the layers. */
2174
 
/* Defined in mapobject.c */
2175
 
MS_DLL_EXPORT int msMoveLayerUp(mapObj *map, int nLayerIndex);
2176
 
MS_DLL_EXPORT int msMoveLayerDown(mapObj *map, int nLayerIndex);
2177
 
MS_DLL_EXPORT int msSetLayersdrawingOrder(mapObj *self, int *panIndexes);
2178
 
MS_DLL_EXPORT int msInsertLayer(mapObj *map, layerObj *layer, int nIndex);
2179
 
MS_DLL_EXPORT layerObj *msRemoveLayer(mapObj *map, int nIndex);
2180
 
 
2181
 
/* Defined in layerobject.c */
2182
 
MS_DLL_EXPORT int msInsertClass(layerObj *layer,classObj *classobj,int nIndex);
2183
 
MS_DLL_EXPORT classObj *msRemoveClass(layerObj *layer, int nIndex);
2184
 
MS_DLL_EXPORT int msMoveClassUp(layerObj *layer, int nClassIndex);
2185
 
MS_DLL_EXPORT int msMoveClassDown(layerObj *layer, int nClassIndex);
2186
 
 
2187
 
/* classobject.c */
2188
 
MS_DLL_EXPORT int msMoveStyleUp(classObj *classo, int nStyleIndex);
2189
 
MS_DLL_EXPORT int msMoveStyleDown(classObj *classo, int nStyleIndex);
2190
 
MS_DLL_EXPORT int msDeleteStyle(classObj *classo, int iStyleIndex);
2191
 
MS_DLL_EXPORT int msInsertStyle(classObj *classo, styleObj *style,
2192
 
                                int nStyleIndex);
2193
 
MS_DLL_EXPORT styleObj *msRemoveStyle(classObj *classo, int index);
2194
 
 
2195
 
/* Measured shape utility functions. */
2196
 
MS_DLL_EXPORT pointObj *msGetPointUsingMeasure(shapeObj *shape, double m);
2197
 
MS_DLL_EXPORT pointObj *msGetMeasureUsingPoint(shapeObj *shape, pointObj *point);
2198
 
 
2199
 
MS_DLL_EXPORT char **msGetAllGroupNames(mapObj* map, int *numTok);
2200
 
MS_DLL_EXPORT char *msTmpFile(const char *mappath, const char *tmppath, const char *ext);
2201
 
MS_DLL_EXPORT void msForceTmpFileBase( const char *new_base );
2202
 
 
2203
 
 
2204
 
MS_DLL_EXPORT imageObj *msImageCreate(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2205
 
 
2206
 
MS_DLL_EXPORT int msAlphaBlend (int dst, int src);
2207
 
 
2208
 
MS_DLL_EXPORT int msCheckParentPointer(void* p, char* objname);
2209
 
 
2210
 
MS_DLL_EXPORT int *msAllocateValidClassGroups(layerObj *lp, int *nclasses);
2211
 
/* ==================================================================== */
2212
 
/*      End of prototypes for functions in maputil.c                    */
2213
 
/* ==================================================================== */
2214
 
 
2215
 
 
2216
 
/* ==================================================================== */
2217
 
/*      End of prototypes for functions in mapswf.c                     */
2218
 
/* ==================================================================== */
2219
 
 
2220
 
/* ==================================================================== */
2221
 
 
2222
 
 
2223
 
/* ==================================================================== */
2224
 
/*      prototypes for functions in mapsvg.c                            */
2225
 
/* ==================================================================== */
2226
 
 
2227
 
MS_DLL_EXPORT imageObj *msImageCreateSVG(int width, int height, 
2228
 
                                         outputFormatObj *format, char *imagepath, 
2229
 
                                         char *imageurl, mapObj *map);
2230
 
 
2231
 
MS_DLL_EXPORT void msImageStartLayerSVG(mapObj *map, layerObj *layer, 
2232
 
                                          imageObj *image);
2233
 
 
2234
 
MS_DLL_EXPORT void msDrawLineSymbolSVG(symbolSetObj *symbolset, imageObj *image, 
2235
 
                                       shapeObj *p, styleObj *style, 
2236
 
                                       double scalefactor);
2237
 
MS_DLL_EXPORT void msTransformShapeSVG(shapeObj *shape, rectObj extent, double cellsize,
2238
 
                                       imageObj *image);
2239
 
MS_DLL_EXPORT int msSaveImageSVG(imageObj *image, char *filename);
2240
 
MS_DLL_EXPORT int msSaveImagetoFpSVG(imageObj *image, FILE *fp);
2241
 
MS_DLL_EXPORT void msFreeImageSVG(imageObj *image);
2242
 
 
2243
 
MS_DLL_EXPORT void msDrawMarkerSymbolSVG(symbolSetObj *symbolset, 
2244
 
                                         imageObj *image, 
2245
 
                                         pointObj *p, styleObj *style, 
2246
 
                                         double scalefactor);
2247
 
 
2248
 
MS_DLL_EXPORT int msDrawTextSVG(imageObj *image, pointObj labelPnt, char *string, 
2249
 
                                labelObj *label, fontSetObj *fontset, 
2250
 
                                double scalefactor);
2251
 
MS_DLL_EXPORT int msDrawLabelCacheSVG(imageObj *image, mapObj *map);
2252
 
 
2253
 
MS_DLL_EXPORT int msDrawRasterLayerSVG(mapObj *map, layerObj *layer, 
2254
 
                                       imageObj *image);
2255
 
MS_DLL_EXPORT void msDrawShadeSymbolSVG(symbolSetObj *symbolset, 
2256
 
                                        imageObj *image, shapeObj *p, 
2257
 
                                        styleObj *style, double scalefactor);
2258
 
 
2259
 
 
2260
 
/* ==================================================================== */
2261
 
/*      prototypes for functions in mapoutput.c                         */
2262
 
/* ==================================================================== */
2263
 
 
2264
 
MS_DLL_EXPORT void msApplyDefaultOutputFormats( mapObj * );
2265
 
MS_DLL_EXPORT void msFreeOutputFormat( outputFormatObj * );
2266
 
MS_DLL_EXPORT int msGetOutputFormatIndex(mapObj *map, const char *imagetype);
2267
 
MS_DLL_EXPORT int msRemoveOutputFormat(mapObj *map, const char *imagetype);
2268
 
MS_DLL_EXPORT int msAppendOutputFormat(mapObj *map, outputFormatObj *format);
2269
 
MS_DLL_EXPORT outputFormatObj *msSelectOutputFormat( mapObj *map, const char *imagetype );
2270
 
MS_DLL_EXPORT void msApplyOutputFormat( outputFormatObj **target, outputFormatObj *format, int transparent, int interlaced, int imagequality );
2271
 
MS_DLL_EXPORT const char *msGetOutputFormatOption( outputFormatObj *format, const char *optionkey, const char *defaultresult );
2272
 
MS_DLL_EXPORT outputFormatObj *msCreateDefaultOutputFormat( mapObj *map, const char *driver );
2273
 
MS_DLL_EXPORT int msPostMapParseOutputFormatSetup( mapObj *map );
2274
 
MS_DLL_EXPORT void msSetOutputFormatOption( outputFormatObj *format, const char *key, const char *value );
2275
 
MS_DLL_EXPORT void msGetOutputFormatMimeList( mapObj *map, char **mime_list, int max_mime );
2276
 
MS_DLL_EXPORT void msGetOutputFormatMimeListImg( mapObj *map, char **mime_list, int max_mime );
2277
 
MS_DLL_EXPORT void msGetOutputFormatMimeListWMS( mapObj *map, char **mime_list, int max_mime );
2278
 
MS_DLL_EXPORT outputFormatObj *msCloneOutputFormat( outputFormatObj *format );
2279
 
MS_DLL_EXPORT int msOutputFormatValidate( outputFormatObj *format );
2280
 
 
2281
 
#ifndef gdImageTrueColor
2282
 
#  define gdImageTrueColor(x) (0)
2283
 
#endif /* not gdImageTrueColor */
2284
 
 
2285
 
/* ==================================================================== */
2286
 
/*      prototypes for functions in mapgdal.c                           */
2287
 
/* ==================================================================== */
2288
 
MS_DLL_EXPORT int msSaveImageGDAL( mapObj *map, imageObj *image, char *filename );
2289
 
MS_DLL_EXPORT int msInitDefaultGDALOutputFormat( outputFormatObj *format );
2290
 
 
2291
 
/* ==================================================================== */
2292
 
/*      End of prototypes for functions in mapoutput.c                  */
2293
 
/* ==================================================================== */
2294
 
 
2295
 
/* ==================================================================== */
2296
 
/*      Public prototype for mapogr.cpp functions.                      */
2297
 
/* ==================================================================== */
2298
 
int MS_DLL_EXPORT msOGRLayerWhichShapes(layerObj *layer, rectObj rect);
2299
 
int MS_DLL_EXPORT msOGRLayerOpen(layerObj *layer, const char *pszOverrideConnection); /* in mapogr.cpp */
2300
 
int MS_DLL_EXPORT msOGRLayerClose(layerObj *layer);
2301
 
 
2302
 
char MS_DLL_EXPORT *msOGRShapeToWKT(shapeObj *shape);
2303
 
shapeObj MS_DLL_EXPORT *msOGRShapeFromWKT(const char *string);
2304
 
 
2305
 
/* ==================================================================== */
2306
 
/*      prototypes for functions in mapcopy                             */
2307
 
/* ==================================================================== */
2308
 
MS_DLL_EXPORT int msCopyMap(mapObj *dst, mapObj *src);
2309
 
MS_DLL_EXPORT int msCopyLayer(layerObj *dst, layerObj *src);
2310
 
MS_DLL_EXPORT int msCopyPoint(pointObj *dst, pointObj *src);
2311
 
MS_DLL_EXPORT int msCopyFontSet(fontSetObj *dst, fontSetObj *src, mapObj *map);
2312
 
MS_DLL_EXPORT void copyProperty(void *dst, void *src, int size);
2313
 
MS_DLL_EXPORT char *copyStringProperty(char **dst, char *src);
2314
 
MS_DLL_EXPORT int msCopyClass(classObj *dst, classObj *src, layerObj *layer);
2315
 
MS_DLL_EXPORT int msCopyStyle(styleObj *dst, styleObj *src);
2316
 
 
2317
 
/* ==================================================================== */
2318
 
/*      end prototypes for functions in mapcopy                         */
2319
 
/* ==================================================================== */
2320
 
 
2321
 
/* ==================================================================== */
2322
 
/*      mappool.c: connection pooling API.                              */
2323
 
/* ==================================================================== */
2324
 
MS_DLL_EXPORT void *msConnPoolRequest( layerObj *layer );
2325
 
MS_DLL_EXPORT void msConnPoolRelease( layerObj *layer, void * );
2326
 
MS_DLL_EXPORT void msConnPoolRegister( layerObj *layer,
2327
 
                                        void *conn_handle,
2328
 
                                        void (*close)( void * ) );
2329
 
MS_DLL_EXPORT void msConnPoolCloseUnreferenced( void );
2330
 
MS_DLL_EXPORT void msConnPoolFinalCleanup( void );
2331
 
 
2332
 
/* ==================================================================== */
2333
 
/*      prototypes for functions in mapcpl.c                            */
2334
 
/* ==================================================================== */
2335
 
MS_DLL_EXPORT const char *msGetBasename( const char *pszFullFilename );
2336
 
MS_DLL_EXPORT void *msGetSymbol(const char *pszLibrary, 
2337
 
                                const char *pszEntryPoint);
2338
 
 
2339
 
/* ==================================================================== */
2340
 
/*      include definitions from mapows.h                               */
2341
 
/* ==================================================================== */
2342
 
#include "mapows.h"
2343
 
 
2344
 
/* ==================================================================== */
2345
 
/*      prototypes for functions in mapgeos.c                         */
2346
 
/* ==================================================================== */
2347
 
MS_DLL_EXPORT void msGEOSSetup(void);
2348
 
MS_DLL_EXPORT void msGEOSCleanup(void);
2349
 
MS_DLL_EXPORT void msGEOSFreeGeometry(shapeObj *shape);
2350
 
 
2351
 
MS_DLL_EXPORT shapeObj *msGEOSShapeFromWKT(const char *string);
2352
 
MS_DLL_EXPORT char *msGEOSShapeToWKT(shapeObj *shape);
2353
 
 
2354
 
MS_DLL_EXPORT shapeObj *msGEOSBuffer(shapeObj *shape, double width);
2355
 
MS_DLL_EXPORT shapeObj *msGEOSSimplify(shapeObj *shape, double tolerance);
2356
 
MS_DLL_EXPORT shapeObj *msGEOSTopologyPreservingSimplify(shapeObj *shape, double tolerance);
2357
 
MS_DLL_EXPORT shapeObj *msGEOSConvexHull(shapeObj *shape);
2358
 
MS_DLL_EXPORT shapeObj *msGEOSBoundary(shapeObj *shape);
2359
 
MS_DLL_EXPORT pointObj *msGEOSGetCentroid(shapeObj *shape);
2360
 
MS_DLL_EXPORT shapeObj *msGEOSUnion(shapeObj *shape1, shapeObj *shape2);
2361
 
MS_DLL_EXPORT shapeObj *msGEOSIntersection(shapeObj *shape1, shapeObj *shape2);
2362
 
MS_DLL_EXPORT shapeObj *msGEOSDifference(shapeObj *shape1, shapeObj *shape2);
2363
 
MS_DLL_EXPORT shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2);
2364
 
 
2365
 
MS_DLL_EXPORT int msGEOSContains(shapeObj *shape1, shapeObj *shape2);
2366
 
MS_DLL_EXPORT int msGEOSOverlaps(shapeObj *shape1, shapeObj *shape2);
2367
 
MS_DLL_EXPORT int msGEOSWithin(shapeObj *shape1, shapeObj *shape2);
2368
 
MS_DLL_EXPORT int msGEOSCrosses(shapeObj *shape1, shapeObj *shape2);
2369
 
MS_DLL_EXPORT int msGEOSIntersects(shapeObj *shape1, shapeObj *shape2);
2370
 
MS_DLL_EXPORT int msGEOSTouches(shapeObj *shape1, shapeObj *shape2);
2371
 
MS_DLL_EXPORT int msGEOSEquals(shapeObj *shape1, shapeObj *shape2);
2372
 
MS_DLL_EXPORT int msGEOSDisjoint(shapeObj *shape1, shapeObj *shape2);
2373
 
 
2374
 
MS_DLL_EXPORT double msGEOSArea(shapeObj *shape);
2375
 
MS_DLL_EXPORT double msGEOSLength(shapeObj *shape);
2376
 
MS_DLL_EXPORT double msGEOSDistance(shapeObj *shape1, shapeObj *shape2);
2377
 
 
2378
 
/* ==================================================================== */
2379
 
/*      prototypes for functions in mapcrypto.c                         */
2380
 
/* ==================================================================== */
2381
 
MS_DLL_EXPORT int msGenerateEncryptionKey(unsigned char *k);
2382
 
MS_DLL_EXPORT int msReadEncryptionKeyFromFile(const char *keyfile, unsigned char *k);
2383
 
MS_DLL_EXPORT void msEncryptStringWithKey(const unsigned char *key, const char *in, char *out);
2384
 
MS_DLL_EXPORT void msDecryptStringWithKey(const unsigned char *key, const char *in, char *out);
2385
 
MS_DLL_EXPORT char *msDecryptStringTokens(mapObj *map, const char *in);
2386
 
MS_DLL_EXPORT void msHexEncode(const unsigned char *in, char *out, int numbytes);
2387
 
MS_DLL_EXPORT int msHexDecode(const char *in, unsigned char *out, int numchars);
2388
 
 
2389
 
 
2390
 
/* ==================================================================== */
2391
 
/*      prototypes for functions in mapswf.c                            */
2392
 
/* ==================================================================== */
2393
 
#ifdef USE_MING_FLASH
2394
 
MS_DLL_EXPORT imageObj *msImageCreateSWF(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2395
 
MS_DLL_EXPORT void msImageStartLayerSWF(mapObj *map, layerObj *layer, imageObj *image);
2396
 
MS_DLL_EXPORT int msDrawLabelSWF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2397
 
MS_DLL_EXPORT int msDrawLabelCacheSWF(imageObj *image, mapObj *map);
2398
 
MS_DLL_EXPORT void msDrawLineSymbolSWF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2399
 
MS_DLL_EXPORT void msDrawShadeSymbolSWF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2400
 
MS_DLL_EXPORT void msDrawMarkerSymbolSWF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2401
 
MS_DLL_EXPORT int msDrawRasterLayerSWF(mapObj *map, layerObj *layer, imageObj *image);
2402
 
MS_DLL_EXPORT int msDrawVectorLayerAsRasterSWF(mapObj *map, layerObj *layer, imageObj*image);
2403
 
#ifdef USE_WMS_LYR 
2404
 
MS_DLL_EXPORT int msDrawWMSLayerSWF(int nLayerId, httpRequestObj *pasReqInfo, int numRequests, mapObj *map, 
2405
 
                                   layerObj *layer, imageObj *image);
2406
 
#endif
2407
 
MS_DLL_EXPORT void msTransformShapeSWF(shapeObj *shape, rectObj extent, double cellsize);
2408
 
MS_DLL_EXPORT int msSaveImageSWF(imageObj *image, char *filename);
2409
 
MS_DLL_EXPORT void msFreeImageSWF(imageObj *image);
2410
 
MS_DLL_EXPORT int draw_textSWF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2411
 
MS_DLL_EXPORT void msDrawStartShapeSWF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2412
 
#endif /* USE_MING_FLASH */
2413
 
 
2414
 
/* ==================================================================== */
2415
 
/*      prototypes for functions in mappdf.c                            */
2416
 
/* ==================================================================== */
2417
 
#ifdef USE_PDF
2418
 
MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash);
2419
 
MS_DLL_EXPORT imageObj *msImageCreatePDF(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2420
 
MS_DLL_EXPORT void msImageStartLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
2421
 
MS_DLL_EXPORT int msDrawLabelPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2422
 
MS_DLL_EXPORT int msDrawLabelCachePDF(imageObj *image, mapObj *map);
2423
 
MS_DLL_EXPORT void msDrawLineSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2424
 
MS_DLL_EXPORT void msDrawShadeSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2425
 
MS_DLL_EXPORT void msDrawMarkerSymbolPDF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2426
 
MS_DLL_EXPORT int msDrawRasterLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
2427
 
MS_DLL_EXPORT int msDrawVectorLayerAsRasterPDF(mapObj *map, layerObj *layer, imageObj*image);
2428
 
MS_DLL_EXPORT void msTransformShapePDF(shapeObj *shape, rectObj extent, double cellsize);
2429
 
MS_DLL_EXPORT int msSaveImagePDF(imageObj *image, char *filename);
2430
 
MS_DLL_EXPORT void msFreeImagePDF(imageObj *image);
2431
 
MS_DLL_EXPORT int msDrawTextPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2432
 
MS_DLL_EXPORT void msDrawStartShapePDF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2433
 
#ifdef USE_WMS_LYR 
2434
 
MS_DLL_EXPORT int msDrawWMSLayerPDF(int nLayerId, httpRequestObj *pasReqInfo, 
2435
 
                      int numRequests, mapObj *map, layerObj *layer, imageObj *image);
2436
 
#endif
2437
 
 
2438
 
#endif /* USE_PDF */
2439
 
 
2440
 
/* ==================================================================== */
2441
 
/*      End of prototypes for functions in mappdf.c                     */
2442
 
/* ==================================================================== */
2443
 
 
2444
 
 
2445
 
/* ==================================================================== */
2446
 
/*      prototypes for functions in maprgbapng.c                        */
2447
 
/* ==================================================================== */
2448
 
#ifdef USE_RGBA_PNG
2449
 
int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx *ctx, outputFormatObj *format);
2450
 
int msSaveImageRGBAPalette(gdImagePtr img, gdIOCtx *ctx ,outputFormatObj *format);
2451
 
#endif /*USE_RGBA_PNG*/
2452
 
/* ==================================================================== */
2453
 
/*      end of prototypes for functions in maprgbapng.c                 */
2454
 
/* ==================================================================== */
2455
 
 
2456
 
/* ==================================================================== */
2457
 
/*      prototypes for functions in mapgeomtransform.c                        */
2458
 
/* ==================================================================== */
2459
 
#define MS_GEOMTRANSFORM_NONE 0
2460
 
#define MS_GEOMTRANSFORM_START 1
2461
 
#define MS_GEOMTRANSFORM_END 2
2462
 
#define MS_GEOMTRANSFORM_VERTICES 3
2463
 
#define MS_GEOMTRANSFORM_BBOX 4
2464
 
#define MS_GEOMTRANSFORM_CENTROID 5
2465
 
#define MS_GEOMTRANSFORM_BUFFER 6
2466
 
#define MS_GEOMTRANSFORM_CONVEXHULL 7
2467
 
 
2468
 
MS_DLL_EXPORT int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image, shapeObj *shape, styleObj *style, double scalefactor);
2469
 
MS_DLL_EXPORT void msStyleSetGeomTransform(styleObj *style, char *transform);
2470
 
MS_DLL_EXPORT char *msStyleGetGeomTransform(styleObj *style);
2471
 
/* ==================================================================== */
2472
 
/*      end of prototypes for functions in mapgeomtransform.c                 */
2473
 
/* ==================================================================== */
2474
 
 
2475
 
 
2476
 
/* ==================================================================== */
2477
 
/*      prototypes for functions in mapgraticule.c                      */
2478
 
/* ==================================================================== */
2479
 
MS_DLL_EXPORT graticuleIntersectionObj *msGraticuleLayerGetIntersectionPoints(mapObj *map, layerObj *layer);
2480
 
MS_DLL_EXPORT void msGraticuleLayerFreeIntersectionPoints( graticuleIntersectionObj *psValue);
2481
 
 
2482
 
/* ==================================================================== */
2483
 
/*      end of prototypes for functions in mapgraticule.c               */
2484
 
/* ==================================================================== */
2485
 
 
2486
 
#endif
2487
 
 
2488
 
 
2489
 
 
2490
 
/*
2491
 
 * strokeStyleObj
2492
 
 */
2493
 
typedef struct {
2494
 
    double width; /* line width in pixels */
2495
 
    
2496
 
    /* line pattern, e.g. dots, dashes, etc.. */
2497
 
    int patternlength;
2498
 
    double pattern[MS_MAXPATTERNLENGTH];
2499
 
    
2500
 
    /* must not be NULL, must be a valid color */
2501
 
    /* color.alpha must be used if supported by the renderer */
2502
 
    colorObj color;
2503
 
 
2504
 
    int linecap; /* MS_CJC_TRIANGLE, MS_CJC_SQUARE, MS_CJC_ROUND, MS_CJC_BUTT */
2505
 
    int linejoin; /* MS_CJC_BEVEL MS_CJC_ROUND MS_CJC_MITER */
2506
 
    double linejoinmaxsize;
2507
 
} strokeStyleObj;
2508
 
 
2509
 
 
2510
 
 
2511
 
/*
2512
 
 * fillStyleObj
2513
 
 */
2514
 
typedef struct {
2515
 
    /* must not be NULL, must be a valid color *
2516
 
     * color.alpha must be used if supported by the renderer */
2517
 
    colorObj color;
2518
 
    
2519
 
 
2520
 
    /* if not null, use the passed tile (which is a pointer to a
2521
 
     * renderer specific structure) for tiling the polygon */
2522
 
    void *tile;
2523
 
 
2524
 
} fillStyleObj;
2525
 
 
2526
 
 
2527
 
/*
2528
 
 * symbolStyleObj
2529
 
 */
2530
 
typedef struct {
2531
 
    /* must not be NULL, must be a valid color */
2532
 
    /* color.alpha must be used if supported by the renderer */
2533
 
    colorObj color;
2534
 
    colorObj backgroundcolor;
2535
 
    
2536
 
    double outlinewidth;
2537
 
    colorObj outlinecolor;
2538
 
 
2539
 
    /* scalefactor to be applied on the tile or symbol*/
2540
 
    double scale;
2541
 
 
2542
 
    /* rotation to apply on the symbol (and the tile?)
2543
 
     * in radians */
2544
 
    double rotation;
2545
 
} symbolStyleObj;
2546
 
 
2547
 
struct tilecache {
2548
 
    symbolObj *symbol;
2549
 
    symbolStyleObj style;
2550
 
    int width;
2551
 
    int height;
2552
 
 
2553
 
    void *data;
2554
 
    tileCacheObj *next;
2555
 
};
2556
 
/*
2557
 
 * labelStyleObj
2558
 
 */
2559
 
typedef struct {
2560
 
    /* full path to truetype font file */
2561
 
    char *font;
2562
 
 
2563
 
    double size;
2564
 
    double rotation;
2565
 
 
2566
 
    colorObj color;
2567
 
    
2568
 
    /* if outlinewidth is > 0, use the outlinecolor */
2569
 
    double outlinewidth;
2570
 
    colorObj outlinecolor;
2571
 
    
2572
 
    /* if shadowsizex or shadowsizey are != 0,
2573
 
     * use the shadowcolor */
2574
 
    double shadowsizex, shadowsizey;
2575
 
    colorObj shadowcolor;
2576
 
 
2577
 
} labelStyleObj;
2578
 
 
2579
 
#ifndef SWIG
2580
 
void msFreeRasterBuffer(rasterBufferObj *b);
2581
 
#endif /* SWIG */
2582
 
 
2583
 
#ifndef SWIG
2584
 
MS_DLL_EXPORT int msInitializeRendererVTable(outputFormatObj *outputformat);
2585
 
MS_DLL_EXPORT int msPopulateRendererVTableCairoRaster( rendererVTableObj *renderer );
2586
 
MS_DLL_EXPORT int msPopulateRendererVTableCairoSVG( rendererVTableObj *renderer );
2587
 
MS_DLL_EXPORT int msPopulateRendererVTableCairoPDF( rendererVTableObj *renderer );
2588
 
MS_DLL_EXPORT int msPopulateRendererVTableOGL( rendererVTableObj *renderer );
2589
 
 
2590
 
//allocate 50k for starters
2591
 
#define MS_DEFAULT_BUFFER_ALLOC 50000
2592
 
 
2593
 
typedef struct _autobuffer {
2594
 
    unsigned char *data;
2595
 
    size_t size;
2596
 
    size_t available;
2597
 
    size_t _next_allocation_size;
2598
 
} bufferObj;
2599
 
 
2600
 
 
2601
 
int msSaveRasterBuffer(rasterBufferObj *data, FILE *stream,
2602
 
        outputFormatObj *format);
2603
 
int msSaveRasterBufferToBuffer(rasterBufferObj *data, bufferObj *buffer,
2604
 
        outputFormatObj *format);
2605
 
 
2606
 
inline void msBufferInit(bufferObj *buffer);
2607
 
inline void msBufferResize(bufferObj *buffer, size_t target_size);
2608
 
MS_DLL_EXPORT  inline void msBufferFree(bufferObj *buffer);
2609
 
MS_DLL_EXPORT  inline void msBufferAppend(bufferObj *buffer, void *data, size_t length);
2610
 
 
2611
 
struct rendererVTable {
2612
 
        int supports_transparent_layers;
2613
 
    int supports_pixel_buffer;
2614
 
        int supports_imagecache;
2615
 
    
2616
 
    void (*renderLine)(imageObj *img, shapeObj *p, strokeStyleObj *style);
2617
 
    void (*renderPolygon)(imageObj *img, shapeObj *p, colorObj *color);
2618
 
    void (*renderPolygonTiled)(imageObj *img, shapeObj *p, imageObj *tile);
2619
 
    void (*renderLineTiled)(imageObj *img, shapeObj *p, imageObj *tile);
2620
 
 
2621
 
    void (*renderGlyphs)(imageObj *img, double x, double y,
2622
 
            labelStyleObj *style, char *text);
2623
 
 
2624
 
    void (*renderGlyphsLine)(imageObj *img,labelPathObj *labelpath,
2625
 
            labelStyleObj *style, char *text);
2626
 
 
2627
 
    void (*renderVectorSymbol)(imageObj *img, double x, double y,
2628
 
                symbolObj *symbol, symbolStyleObj *style);
2629
 
    
2630
 
    void* (*createVectorSymbolTile)(int width, int height,
2631
 
            symbolObj *symbol, symbolStyleObj *style);
2632
 
 
2633
 
    void (*renderPixmapSymbol)(imageObj *img, double x, double y,
2634
 
                symbolObj *symbol, symbolStyleObj *style);
2635
 
    
2636
 
    void* (*createPixmapSymbolTile)(int width, int height,
2637
 
            symbolObj *symbol, symbolStyleObj *style);
2638
 
 
2639
 
    void (*renderEllipseSymbol)(imageObj *image, double x, double y, 
2640
 
                symbolObj *symbol, symbolStyleObj *style);
2641
 
    
2642
 
    void* (*createEllipseSymbolTile)(int width, int height,
2643
 
            symbolObj *symbol, symbolStyleObj *style);
2644
 
    
2645
 
    void (*renderTruetypeSymbol)(imageObj *img, double x, double y,
2646
 
            symbolObj *symbol, symbolStyleObj *style);
2647
 
 
2648
 
    void* (*createTruetypeSymbolTile)(int width, int height,
2649
 
            symbolObj *symbol, symbolStyleObj *style);
2650
 
 
2651
 
    void (*renderTile)(imageObj *img, imageObj *tile, double x, double y);
2652
 
    
2653
 
    
2654
 
    void (*getRasterBuffer)(imageObj *img,rasterBufferObj *rb);
2655
 
 
2656
 
    void (*mergeRasterBuffer)(imageObj *dest, rasterBufferObj *overlay, double opacity, int dstX, int dstY);
2657
 
    /* image i/o */
2658
 
    imageObj* (*createImage)(int width, int height, outputFormatObj *format, colorObj* bg);
2659
 
    int (*saveImage)(imageObj *img, FILE *fp, outputFormatObj *format);
2660
 
    /*...*/
2661
 
 
2662
 
    /* helper functions */
2663
 
    int (*getTruetypeTextBBox)(imageObj *img,char *font, double size, char *string,
2664
 
                rectObj *rect, double **advances);
2665
 
    
2666
 
        void (*startNewLayer)(imageObj *img, double opacity);
2667
 
        void (*closeNewLayer)(imageObj *img, double opacity);
2668
 
        
2669
 
    void (*transformShape)(shapeObj *shape, rectObj extend, double cellsize);
2670
 
    void (*freeImage)(imageObj *image);
2671
 
    void (*freeTile)(imageObj *tile);
2672
 
    void (*freeSymbol)(symbolObj *symbol);
2673
 
} ;
2674
 
 
2675
 
#endif /* SWIG */
2676
 
 
2677
 
#ifdef __cplusplus
2678
 
}
2679
 
#endif
2680
 
 
2681
 
#endif /* MAP_H */