[mapserver-commits] r10265 - in trunk/mapserver: . mapscript/php
svn at osgeo.org
svn at osgeo.org
Tue Jun 29 15:29:34 EDT 2010
Author: aboudreault
Date: 2010-06-29 19:29:34 +0000 (Tue, 29 Jun 2010)
New Revision: 10265
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapscript/php/mapscript_i.c
trunk/mapserver/mapscript/php/php_mapscript.h
trunk/mapserver/mapscript/php/style.c
Log:
PHP/MapScript: Expose getGeomTransform/setGeomTransform instead of exposing the private vars for rfc48 (#2825)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2010-06-29 16:20:53 UTC (rev 10264)
+++ trunk/mapserver/HISTORY.TXT 2010-06-29 19:29:34 UTC (rev 10265)
@@ -14,6 +14,8 @@
Current Version (SVN trunk):
----------------------------
+- PHP/MapScript: Expose getGeomTransform/setGeomTransform instead of exposing the private vars for rfc48 (#2825)
+
- PHP/MapScript: Fixed updateFromString functions to resolve symbol names (#3273)
- PHP/MapScript: ability to use the php clone keyword (#3472)
Modified: trunk/mapserver/mapscript/php/mapscript_i.c
===================================================================
--- trunk/mapserver/mapscript/php/mapscript_i.c 2010-06-29 16:20:53 UTC (rev 10264)
+++ trunk/mapserver/mapscript/php/mapscript_i.c 2010-06-29 19:29:34 UTC (rev 10265)
@@ -1416,7 +1416,14 @@
return newstyle;
}
+void styleObj_setGeomTransform(styleObj *style, char *transform){
+ if (!style)
+ return;
+ msStyleSetGeomTransform(style, transform);
+}
+
+
cgiRequestObj *cgirequestObj_new()
{
cgiRequestObj *request;
Modified: trunk/mapserver/mapscript/php/php_mapscript.h
===================================================================
--- trunk/mapserver/mapscript/php/php_mapscript.h 2010-06-29 16:20:53 UTC (rev 10264)
+++ trunk/mapserver/mapscript/php/php_mapscript.h 2010-06-29 19:29:34 UTC (rev 10265)
@@ -737,6 +737,7 @@
int styleObj_setSymbolByName(styleObj *self, mapObj *map,
char* pszSymbolName);
styleObj *styleObj_clone(styleObj *style);
+void styleObj_setGeomTransform(styleObj *style, char *transform);
hashTableObj *hashTableObj_new();
int hashTableObj_set(hashTableObj *self, const char *key,
Modified: trunk/mapserver/mapscript/php/style.c
===================================================================
--- trunk/mapserver/mapscript/php/style.c 2010-06-29 16:20:53 UTC (rev 10264)
+++ trunk/mapserver/mapscript/php/style.c 2010-06-29 19:29:34 UTC (rev 10265)
@@ -65,6 +65,11 @@
ZEND_ARG_INFO(0, styleBinding)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(style_setGeomTransform_args, 0, 0, 1)
+ ZEND_ARG_INFO(0, transform)
+ZEND_END_ARG_INFO()
+
+
/* {{{ proto void __construct(classObj class [, styleObj style])
Create a new styleObj instance */
PHP_METHOD(styleObj, __construct)
@@ -424,6 +429,53 @@
}
/* }}} */
+/* {{{ proto int style.getGeomTransform()
+ return the geometry transform expression */
+PHP_METHOD(styleObj, getGeomTransform)
+{
+ zval *zobj = getThis();
+ php_style_object *php_style;
+
+ PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+ if (zend_parse_parameters_none() == FAILURE) {
+ PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+ return;
+ }
+ PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+
+ php_style = (php_style_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+ if (php_style->style->_geomtransform == MS_GEOMTRANSFORM_NONE ||
+ !php_style->style->_geomtransformexpression)
+ RETURN_STRING("", 1);
+
+ RETURN_STRING(php_style->style->_geomtransformexpression, 1);
+}
+/* }}} */
+
+/* {{{ proto int style.setGeomTransform()
+ set the geometry transform expression */
+PHP_METHOD(styleObj, setGeomTransform)
+{
+ zval *zobj = getThis();
+ char *transform;
+ long transform_len;
+ php_style_object *php_style;
+
+ PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ &transform, &transform_len) == FAILURE) {
+ PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+ return;
+ }
+ PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+
+ php_style = (php_style_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+ styleObj_setGeomTransform(php_style->style, transform);
+}
+/* }}} */
+
zend_function_entry style_functions[] = {
PHP_ME(styleObj, __construct, style___construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(styleObj, __get, style___get_args, ZEND_ACC_PUBLIC)
@@ -433,6 +485,8 @@
PHP_ME(styleObj, setBinding, style_setBinding_args, ZEND_ACC_PUBLIC)
PHP_ME(styleObj, getBinding, style_getBinding_args, ZEND_ACC_PUBLIC)
PHP_ME(styleObj, removeBinding, style_removeBinding_args, ZEND_ACC_PUBLIC)
+ PHP_ME(styleObj, getGeomTransform, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(styleObj, setGeomTransform, style_setGeomTransform_args, ZEND_ACC_PUBLIC)
PHP_ME(styleObj, free, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
More information about the mapserver-commits
mailing list