[mapserver-commits] r7598 - trunk/mapserver/mapscript/php3
svn at osgeo.org
svn at osgeo.org
Fri May 16 09:26:49 EDT 2008
Author: dmorissette
Date: 2008-05-16 09:26:48 -0400 (Fri, 16 May 2008)
New Revision: 7598
Modified:
trunk/mapserver/mapscript/php3/README
trunk/mapserver/mapscript/php3/php_mapscript.c
Log:
Added align keyword to scalebar in PHP MapScript (#2468)
Modified: trunk/mapserver/mapscript/php3/README
===================================================================
--- trunk/mapserver/mapscript/php3/README 2008-05-16 08:27:26 UTC (rev 7597)
+++ trunk/mapserver/mapscript/php3/README 2008-05-16 13:26:48 UTC (rev 7598)
@@ -42,10 +42,10 @@
The following MapServer constants are available:
Boolean values:
- MS_TRUE, MS_FALSE, MS_ON, MS_OFF, MS_YES, MS_NO
+ MS_TRUE, MS_FALSE, MS_ON, MS_OFF, MS_YES, MS_NO
Map units:
- MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD,
+ MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD,
MS_PIXELS
Layer types:
@@ -101,20 +101,23 @@
MS_SYMBOL_PIXMAP, MS_SYMBOL_TRUETYPE, MS_SYMBOL_CARTOLINE
Image Mode types (outputFormatObj):
-
MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA,
MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE,
MS_IMAGEMODE_NULL
- Style/Attribue binding
+ Style/Attribue binding:
MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR,
MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL
- Label/Attribute binding
+ Label/Attribute binding:
MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR,
MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT,
MS_LABEL_BINDING_PRIORITY
+ Alignment:
+ MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT
+
+
Functions:
----------
@@ -1576,7 +1579,8 @@
int postlabelcache;
labelObj label;
colorObj imagecolor;
-
+ int align;
+
Methods:
int set(string property_name, new_value)
Modified: trunk/mapserver/mapscript/php3/php_mapscript.c
===================================================================
--- trunk/mapserver/mapscript/php3/php_mapscript.c 2008-05-16 08:27:26 UTC (rev 7597)
+++ trunk/mapserver/mapscript/php3/php_mapscript.c 2008-05-16 13:26:48 UTC (rev 7598)
@@ -1132,6 +1132,11 @@
REGISTER_LONG_CONSTANT("MS_XY", MS_XY, const_flag);
REGISTER_LONG_CONSTANT("MS_FOLLOW", MS_FOLLOW, const_flag);
+ /* alignment constants*/
+ REGISTER_LONG_CONSTANT("MS_ALIGN_LEFT", MS_ALIGN_LEFT, const_flag);
+ REGISTER_LONG_CONSTANT("MS_ALIGN_CENTER",MS_ALIGN_CENTER,const_flag);
+ REGISTER_LONG_CONSTANT("MS_ALIGN_RIGHT", MS_ALIGN_RIGHT, const_flag);
+
/* shape type constants*/
REGISTER_LONG_CONSTANT("MS_SHAPE_POINT",MS_SHAPE_POINT, const_flag);
REGISTER_LONG_CONSTANT("MS_SHAPE_LINE", MS_SHAPE_LINE, const_flag);
@@ -13298,13 +13303,7 @@
HashTable *list, pval *return_value TSRMLS_DC)
{
int scalebar_id;
-#ifdef PHP4
pval *new_obj_ptr;
-#else
- pval new_obj_param; /* No, it's not a pval * !!! */
- pval *new_obj_ptr;
- new_obj_ptr = &new_obj_param;
-#endif
if (pscalebar == NULL)
return 0;
@@ -13326,17 +13325,14 @@
add_property_long(return_value, "interlace", pscalebar->interlace);
add_property_long(return_value, "postlabelcache",
pscalebar->postlabelcache);
+ add_property_long(return_value, "align", pscalebar->align);
+
-
-#ifdef PHP4
MAKE_STD_ZVAL(new_obj_ptr);
-#endif
_phpms_build_label_object(&(pscalebar->label), list, new_obj_ptr TSRMLS_CC);
_phpms_add_property_object(return_value, "label", new_obj_ptr,E_ERROR TSRMLS_CC);
-#ifdef PHP4
MAKE_STD_ZVAL(new_obj_ptr); /* Alloc and Init a ZVAL for new object */
-#endif
_phpms_build_color_object(&(pscalebar->imagecolor),list, new_obj_ptr TSRMLS_CC);
_phpms_add_property_object(return_value, "imagecolor",new_obj_ptr,E_ERROR TSRMLS_CC);
@@ -13370,15 +13366,9 @@
{
scalebarObj *self;
pval *pPropertyName, *pNewValue, *pThis;
-#ifdef PHP4
HashTable *list=NULL;
-#endif
-#ifdef PHP4
pThis = getThis();
-#else
- getThis(&pThis);
-#endif
if (pThis == NULL ||
getParameters(ht, 2, &pPropertyName, &pNewValue) != SUCCESS)
@@ -13404,16 +13394,17 @@
convert_to_string(pPropertyName);
- IF_SET_LONG( "height", self->height)
- else IF_SET_LONG( "width", self->width)
- else IF_SET_LONG( "style", self->style)
- else IF_SET_LONG( "intervals", self->intervals)
- else IF_SET_LONG( "units", self->units)
- else IF_SET_LONG( "status", self->status)
- else IF_SET_LONG( "position", self->position)
+ IF_SET_LONG( "height", self->height)
+ else IF_SET_LONG( "width", self->width)
+ else IF_SET_LONG( "style", self->style)
+ else IF_SET_LONG( "intervals", self->intervals)
+ else IF_SET_LONG( "units", self->units)
+ else IF_SET_LONG( "status", self->status)
+ else IF_SET_LONG( "position", self->position)
else IF_SET_LONG( "transparent", self->transparent)
- else IF_SET_LONG( "interlace", self->interlace)
- else IF_SET_LONG( "postlabelcache", self->postlabelcache)
+ else IF_SET_LONG( "interlace", self->interlace)
+ else IF_SET_LONG( "postlabelcache",self->postlabelcache)
+ else IF_SET_LONG( "align", self->align)
else
{
php3_error(E_ERROR,"Property '%s' does not exist in this object.",
@@ -13436,15 +13427,9 @@
scalebarObj *self;
pval *pThis, *pR, *pG, *pB;
int r, g, b = 0;
-#ifdef PHP4
HashTable *list=NULL;
-#endif
-#ifdef PHP4
pThis = getThis();
-#else
- getThis(&pThis);
-#endif
if (pThis == NULL ||
getParameters(ht, 3, &pR, &pG, &pB) != SUCCESS)
More information about the mapserver-commits
mailing list