fmk             Thu Nov  6 02:29:37 2003 EDT

  Modified files:              
    /php-src/ext/ming   ming.c php_ming.h 
  Log:
  MFB: Adding new features from ming 0.3a.
  
Index: php-src/ext/ming/ming.c
diff -u php-src/ext/ming/ming.c:1.55 php-src/ext/ming/ming.c:1.56
--- php-src/ext/ming/ming.c:1.55        Sun Sep  7 12:11:38 2003
+++ php-src/ext/ming/ming.c     Thu Nov  6 02:29:37 2003
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: ming.c,v 1.55 2003/09/07 16:11:38 sniper Exp $ */
+/* $Id: ming.c,v 1.56 2003/11/06 07:29:37 fmk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -48,6 +48,9 @@
        PHP_FALIAS(ming_setscale,           ming_setScale,           NULL)
        PHP_FALIAS(ming_useswfversion,      ming_useSWFVersion,      NULL)
        PHP_FALIAS(swfbutton_keypress,      swfbutton_keypress,      NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(ming_useconstants,           ming_useConstants,       NULL)
+#endif
        { NULL, NULL, NULL }
 };
 
@@ -64,6 +67,8 @@
 static SWFAction getAction(zval *id TSRMLS_DC);
 static SWFMorph getMorph(zval *id TSRMLS_DC);
 static SWFMovieClip getSprite(zval *id TSRMLS_DC);
+static SWFSound getSound(zval *id TSRMLS_DC);
+static SWFSoundInstance getSoundInstance(zval *id TSRMLS_DC);
 
 /* {{{ proto void ming_setcubicthreshold (int threshold)
    Set cubic threshold (?) */
@@ -107,12 +112,30 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto void ming_useconstants(int use)
+       Use constant pool (?) */ 
+PHP_FUNCTION(ming_useConstants)
+{
+       zval **num;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(num);
+
+       Ming_useConstants(Z_LVAL_PP(num));
+}
+/* }}} */
+#endif
+
 static int le_swfmoviep;
 static int le_swfshapep;
 static int le_swffillp;
 static int le_swfgradientp;
 static int le_swfbitmapp;
 static int le_swffontp;
+static int le_swffontcharp;
 static int le_swftextp;
 static int le_swftextfieldp;
 static int le_swfdisplayitemp;
@@ -121,6 +144,8 @@
 static int le_swfmorphp;
 static int le_swfspritep;
 static int le_swfinputp;
+static int le_swfsoundp;
+static int le_swfsoundinstancep;
 
 static zend_class_entry *movie_class_entry_ptr;
 static zend_class_entry *shape_class_entry_ptr;
@@ -128,6 +153,7 @@
 static zend_class_entry *gradient_class_entry_ptr;
 static zend_class_entry *bitmap_class_entry_ptr;
 static zend_class_entry *font_class_entry_ptr;
+static zend_class_entry *fontchar_class_entry_ptr;
 static zend_class_entry *text_class_entry_ptr;
 static zend_class_entry *textfield_class_entry_ptr;
 static zend_class_entry *displayitem_class_entry_ptr;
@@ -135,6 +161,8 @@
 static zend_class_entry *action_class_entry_ptr;
 static zend_class_entry *morph_class_entry_ptr;
 static zend_class_entry *sprite_class_entry_ptr;
+static zend_class_entry *sound_class_entry_ptr;
+static zend_class_entry *soundinstance_class_entry_ptr;
  
 /* {{{ internal function SWFgetProperty
 */
@@ -189,6 +217,10 @@
                return (SWFCharacter)getSprite(id TSRMLS_CC);
        else if (Z_OBJCE_P(id) == bitmap_class_entry_ptr)
                return (SWFCharacter)getBitmap(id TSRMLS_CC);
+       else if(Z_OBJCE_P(id) == sound_class_entry_ptr)
+               return (SWFCharacter)getSound(id TSRMLS_CC);
+//     else if(Z_OBJCE_P(id) == soundinstance_class_entry_ptr)
+//             return (SWFCharacter)getSoundInstance(id TSRMLS_CC);
        else
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an 
SWFCharacter");
                return NULL;
@@ -377,7 +409,13 @@
        PHP_FALIAS(setdown,                swfbutton_setDown,         NULL)
        PHP_FALIAS(setaction,              swfbutton_setAction,       NULL)
        PHP_FALIAS(addshape,               swfbutton_addShape,        NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(setmenu,                swfbutton_setMenu,         NULL)
+#endif
        PHP_FALIAS(addaction,              swfbutton_addAction,       NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(addsound,               swfbutton_addSound,        NULL)
+#endif
        { NULL, NULL, NULL }
 };
 
@@ -503,6 +541,23 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto void swfbutton_setMenu(int flag)
+       enable track as menu button behaviour */
+
+PHP_FUNCTION(swfbutton_setMenu)
+{
+       zval **zflag;
+       SWFButton button = getButton(getThis() TSRMLS_CC);
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zflag) == FAILURE)
+               WRONG_PARAM_COUNT;      
+       convert_to_long_ex(zflag);
+
+       SWFButton_setMenu(button, Z_LVAL_PP(zflag));
+}
+/* }}} */
+#endif
+
 /* {{{ proto void swfbutton_setAction(object SWFAction)
    Sets the action to perform when button is pressed */
 PHP_FUNCTION(swfbutton_setAction)
@@ -521,6 +576,39 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto SWFSoundInstance * swfbutton_addASound(SWFSound sound, int flags)
+   associates a sound with a button transition
+       NOTE: the transitions are all wrong _UP, _OVER, _DOWN _HIT  */
+
+PHP_FUNCTION(swfbutton_addSound)
+{
+       zval **zsound, **flags;
+       SWFButton button = getButton(getThis() TSRMLS_CC);
+       SWFSound sound;
+       SWFSoundInstance item;
+       int ret;
+
+       if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zsound, &flags) == 
FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zsound);
+       sound = getSound(*zsound TSRMLS_CC);
+
+       convert_to_long_ex(flags);
+
+       item = SWFButton_addSound(button, sound, Z_LVAL_PP(flags));
+
+       if(item != NULL) {
+               /* try and create a soundinstance object */
+               ret = zend_list_insert(item, le_swfsoundinstancep);
+               object_init_ex(return_value, soundinstance_class_entry_ptr);
+               add_property_resource(return_value, "soundinstance", ret);
+       }
+}
+/* }}} */
+#endif
+
 /* {{{ proto void swfbutton_addAction(object SWFAction, int flags)
    Sets the action to perform when conditions described in flags is met */
 PHP_FUNCTION(swfbutton_addAction)
@@ -583,6 +671,18 @@
        PHP_FALIAS(multcolor,    swfdisplayitem_multColor,   NULL)
        PHP_FALIAS(setname,      swfdisplayitem_setName,     NULL)
        PHP_FALIAS(addaction,    swfdisplayitem_addAction,   NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(remove,       swfdisplayitem_remove,      NULL)
+       PHP_FALIAS(setmasklevel, swfdisplayitem_setMaskLevel,NULL)
+       PHP_FALIAS(endmask,      swfdisplayitem_endMask,     NULL)
+       PHP_FALIAS(get_x,        swfdisplayitem_getX,        NULL)
+       PHP_FALIAS(get_y,        swfdisplayitem_getY,        NULL)
+       PHP_FALIAS(get_xscale,   swfdisplayitem_getXScale,   NULL)
+       PHP_FALIAS(get_yscale,   swfdisplayitem_getYScale,   NULL)
+       PHP_FALIAS(get_xskew,    swfdisplayitem_getXSkew,    NULL)
+       PHP_FALIAS(get_yskew,    swfdisplayitem_getYSkew,    NULL)
+       PHP_FALIAS(get_rot,      swfdisplayitem_getRot,      NULL)
+#endif
        { NULL, NULL, NULL }
 };
 
@@ -908,6 +1008,157 @@
        SWFDisplayItem_addAction(item, action, Z_LVAL_PP(flags));
 }
 /* }}} */
+
+#ifdef HAVE_NEW_MING
+/* {{{ swfdisplayitem_remove */
+
+PHP_FUNCTION(swfdisplayitem_remove)
+{
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       SWFDisplayItem_remove(item);
+}
+/* }}} */
+
+/* {{{ proto void swfdisplayitem_setMaskLevel(int level)
+   defines a MASK layer at level */
+
+PHP_FUNCTION(swfdisplayitem_setMaskLevel)
+{
+       zval **level;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &level) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(level);
+
+       SWFDisplayItem_setMaskLevel(getDisplayItem(getThis() TSRMLS_CC), 
Z_LVAL_PP(level));
+}
+/* }}} */
+
+/* {{{ proto void swfdisplayitem_endMask()
+   another way of defining a MASK layer */
+
+PHP_FUNCTION(swfdisplayitem_endMask)
+{
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       SWFDisplayItem_endMask(item);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getX */
+
+PHP_FUNCTION(swfdisplayitem_getX)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_x(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getY */
+
+PHP_FUNCTION(swfdisplayitem_getY)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_y(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getXScale */
+
+PHP_FUNCTION(swfdisplayitem_getXScale)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_xScale(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getYScale */
+
+PHP_FUNCTION(swfdisplayitem_getYScale)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_yScale(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getXSkew */
+
+PHP_FUNCTION(swfdisplayitem_getXSkew)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_xSkew(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getYSkew */
+
+PHP_FUNCTION(swfdisplayitem_getYSkew)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_ySkew(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+
+/* {{{ swfdisplayitem_getRot */
+
+PHP_FUNCTION(swfdisplayitem_getRot)
+{
+       float ret;
+       SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       ret = SWFDisplayItem_get_rot(item);
+       RETURN_DOUBLE(ret);
+}
+/* }}} */
+#endif
+
 /* }}} */
 
 /* {{{ SWFFill
@@ -1035,14 +1286,81 @@
 /* }}} */
 /* }}} */
 
+/* {{{ SWFFontCharacter */
+
+static zend_function_entry swffontchar_functions[] = {
+       PHP_FALIAS(addchars,         swffontchar_addChars,      NULL)
+       PHP_FALIAS(addutf8chars,     swffontchar_addUTF8Chars,  NULL)
+       { NULL, NULL, NULL }
+};
+
+/* {{{ internal function SWFText getFont(zval *id)
+   Returns the Font object in zval *id */
+
+static
+SWFFontCharacter getFontCharacter(zval *id TSRMLS_DC)
+{
+       void *font = SWFgetProperty(id, "fontcharacter", 13, le_swffontcharp 
TSRMLS_CC);
+
+       if(!font)
+               php_error(E_ERROR, "called object is not an SWFFontCharacter!");
+
+       return (SWFFontCharacter)font;
+}
+
+static void destroy_SWFFontCharacter_resource(zend_rsrc_list_entry *resource 
TSRMLS_DC)
+{
+       destroySWFBlock((SWFBlock)resource->ptr);
+}
+
+/* {{{ proto void swffontchar_addChars(string)
+   adds characters to a font for exporting font */
+
+PHP_FUNCTION(swffontchar_addChars)
+{
+       zval **zstring;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       SWFFontCharacter_addChars(getFontCharacter(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+}
+/* }}} */
+/* {{{ proto void swffontchar_addChars(string)
+   adds characters to a font for exporting font */
+
+PHP_FUNCTION(swffontchar_addUTF8Chars)
+{
+       zval **zstring;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       SWFFontCharacter_addUTF8Chars(getFontCharacter(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+}
+/* }}} */
+
+/* }}} */
 /* {{{ SWFFont
 */
 static zend_function_entry swffont_functions[] = {
        PHP_FALIAS(swffont,          swffont_init,              NULL)
        PHP_FALIAS(getwidth,         swffont_getWidth,          NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(getutf8width,     swffont_getUTF8Width,      NULL)
+/*     PHP_FALIAS(getwidewidth,     swffont_getWideWidth,      NULL)*/
+#endif
        PHP_FALIAS(getascent,        swffont_getAscent,         NULL)
        PHP_FALIAS(getdescent,       swffont_getDescent,        NULL)
        PHP_FALIAS(getleading,       swffont_getLeading,        NULL)
+#ifdef HAVE_NEW_MING
+/*     PHP_FALIAS(addchars,         swffont_addChars,          NULL)*/
+       PHP_FALIAS(getshape,         swffont_getShape,          NULL)
+#endif
        { NULL, NULL, NULL }
 };
 
@@ -1123,6 +1441,48 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto int swffont_getUTF8Width(string)
+   Calculates the width of the given string in this font at full height */
+
+PHP_FUNCTION(swffont_getUTF8Width)
+{
+       zval **zstring;
+       float width;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       width = SWFFont_getUTF8StringWidth(getFont(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+
+       RETURN_DOUBLE(width);
+}
+
+/* }}} */
+// not sure about 0 bytes !!!!!!!!!
+/* {{{ proto int swffont_getWideWidth(string)
+   Calculates the width of the given string in this font at full height */
+/*
+PHP_FUNCTION(swffont_getWideWidth)
+{
+       zval **zstring;
+       float width;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       width = SWFFont_getWideStringWidth(getFont(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+
+       RETURN_DOUBLE(width);
+}
+*/
+/* }}} */
+#endif
+
 /* {{{ proto float swffont_getAscent(void)
    Returns the ascent of the font, or 0 if not available */
 PHP_FUNCTION(swffont_getAscent)
@@ -1146,6 +1506,45 @@
        RETURN_DOUBLE(SWFFont_getLeading(getFont(getThis() TSRMLS_CC)));
 }
 /* }}} */
+
+#ifdef HAVE_NEW_MING
+/* {{{ proto void swffont_addChars(string)
+   adds characters to a font required within textfields */
+/*
+PHP_FUNCTION(swffont_addChars)
+{
+       zval **zstring;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       SWFFont_addChars(getFont(getThis() TSRMLS_CC), Z_STRVAL_PP(zstring));
+}
+*/
+/* }}} */
+
+/* {{{ proto char *swffont_getShape(code)
+   Returns the glyph shape of a char as a text string */
+
+PHP_FUNCTION(swffont_getShape)
+{
+       zval **zcode;
+       char *result;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zcode) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(zcode);
+
+       result = SWFFont_getShape(getFont(getThis() TSRMLS_CC), Z_LVAL_PP(zcode));
+       RETVAL_STRING(result, 1);
+       free(result);
+}
+/* }}} */
+#endif
+
 /* }}} */
 
 /* {{{ SWFGradient
@@ -1231,65 +1630,227 @@
        { NULL, NULL, NULL }
 };
 
-/* {{{ proto object swfmorph_init(void)
-   Returns a new SWFMorph object */
-PHP_FUNCTION(swfmorph_init)
+/* {{{ proto object swfmorph_init(void)
+   Returns a new SWFMorph object */
+PHP_FUNCTION(swfmorph_init)
+{
+       SWFMorph morph = newSWFMorphShape();
+       int ret = zend_list_insert(morph, le_swfmorphp);
+
+       object_init_ex(getThis(), morph_class_entry_ptr);
+       add_property_resource(getThis(), "morph", ret);
+       zend_list_addref(ret);
+}
+
+static void destroy_SWFMorph_resource(zend_rsrc_list_entry *resource TSRMLS_DC)
+{
+       destroySWFMorph((SWFMorph)resource->ptr);
+}
+/* }}} */
+
+/* {{{ internal function getMorph
+   Returns the SWFMorph object contained in zval *id */
+static SWFMorph getMorph(zval *id TSRMLS_DC)
+{
+       void *morph = SWFgetProperty(id, "morph", 5, le_swfmorphp TSRMLS_CC);
+
+       if (!morph) {
+               php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an 
SWFMorph");
+       }
+       return (SWFMorph)morph;
+}
+/* }}} */
+
+/* {{{ proto object swfmorph_getShape1(void)
+   Return's this SWFMorph's start shape object */
+PHP_FUNCTION(swfmorph_getShape1)
+{
+       SWFMorph morph = getMorph(getThis() TSRMLS_CC);
+       SWFShape shape = SWFMorph_getShape1(morph);
+       int ret = zend_list_insert(shape, le_swfshapep);
+
+       object_init_ex(return_value, shape_class_entry_ptr);
+       add_property_resource(return_value, "shape", ret);
+       zend_list_addref(ret);
+}
+/* }}} */
+
+/* {{{ proto object swfmorph_getShape2(void)
+   Return's this SWFMorph's start shape object */
+PHP_FUNCTION(swfmorph_getShape2)
+{
+       SWFMorph morph = getMorph(getThis() TSRMLS_CC);
+       SWFShape shape = SWFMorph_getShape2(morph);
+       int ret = zend_list_insert(shape, le_swfshapep);
+
+       object_init_ex(return_value, shape_class_entry_ptr);
+       add_property_resource(return_value, "shape", ret);
+       zend_list_addref(ret);
+}
+/* }}} */
+/* }}} */
+
+/* {{{ SWFSound */
+
+static zend_function_entry swfsound_functions[] = {
+       PHP_FALIAS(swfsound,         swfsound_init,             NULL)
+       { NULL, NULL, NULL }
+};
+
+/* {{{ internal function SWFSound getSound(zval *id)
+   Returns the Sound object in zval *id */
+
+SWFSound getSound(zval *id TSRMLS_DC)
+{
+       void *sound = SWFgetProperty(id, "sound", 5, le_swfsoundp TSRMLS_CC);
+
+       if(!sound)
+               php_error(E_ERROR, "called object is not an SWFSound!");
+
+       return (SWFSound)sound;
+}
+
+/* }}} */
+/* {{{ proto class swfsound_init(string filename, int flags)
+   Returns a new SWFSound object from given file */
+
+PHP_FUNCTION(swfsound_init)
+{
+       zval **zfile, **zflags;
+       SWFSound sound;
+       SWFInput input;
+       int flags;
+       int ret;
+
+       if(ZEND_NUM_ARGS() == 1)
+       {
+               if(zend_get_parameters_ex(1, &zfile) == FAILURE)
+                       WRONG_PARAM_COUNT;
+               flags = 0;
+       }
+       else if(ZEND_NUM_ARGS() == 2)
+       {
+               if(zend_get_parameters_ex(2, &zfile, &zflags) == FAILURE)
+                       WRONG_PARAM_COUNT;
+               convert_to_long_ex(zflags);
+               flags = Z_LVAL_PP(zflags);
+       }
+       else
+               WRONG_PARAM_COUNT;
+
+       if(Z_TYPE_PP(zfile) != IS_RESOURCE)
+       {
+               convert_to_string_ex(zfile);
+               input = newSWFInput_buffer(Z_STRVAL_PP(zfile), Z_STRLEN_PP(zfile));
+               zend_list_addref(zend_list_insert(input, le_swfinputp));
+       }
+       else
+               input = getInput(zfile TSRMLS_CC);
+
+       sound = newSWFSound_fromInput(input, flags);
+
+       ret = zend_list_insert(sound, le_swfsoundp);
+
+       object_init_ex(getThis(), sound_class_entry_ptr);
+       add_property_resource(getThis(), "sound", ret);
+       zend_list_addref(ret);
+}
+static void destroy_SWFSound_resource(zend_rsrc_list_entry *resource TSRMLS_DC)
+{
+       destroySWFBlock((SWFBlock)resource->ptr);
+}
+
+/* }}} */
+/* }}} */
+
+#ifdef HAVE_NEW_MING
+/* should handle envelope functions */
+/* {{{ SWFSoundInstance */
+
+static zend_function_entry swfsoundinstance_functions[] = {
+       PHP_FALIAS(nomultiple,     swfsoundinstance_noMultiple,    NULL)
+       PHP_FALIAS(loopinpoint,    swfsoundinstance_loopInPoint,   NULL)
+       PHP_FALIAS(loopoutpoint,   swfsoundinstance_loopOutPoint,  NULL)
+       PHP_FALIAS(loopcount,      swfsoundinstance_loopCount,     NULL)
+       { NULL, NULL, NULL }
+};
+
+/* {{{ internal function SWFSoundInstance getSoundInstance(zval *id)
+   Returns the SoundInstance object in zval *id */
+
+SWFSoundInstance getSoundInstance(zval *id TSRMLS_DC)
 {
-       SWFMorph morph = newSWFMorphShape();
-       int ret = zend_list_insert(morph, le_swfmorphp);
+       void *inst = SWFgetProperty(id, "soundinstance", 13, le_swfsoundinstancep 
TSRMLS_CC);
 
-       object_init_ex(getThis(), morph_class_entry_ptr);
-       add_property_resource(getThis(), "morph", ret);
-       zend_list_addref(ret);
+       if (!inst)
+               php_error(E_ERROR, "called object is not an SWFSoundInstance!");
+
+       return (SWFSoundInstance)inst;
 }
+/* }}} */
 
-static void destroy_SWFMorph_resource(zend_rsrc_list_entry *resource TSRMLS_DC)
+/* {{{ swfsoundinstance_nomultiple */
+
+PHP_FUNCTION(swfsoundinstance_noMultiple)
 {
-       destroySWFMorph((SWFMorph)resource->ptr);
+       SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 0)
+               WRONG_PARAM_COUNT;
+
+       SWFSoundInstance_setNoMultiple(inst);
 }
 /* }}} */
 
-/* {{{ internal function getMorph
-   Returns the SWFMorph object contained in zval *id */
-static SWFMorph getMorph(zval *id TSRMLS_DC)
+/* {{{ swfsoundinstance_loopinpoint(point) */
+
+PHP_FUNCTION(swfsoundinstance_loopInPoint)
 {
-       void *morph = SWFgetProperty(id, "morph", 5, le_swfmorphp TSRMLS_CC);
+       zval **zpoint;
+       SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC);
 
-       if (!morph) {
-               php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an 
SWFMorph");
-       }
-       return (SWFMorph)morph;
+       if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zpoint) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(zpoint);
+
+       SWFSoundInstance_setLoopInPoint(inst, Z_LVAL_PP(zpoint));
 }
+
 /* }}} */
+/* {{{ swfsoundinstance_loopoutpoint(point) */
 
-/* {{{ proto object swfmorph_getShape1(void)
-   Return's this SWFMorph's start shape object */
-PHP_FUNCTION(swfmorph_getShape1)
+PHP_FUNCTION(swfsoundinstance_loopOutPoint)
 {
-       SWFMorph morph = getMorph(getThis() TSRMLS_CC);
-       SWFShape shape = SWFMorph_getShape1(morph);
-       int ret = zend_list_insert(shape, le_swfshapep);
+       zval **zpoint;
+       SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC);
 
-       object_init_ex(return_value, shape_class_entry_ptr);
-       add_property_resource(return_value, "shape", ret);
-       zend_list_addref(ret);
+       if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zpoint) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(zpoint);
+
+       SWFSoundInstance_setLoopOutPoint(inst, Z_LVAL_PP(zpoint));
 }
 /* }}} */
 
-/* {{{ proto object swfmorph_getShape2(void)
-   Return's this SWFMorph's start shape object */
-PHP_FUNCTION(swfmorph_getShape2)
+/* {{{ swfsoundinstance_loopcount(point) */
+
+PHP_FUNCTION(swfsoundinstance_loopCount)
 {
-       SWFMorph morph = getMorph(getThis() TSRMLS_CC);
-       SWFShape shape = SWFMorph_getShape2(morph);
-       int ret = zend_list_insert(shape, le_swfshapep);
+       zval **zcount;
+       SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC);
 
-       object_init_ex(return_value, shape_class_entry_ptr);
-       add_property_resource(return_value, "shape", ret);
-       zend_list_addref(ret);
+       if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &zcount) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_long_ex(zcount);
+
+       SWFSoundInstance_setLoopCount(inst, Z_LVAL_PP(zcount));
 }
 /* }}} */
 /* }}} */
+#endif
 
 /* {{{ SWFMovie
 */
@@ -1308,6 +1869,13 @@
        PHP_FALIAS(setframes,         swfmovie_setFrames,         NULL)
 #ifdef HAVE_NEW_MING
        PHP_FALIAS(streammp3,         swfmovie_streamMp3,         NULL)
+       PHP_FALIAS(addexport,         swfmovie_addExport,         NULL)
+       PHP_FALIAS(writeexports,      swfmovie_writeExports,      NULL)
+       PHP_FALIAS(startsound,        swfmovie_startSound,        NULL)
+       PHP_FALIAS(stopsound,         swfmovie_stopSound,         NULL)
+       PHP_FALIAS(importchar,        swfmovie_importChar,        NULL)
+       PHP_FALIAS(importfont,        swfmovie_importFont,        NULL)
+       PHP_FALIAS(addfont,           swfmovie_addFont,           NULL)
 #endif
        { NULL, NULL, NULL }
 };
@@ -1669,9 +2237,168 @@
        SWFMovie_setSoundStream(movie, sound);
 }
 /* }}} */
-#endif
+
+/* {{{ swfmovie_addexport */
+
+PHP_FUNCTION(swfmovie_addExport)
+{
+       zval **zchar, **zname;
+       SWFBlock block;
+       SWFMovie movie = getMovie(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zchar, &zname) == 
FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zchar);
+       convert_to_string_ex(zname);
+
+       block = (SWFBlock)getCharacter(*zchar TSRMLS_CC);
+
+       SWFMovie_addExport(movie, block,  Z_STRVAL_PP(zname));
+}
+
+/* }}} */
+
+/* {{{ swfmovie_writeexports */
+                       
+PHP_FUNCTION(swfmovie_writeExports)
+{
+       SWFMovie movie = getMovie(getThis() TSRMLS_CC);
+
+       SWFMovie_writeExports(movie);
+}
+
+/* }}} */
+/* {{{ SWFSoundInstance swfmovie_startsound */
+
+PHP_FUNCTION(swfmovie_startSound)
+{
+       zval **zsound;
+       int ret;
+       SWFSound sound;
+       SWFSoundInstance item;
+       SWFMovie movie = getMovie(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zsound);
+       sound = (SWFSound)getSound(*zsound TSRMLS_CC);
+
+       item = SWFMovie_startSound(movie, sound);
+
+       if(item != NULL)
+       {
+               /* try and create a soundinstance object */
+               ret = zend_list_insert(item, le_swfsoundinstancep);
+               object_init_ex(return_value, soundinstance_class_entry_ptr);
+               add_property_resource(return_value, "soundinstance", ret);
+       }
+}
+/* }}} */
+
+/* {{{ void swfmovie_stopsound */
+
+PHP_FUNCTION(swfmovie_stopSound)
+{
+       zval **zsound;
+       SWFSound sound;
+       SWFMovie movie = getMovie(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zsound);
+       sound = (SWFSound)getSound(*zsound TSRMLS_CC);
+
+       SWFMovie_stopSound(movie, sound);
+}
+/* }}} */
+
+/* {{{ void swfmovie_importChar */
+
+PHP_FUNCTION(swfmovie_importChar)
+{
+       SWFMovie movie;
+       SWFCharacter res;
+       int ret;
+       zval **libswf, **name;
+
+       if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &libswf, &name) == 
FAILURE)
+               WRONG_PARAM_COUNT;
+       convert_to_string_ex(libswf);
+       convert_to_string_ex(name);
+       movie = getMovie(getThis() TSRMLS_CC);
+       res = SWFMovie_importCharacter(movie, Z_STRVAL_PP(libswf), Z_STRVAL_PP(name));
+
+       if(res != NULL)
+       {
+               /* try and create a sprite object */
+       ret = zend_list_insert(res, le_swfspritep);
+               object_init_ex(return_value, sprite_class_entry_ptr);
+               add_property_resource(return_value, "sprite", ret);
+       }       
+}
+/* }}} */
+
+/* {{{ void swfmovie_importFont */
+
+PHP_FUNCTION(swfmovie_importFont)
+{
+       SWFMovie movie;
+       SWFFontCharacter res;
+       int ret;
+       zval **libswf, **name;
+
+       if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &libswf, &name) == 
FAILURE)
+               WRONG_PARAM_COUNT;
+       convert_to_string_ex(libswf);
+       convert_to_string_ex(name);
+       movie = getMovie(getThis() TSRMLS_CC);
+       res = SWFMovie_importFont(movie, Z_STRVAL_PP(libswf), Z_STRVAL_PP(name));
+
+       if(res != NULL)
+       {
+               /* try and create a fontchar object */
+       ret = zend_list_insert(res, le_swffontcharp);
+               object_init_ex(return_value, fontchar_class_entry_ptr);
+               add_property_resource(return_value, "fontcharacter", ret);
+       }       
+}
+/* }}} */
+
+/* {{{ void swfmovie_addFont */
+
+PHP_FUNCTION(swfmovie_addFont)
+{
+       SWFMovie movie;
+       SWFFontCharacter res;
+       int ret;
+       SWFFont font;
+       zval **zfont;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfont) == FAILURE)
+           WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zfont);
+
+       movie = getMovie(getThis() TSRMLS_CC);
+       font = getFont(*zfont TSRMLS_CC);
+       res = SWFMovie_addFont(movie, font);
+
+       if(res != NULL)
+       {
+               /* try and create a fontchar object */
+       ret = zend_list_insert(res, le_swffontcharp);
+               object_init_ex(return_value, fontchar_class_entry_ptr);
+               add_property_resource(return_value, "fontcharacter", ret);
+       }       
+}
+/* }}} */
 /* }}} */
 
+#endif
+
 /* {{{ SWFShape
 */
 static zend_function_entry swfshape_functions[] = {
@@ -2194,12 +2921,16 @@
 /* {{{ SWFSprite
 */
 static zend_function_entry swfsprite_functions[] = {
-       PHP_FALIAS(swfsprite,          swfsprite_init,              NULL)
-       PHP_FALIAS(add,                swfsprite_add,               NULL)
-       PHP_FALIAS(remove,             swfsprite_remove,            NULL)
-       PHP_FALIAS(nextframe,          swfsprite_nextFrame,         NULL)
-       PHP_FALIAS(labelframe,         swfsprite_labelFrame,        NULL)
-       PHP_FALIAS(setframes,          swfsprite_setFrames,         NULL)
+       PHP_FALIAS(swfsprite,                   swfsprite_init,                        
 NULL)
+       PHP_FALIAS(add,                                 swfsprite_add,                 
         NULL)
+       PHP_FALIAS(remove,                              swfsprite_remove,              
         NULL)
+       PHP_FALIAS(nextframe,                   swfsprite_nextFrame,            NULL)
+       PHP_FALIAS(labelframe,                  swfsprite_labelFrame,           NULL)
+       PHP_FALIAS(setframes,                   swfsprite_setFrames,            NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(startsound,                  swfsprite_startSound,           NULL)
+       PHP_FALIAS(stopsound,                   swfsprite_stopSound,            NULL)
+#endif
        { NULL, NULL, NULL }
 };
 
@@ -2320,6 +3051,53 @@
        SWFMovieClip_setNumberOfFrames(sprite, Z_LVAL_PP(frames));
 }
 /* }}} */
+
+#ifdef HAVE_NEW_MING
+/* {{{ SWFSoundInstance swfsprite_startsound */
+
+PHP_FUNCTION(swfsprite_startSound)
+{
+       zval **zsound;
+       int ret;
+       SWFSound sound;
+       SWFSoundInstance item;
+       SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zsound);
+       sound = (SWFSound)getSound(*zsound TSRMLS_CC);
+
+       item = SWFMovieClip_startSound(sprite, sound);
+
+       if(item != NULL) {
+               /* try and create a displayitem object */
+               ret = zend_list_insert(item, le_swfsoundinstancep);
+               object_init_ex(return_value, soundinstance_class_entry_ptr);
+               add_property_resource(return_value, "soundinstance", ret);
+       }
+}
+
+/* }}} */
+/* {{{ void swfsprite_stopsound */
+
+PHP_FUNCTION(swfsprite_stopSound)
+{
+       zval **zsound;
+       SWFSound sound;
+       SWFMovieClip sprite = getSprite(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zsound) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_object_ex(zsound);
+       sound = (SWFSound)getSound(*zsound TSRMLS_CC);
+
+       SWFMovieClip_stopSound(sprite, sound);
+}
+/* }}} */
+#endif
 /* }}} */
 
 /* {{{ SWFText
@@ -2332,7 +3110,15 @@
        PHP_FALIAS(setcolor,               swftext_setColor,          NULL)
        PHP_FALIAS(moveto,                 swftext_moveTo,            NULL)
        PHP_FALIAS(addstring,              swftext_addString,         NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(addutf8string,          swftext_addUTF8String,     NULL)
+/*     PHP_FALIAS(addwidestring,          swftext_addWideString,     NULL)*/
+#endif
        PHP_FALIAS(getwidth,               swftext_getWidth,          NULL)
+#ifdef HAVE_NEW_MING
+       PHP_FALIAS(getutf8width,           swftext_getUTF8Width,      NULL)
+/*     PHP_FALIAS(getwidewidth,           swftext_getWideWidth,      NULL)*/
+#endif
        PHP_FALIAS(getascent,              swftext_getAscent,         NULL)
        PHP_FALIAS(getdescent,             swftext_getDescent,        NULL)
        PHP_FALIAS(getleading,             swftext_getLeading,        NULL)
@@ -2480,6 +3266,45 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto void swftext_addUTF8String(string text)
+   Writes the given text into this SWFText object at the current pen position,
+   using the current font, height, spacing, and color */
+
+PHP_FUNCTION(swftext_addUTF8String)
+{
+       zval **s;
+       SWFText text = getText(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(s);
+
+       SWFText_addUTF8String(text, Z_STRVAL_PP(s), NULL);
+}
+
+/* }}} */
+/* {{{ proto void swftext_addWideString(string text)
+   Writes the given text into this SWFText object at the current pen position,
+   using the current font, height, spacing, and color */
+/*
+PHP_FUNCTION(swftext_addWideString)
+{
+       zval **s;
+       SWFText text = getText(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(s);
+
+       SWFText_addWideString(text, Z_STRVAL_PP(s), NULL);
+}
+*/
+/* }}} */
+#endif
+
 /* {{{ proto float swftext_getWidth(string str)
    Calculates the width of the given string in this text objects current font and 
size */
 PHP_FUNCTION(swftext_getWidth)
@@ -2494,6 +3319,47 @@
 }
 /* }}} */
 
+#ifdef HAVE_NEW_MING
+/* {{{ proto double swftext_getUTF8Width(string)
+   calculates the width of the given string in this text objects current font and 
size */
+
+PHP_FUNCTION(swftext_getUTF8Width)
+{
+       zval **zstring;
+       int width;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       width = SWFText_getUTF8StringWidth(getText(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+
+       RETURN_DOUBLE(width);
+}
+
+/* }}} */
+/* {{{ proto double swftext_getWideWidth(string)
+   calculates the width of the given string in this text objects current font and 
size */
+/*
+PHP_FUNCTION(swftext_getWideWidth)
+{
+       zval **zstring;
+       int width;
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       width = SWFText_getWideStringWidth(getText(getThis() TSRMLS_CC), 
Z_STRVAL_PP(zstring));
+
+       RETURN_DOUBLE(width);
+}
+*/
+/* }}} */
+#endif
+
 /* {{{ proto float swftext_getAscent(void)
    Returns the ascent of the current font at its current size, or 0 if not available 
*/
 PHP_FUNCTION(swftext_getAscent)
@@ -2535,6 +3401,8 @@
        PHP_FALIAS(setcolor,          swftextfield_setColor,        NULL)
        PHP_FALIAS(setname,           swftextfield_setName,         NULL)
        PHP_FALIAS(addstring,         swftextfield_addString,       NULL)
+       PHP_FALIAS(setpadding,        swftextfield_setPadding,      NULL)
+       PHP_FALIAS(addchars,          swftextfield_addChars,        NULL)
        { NULL, NULL, NULL }
 };
 
@@ -2558,12 +3426,12 @@
                SWFTextField_setFlags(field, Z_LVAL_PP(flags));
        }
 }
+/* }}} */
 
 static void destroy_SWFTextField_resource(zend_rsrc_list_entry *resource TSRMLS_DC)
 {
        destroySWFTextField((SWFTextField)resource->ptr);
 }
-/* }}} */
 
 /* {{{ internal function getTextField
    Returns the SWFTextField object contained in zval *id */
@@ -2773,6 +3641,39 @@
        SWFTextField_addString(field, Z_STRVAL_PP(string));
 }
 /* }}} */
+
+/* {{{ proto void swftextfield_setPadding(float padding)
+   Sets the padding of this textfield */
+PHP_FUNCTION(swftextfield_setPadding)
+{
+       zval **padding;
+       SWFTextField field = getTextField(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &padding) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_double_ex(padding);
+
+       SWFTextField_setPadding(field, Z_DVAL_PP(padding));
+}
+/* }}} */
+
+/* {{{ proto void swftextfield_addChars(string)
+   adds characters to a font that will be available within a textfield */
+PHP_FUNCTION(swftextfield_addChars)
+{
+       zval **zstring;
+       SWFTextField field = getTextField(getThis() TSRMLS_CC);
+
+       if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zstring) == FAILURE)
+               WRONG_PARAM_COUNT;
+
+       convert_to_string_ex(zstring);
+
+       SWFTextField_addChars(field, Z_STRVAL_PP(zstring));
+
+}
+/* }}} */
 /* }}} */
 
 zend_module_entry ming_module_entry = {
@@ -2842,12 +3743,15 @@
        zend_class_entry text_class_entry;
        zend_class_entry textfield_class_entry;
        zend_class_entry font_class_entry;
+       zend_class_entry fontchar_class_entry;
        zend_class_entry displayitem_class_entry;
        zend_class_entry movie_class_entry;
        zend_class_entry button_class_entry;
        zend_class_entry action_class_entry;
        zend_class_entry morph_class_entry;
        zend_class_entry sprite_class_entry;
+       zend_class_entry sound_class_entry;
+       zend_class_entry soundinstance_class_entry;
 
        Ming_setErrorFunction((void *) php_ming_error);
 
@@ -2908,6 +3812,7 @@
        le_swftextp = zend_register_list_destructors_ex(destroy_SWFText_resource, 
NULL, "SWFText", module_number);
        le_swftextfieldp = 
zend_register_list_destructors_ex(destroy_SWFTextField_resource, NULL, "SWFTextField", 
module_number);
        le_swffontp = zend_register_list_destructors_ex(destroy_SWFFont_resource, 
NULL, "SWFFont", module_number);
+       le_swffontcharp = 
zend_register_list_destructors_ex(destroy_SWFFontCharacter_resource, NULL, 
"SWFFontCharacter", module_number);
        le_swfdisplayitemp = zend_register_list_destructors_ex(NULL, NULL, 
"SWFDisplayItem", module_number);
        le_swfmoviep = zend_register_list_destructors_ex(destroy_SWFMovie_resource, 
NULL, "SWFMovie", module_number);
        le_swfbuttonp = zend_register_list_destructors_ex(destroy_SWFButton_resource, 
NULL, "SWFButton", module_number);
@@ -2916,6 +3821,9 @@
        le_swfspritep = zend_register_list_destructors_ex(destroy_SWFSprite_resource, 
NULL, "SWFSprite", module_number);
        le_swfinputp = zend_register_list_destructors_ex(destroy_SWFInput_resource, 
NULL, "SWFInput", module_number);
 
+       le_swfsoundp = zend_register_list_destructors_ex(destroy_SWFSound_resource, 
NULL, "SWFSound", module_number);
+       le_swfsoundinstancep = zend_register_list_destructors_ex(NULL, NULL, 
"SWFSoundInstance", module_number);
+
        INIT_CLASS_ENTRY(shape_class_entry, "swfshape", swfshape_functions);
        INIT_CLASS_ENTRY(fill_class_entry, "swffill", swffill_functions);
        INIT_CLASS_ENTRY(gradient_class_entry, "swfgradient", swfgradient_functions);
@@ -2929,6 +3837,10 @@
        INIT_CLASS_ENTRY(action_class_entry, "swfaction", swfaction_functions);
        INIT_CLASS_ENTRY(morph_class_entry, "swfmorph", swfmorph_functions);
        INIT_CLASS_ENTRY(sprite_class_entry, "swfsprite", swfsprite_functions);
+       INIT_CLASS_ENTRY(sound_class_entry, "swfsound", swfsound_functions);
+#ifdef HAVE_NEW_MING
+       INIT_CLASS_ENTRY(soundinstance_class_entry, "swfsoundinstance", 
swfsoundinstance_functions);
+#endif
 
        shape_class_entry_ptr = zend_register_internal_class(&shape_class_entry 
TSRMLS_CC);
        fill_class_entry_ptr = zend_register_internal_class(&fill_class_entry 
TSRMLS_CC);
Index: php-src/ext/ming/php_ming.h
diff -u php-src/ext/ming/php_ming.h:1.13 php-src/ext/ming/php_ming.h:1.14
--- php-src/ext/ming/php_ming.h:1.13    Fri Jul 11 03:48:11 2003
+++ php-src/ext/ming/php_ming.h Thu Nov  6 02:29:37 2003
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_ming.h,v 1.13 2003/07/11 07:48:11 sniper Exp $ */
+/* $Id: php_ming.h,v 1.14 2003/11/06 07:29:37 fmk Exp $ */
 
 #ifndef _PHP_MING_H
 #define _PHP_MING_H
@@ -77,6 +77,13 @@
 
 #ifdef HAVE_NEW_MING
 PHP_FUNCTION(swfmovie_streamMp3);
+PHP_FUNCTION(swfmovie_addExport);
+PHP_FUNCTION(swfmovie_writeExports);
+PHP_FUNCTION(swfmovie_startSound);
+PHP_FUNCTION(swfmovie_stopSound);
+PHP_FUNCTION(swfmovie_importChar);
+PHP_FUNCTION(swfmovie_importFont);
+PHP_FUNCTION(swfmovie_addFont);
 #endif
 
 PHP_FUNCTION(swfsprite_init);
@@ -86,12 +93,30 @@
 PHP_FUNCTION(swfsprite_labelFrame);
 PHP_FUNCTION(swfsprite_setFrames);
 
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swfsprite_startSound);
+PHP_FUNCTION(swfsprite_stopSound);
+#endif
+
 PHP_FUNCTION(swffont_init);
 PHP_FUNCTION(swffont_getWidth);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swffont_getUTF8Width);
+/*PHP_FUNCTION(swffont_getWideWidth);*/
+#endif
+
 PHP_FUNCTION(swffont_getAscent);
 PHP_FUNCTION(swffont_getDescent);
 PHP_FUNCTION(swffont_getLeading);
 
+#ifdef HAVE_NEW_MING
+/*PHP_FUNCTION(swffont_addChars);*/
+PHP_FUNCTION(swffont_getShape);
+#endif
+
+PHP_FUNCTION(swffont_getLeading);
+
 PHP_FUNCTION(swftext_init);
 PHP_FUNCTION(swftext_setFont);
 PHP_FUNCTION(swftext_setHeight);
@@ -99,7 +124,19 @@
 PHP_FUNCTION(swftext_setColor);
 PHP_FUNCTION(swftext_moveTo);
 PHP_FUNCTION(swftext_addString);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swftext_addUTF8String);
+/*PHP_FUNCTION(swftext_addWideString);*/
+#endif
+
 PHP_FUNCTION(swftext_getWidth);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swftext_getUTF8Width);
+/*PHP_FUNCTION(swftext_getWideWidth);*/
+#endif
+
 PHP_FUNCTION(swftext_getAscent);
 PHP_FUNCTION(swftext_getDescent);
 PHP_FUNCTION(swftext_getLeading);
@@ -117,6 +154,11 @@
 PHP_FUNCTION(swftextfield_setColor);
 PHP_FUNCTION(swftextfield_setName);
 PHP_FUNCTION(swftextfield_addString);
+PHP_FUNCTION(swftextfield_setPadding);
+PHP_FUNCTION(swftextfield_addChars);
+
+PHP_FUNCTION(swffontchar_addChars);
+PHP_FUNCTION(swffontchar_addUTF8Chars);
 
 PHP_FUNCTION(swfdisplayitem_move);
 PHP_FUNCTION(swfdisplayitem_moveTo);
@@ -136,6 +178,19 @@
 PHP_FUNCTION(swfdisplayitem_setName);
 PHP_FUNCTION(swfdisplayitem_addAction);
 
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swfdisplayitem_remove);
+PHP_FUNCTION(swfdisplayitem_setMaskLevel);
+PHP_FUNCTION(swfdisplayitem_endMask);
+PHP_FUNCTION(swfdisplayitem_getX);
+PHP_FUNCTION(swfdisplayitem_getY);
+PHP_FUNCTION(swfdisplayitem_getXScale);
+PHP_FUNCTION(swfdisplayitem_getYScale);
+PHP_FUNCTION(swfdisplayitem_getXSkew);
+PHP_FUNCTION(swfdisplayitem_getYSkew);
+PHP_FUNCTION(swfdisplayitem_getRot);
+#endif
+
 PHP_FUNCTION(swfbutton_init);
 PHP_FUNCTION(swfbutton_setHit);
 PHP_FUNCTION(swfbutton_setOver);
@@ -143,8 +198,17 @@
 PHP_FUNCTION(swfbutton_setDown);
 PHP_FUNCTION(swfbutton_setAction);
 PHP_FUNCTION(swfbutton_addShape);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swfbutton_setMenu);
+#endif
+
 PHP_FUNCTION(swfbutton_addAction);
 
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swfbutton_addSound);
+#endif
+
 PHP_FUNCTION(swfbutton_keypress);
 
 PHP_FUNCTION(swfaction_init);
@@ -153,9 +217,22 @@
 PHP_FUNCTION(swfmorph_getShape1);
 PHP_FUNCTION(swfmorph_getShape2);
 
+PHP_FUNCTION(swfsound_init);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(swfsoundinstance_noMultiple);
+PHP_FUNCTION(swfsoundinstance_loopInPoint);
+PHP_FUNCTION(swfsoundinstance_loopOutPoint);
+PHP_FUNCTION(swfsoundinstance_loopCount);
+#endif
+
 PHP_FUNCTION(ming_setCubicThreshold);
 PHP_FUNCTION(ming_setScale);
 PHP_FUNCTION(ming_useSWFVersion);
+
+#ifdef HAVE_NEW_MING
+PHP_FUNCTION(ming_useConstants);
+#endif
 
 #else
 #define ming_module_ptr NULL

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to