opaquedave Mon Mar 12 17:57:39 2001 EDT
Modified files:
/php4/ext/ming ming.c php_ming.h
Log:
changed scalar args and returns to doubles, added Ming_setScale function,
added SWFTEXTFIELD_HTML flag, fixed SWFTextField_setIndentation glitch
Index: php4/ext/ming/ming.c
diff -u php4/ext/ming/ming.c:1.2 php4/ext/ming/ming.c:1.3
--- php4/ext/ming/ming.c:1.2Sun Feb 25 22:07:02 2001
+++ php4/ext/ming/ming.cMon Mar 12 17:57:38 2001
@@ -26,8 +26,9 @@
#include "php_ming.h"
static zend_function_entry ming_functions[] = {
- PHP_FALIAS(ming_setcubicthreshold, ming_setCubicThreshold, NULL)
- PHP_FALIAS(swfbutton_keypress, swfbutton_keypress, NULL)
+ PHP_FALIAS(ming_setcubicthreshold, ming_setCubicThreshold, NULL)
+ PHP_FALIAS(ming_setscale, ming_setScale, NULL)
+ PHP_FALIAS(swfbutton_keypress, swfbutton_keypress, NULL)
{ NULL, NULL, NULL }
};
@@ -35,8 +36,7 @@
{
zval **num;
- if(ZEND_NUM_ARGS() != 1 ||
- zend_get_parameters_ex(1, &num) == FAILURE)
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_long_ex(num);
@@ -44,6 +44,18 @@
Ming_setCubicThreshold(Z_LVAL_PP(num));
}
+PHP_FUNCTION(ming_setScale)
+{
+ zval **num;
+
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE)
+WRONG_PARAM_COUNT;
+
+ convert_to_double_ex(num);
+
+ Ming_setScale(Z_DVAL_PP(num));
+}
+
static int le_swfmoviep;
static int le_swfshapep;
static int le_swffillp;
@@ -141,12 +153,11 @@
static zend_function_entry swfaction_functions[] = {
PHP_FALIAS(swfaction, swfaction_init, NULL)
- PHP_FALIAS(add,swfaction_add, NULL)
{ NULL, NULL, NULL }
};
-/* {{{ proto object swfaction_init([string])
- returns a new SWFAction object, optionally compiling the given script */
+/* {{{ proto object swfaction_init(string)
+ returns a new SWFAction object, compiling the given script */
PHP_FUNCTION(swfaction_init)
{
@@ -154,27 +165,16 @@
zval **script;
int ret;
- if(ZEND_NUM_ARGS() == 0)
- {
-action = newSWFAction();
- }
- if(ZEND_NUM_ARGS() == 1)
- {
-SWFOutput out;
-
-if(zend_get_parameters_ex(1, &script) == FAILURE)
- WRONG_PARAM_COUNT;
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &script) == FAILURE)
+WRONG_PARAM_COUNT;
-convert_to_string_ex(script);
+ convert_to_string_ex(script);
-/* XXX - need to deal with compiler errors */
-action = compileSWFActionCode(Z_STRVAL_PP(script));
+ /* XXX - need to deal with compiler errors */
+ action = compileSWFActionCode(Z_STRVAL_PP(script));
-if(!action)
- php_error(E_ERROR, "Couldn't compile code. And I'm not smart enough to tell
you why, sorry.");
- }
- else
-WRONG_PARAM_COUNT;
+ if(!action)
+php_error(E_ERROR, "Couldn't compile code. And I'm not smart enough to tell you
+why, sorry.");
ret = zend_list_insert(action, le_swfactionp);
@@ -199,17 +199,7 @@
}
/* }}} */
-/* {{{ proto void swfaction_add(action, [args..])
- adds the given action (and optional args) to this SWFAction */
-PHP_FUNCTION(swfaction_add)
-{
- SWFAction action = getAction(getThis());
- /* XXX - etc. */
-}
-
-/* }}} */
-
/* }}} */
/* {{{ SWFBitmap */
@@ -324,7 +314,7 @@
if(ZEND_NUM_ARGS() != 0)
WRONG_PARAM_COUNT;
- RETURN_LONG(SWFBitmap_getWidth(getBitmap(getThis(;
+ RETURN_DOUBLE(SWFBitmap_getWidth(getBitmap(getThis(;
}
/* }}} */
@@ -336,7 +326,7 @@
if(ZEND_NUM_ARGS() != 0)
WRONG_PARAM_COUNT;
- RETURN_LONG(SWFBitmap_getHeight(getBitmap(getThis(;
+ RETURN_DOUBLE(SWFBitmap_getHeight(getBitmap(getThis(;
}
/* }}} */
@@ -596,10 +586,10 @@
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE)
WRONG_PARAM_COUNT;
- convert_to_long_ex(x);
- convert_to_long_ex(y);
+ convert_to_double_ex(x);
+ convert_to_double_ex(y);
- SWFDisplayItem_moveTo(getDisplayItem(getThis()), Z_LVAL_PP(x), Z_LVAL_PP(y));
+ SWFDisplayItem_moveTo(getDisplayItem(getThis()), Z_DVAL_PP(x), Z_DVAL_PP(y));
}
/* }}} */
@@ -613,10 +603,10 @@
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE)
WRONG_PARAM_COUNT;
- convert_to_long_ex(x);
- convert_to_long_ex(y);
+ convert_to_double_ex(x);
+ convert_to_double_ex(y);
- SWFDisplayItem_move(getDisplayItem(getThis()), Z_LVAL_PP(x), Z_LVAL_PP(y));
+ SWFDisplayItem_move(getDisplayItem(getThis()), Z_DVAL_PP(x), Z_DVAL_PP(y));
}
/* }}} */
@@ -968,10 +958,10 @@
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE)
WRONG_PARAM_COUNT;
- convert_to_long_ex(x);
- convert_to_long_ex(y);
+ convert_to_double_ex(x);
+ convert_to_double_ex(y);
- SWFFill_moveTo(getFill(getThis()), Z_LVAL_PP(x), Z_LVAL_PP(y));
+ SWFFill_moveTo(getFill(getThis()), Z_DVAL_PP(x), Z_DVAL_PP(y));
}
/* }}} */
@@ -1129,7