[mapserver-commits] r11456 - in trunk/mapserver: . mapscript/php

svn at osgeo.org svn at osgeo.org
Mon Apr 4 13:50:20 EDT 2011


Author: aboudreault
Date: 2011-04-04 10:50:20 -0700 (Mon, 04 Apr 2011)
New Revision: 11456

Modified:
   trunk/mapserver/mapscript/php/layer.c
   trunk/mapserver/mapscript/php/mapscript_i.c
   trunk/mapserver/mapscript/php/php_mapscript.h
   trunk/mapserver/mapscript/php/php_mapscript_util.c
   trunk/mapserver/mapserver.h
Log:
clusterObj is always embeded in laye rObj.

Modified: trunk/mapserver/mapscript/php/layer.c
===================================================================
--- trunk/mapserver/mapscript/php/layer.c	2011-04-04 16:42:42 UTC (rev 11455)
+++ trunk/mapserver/mapscript/php/layer.c	2011-04-04 17:50:20 UTC (rev 11456)
@@ -288,6 +288,7 @@
     else IF_GET_OBJECT("offsite", mapscript_ce_color, php_layer->offsite, &php_layer->layer->offsite) 
     else IF_GET_OBJECT("grid",  mapscript_ce_grid, php_layer->grid, (graticuleObj *)(php_layer->layer->layerinfo)) 
     else IF_GET_OBJECT("metadata", mapscript_ce_hashtable, php_layer->metadata, &php_layer->layer->metadata) 
+    else IF_GET_OBJECT("cluster", mapscript_ce_cluster, php_layer->cluster, &php_layer->layer->cluster) 
     else IF_GET_OBJECT("projection", mapscript_ce_projection, php_layer->projection, &php_layer->layer->projection) 
     else 
     {
@@ -353,7 +354,7 @@
               (STRING_EQUAL("grid", property)) ||
               (STRING_EQUAL("metadata", property)) ||
               (STRING_EQUAL("projection", property)) ||
-              (STRING_EQUAL("projection", property)) )
+              (STRING_EQUAL("cluster", property)) )
     {
         mapscript_throw_exception("Property '%s' is an object and can only be modified through its accessors." TSRMLS_CC, property);
     }
@@ -1903,6 +1904,7 @@
     if (php_layer->grid && Z_TYPE_P(php_layer->grid) == IS_OBJECT)
         MAPSCRIPT_DELREF(php_layer->grid);
     MAPSCRIPT_DELREF(php_layer->metadata);
+    MAPSCRIPT_DELREF(php_layer->cluster);
     MAPSCRIPT_DELREF(php_layer->projection);
 }
 /* }}} */
@@ -1990,6 +1992,7 @@
     if (php_layer->grid && Z_TYPE_P(php_layer->grid) == IS_OBJECT)
         MAPSCRIPT_DELREF(php_layer->grid);
     MAPSCRIPT_DELREF(php_layer->metadata);
+    MAPSCRIPT_DELREF(php_layer->cluster);
     MAPSCRIPT_DELREF(php_layer->projection);
 
     if (php_layer->layer && !php_layer->is_ref) {
@@ -2013,6 +2016,7 @@
     php_layer->offsite = NULL;
     php_layer->grid = NULL;
     php_layer->metadata = NULL;
+    php_layer->cluster = NULL;
     php_layer->projection = NULL;
 
     return retval;

Modified: trunk/mapserver/mapscript/php/mapscript_i.c
===================================================================
--- trunk/mapserver/mapscript/php/mapscript_i.c	2011-04-04 16:42:42 UTC (rev 11455)
+++ trunk/mapserver/mapscript/php/mapscript_i.c	2011-04-04 17:50:20 UTC (rev 11456)
@@ -1544,17 +1544,6 @@
  * class extensions clusterObj
  **********************************************************************/
 
-clusterObj *clusterObj_new() {
-    clusterObj *c = (clusterObj *) msSmallMalloc(sizeof(clusterObj));
-    initCluster(c);
-    return c;
-}
-
-void clusterObj_destroy(clusterObj *self)
-{
-    freeCluster(self);
-}
-
 int clusterObj_updateFromString(clusterObj *self, char *snippet) {
     return msUpdateClusterFromString(self, snippet);
 }

Modified: trunk/mapserver/mapscript/php/php_mapscript.h
===================================================================
--- trunk/mapserver/mapscript/php/php_mapscript.h	2011-04-04 16:42:42 UTC (rev 11455)
+++ trunk/mapserver/mapscript/php/php_mapscript.h	2011-04-04 17:50:20 UTC (rev 11456)
@@ -304,6 +304,7 @@
     zval *grid;
     zval *metadata;
     zval *projection;
+    zval *cluster;
     int is_ref;
     layerObj *layer;
 } php_layer_object;
@@ -773,8 +774,6 @@
 
 resultObj *resultObj_new();
 
-clusterObj* clusterObj_new();
-void clusterObj_destroy(clusterObj *self);
 int clusterObj_updateFromString(clusterObj *self, char *snippet);
 int clusterObj_setGroup(clusterObj *self, char *string);
 char *clusterObj_getGroupString(clusterObj *self);

Modified: trunk/mapserver/mapscript/php/php_mapscript_util.c
===================================================================
--- trunk/mapserver/mapscript/php/php_mapscript_util.c	2011-04-04 16:42:42 UTC (rev 11455)
+++ trunk/mapserver/mapscript/php/php_mapscript_util.c	2011-04-04 17:50:20 UTC (rev 11456)
@@ -148,6 +148,8 @@
         mapscript_create_shape((shapeObj*)internal_object, p, layer, *php_object_storage TSRMLS_CC);
     else if (ce == mapscript_ce_layer)
         mapscript_create_layer((layerObj*)internal_object, p, *php_object_storage TSRMLS_CC);
+    else if (ce == mapscript_ce_cluster)
+        mapscript_create_cluster((clusterObj*)internal_object, p, *php_object_storage TSRMLS_CC);
         
     MAPSCRIPT_ADDREF(*php_object_storage);
 

Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h	2011-04-04 16:42:42 UTC (rev 11455)
+++ trunk/mapserver/mapserver.h	2011-04-04 17:50:20 UTC (rev 11456)
@@ -1761,8 +1761,6 @@
 MS_DLL_EXPORT int msUpdateScalebarFromString(scalebarObj *scalebar, char *string, int url_string);
 MS_DLL_EXPORT int msUpdateQueryMapFromString(queryMapObj *querymap, char *string, int url_string);
 MS_DLL_EXPORT int msUpdateLabelFromString(labelObj *label, char *string);
-MS_DLL_EXPORT void initCluster(clusterObj *cluster);
-MS_DLL_EXPORT void freeCluster(clusterObj *cluster);
 MS_DLL_EXPORT int msUpdateClusterFromString(clusterObj *cluster, char *string);
 MS_DLL_EXPORT int msUpdateReferenceMapFromString(referenceMapObj *ref, char *string, int url_string);
 MS_DLL_EXPORT int msUpdateLegendFromString(legendObj *legend, char *string, int url_string);



More information about the mapserver-commits mailing list