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

« back to all changes in this revision

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