Thank you Wez.
Here it is:
diff -aur php5-STABLE-200503310030 orig/ext/ming/ming.c
php5-STABLE-200503310030 edit/ext/ming/ming.c
--- php5-STABLE-200503310030 orig/ext/ming/ming.c Fri Oct 1
16:33:36 2004
+++ php5-STABLE-200503310030 edit/ext/ming/ming.c Sat Feb 5
02:08:50 2005
@@ -72,6 +72,7 @@
#ifdef HAVE_NEW_MING
static SWFFontCharacter getFontCharacter(zval *id TSRMLS_DC);
static SWFSoundInstance getSoundInstance(zval *id TSRMLS_DC);
+static SWFPrebuiltClip getPrebuiltClip(zval *id TSRMLS_DC);
#endif
#define PHP_MING_FILE_CHK(file) \
@@ -156,6 +157,7 @@
#ifdef HAVE_NEW_MING
static int le_swffontcharp;
static int le_swfsoundinstancep;
+static int le_swfprebuiltclipp;
#endif
static zend_class_entry *movie_class_entry_ptr;
@@ -175,6 +177,7 @@
#ifdef HAVE_NEW_MING
static zend_class_entry *fontchar_class_entry_ptr;
static zend_class_entry *soundinstance_class_entry_ptr;
+static zend_class_entry *prebuiltclip_class_entry_ptr;
#endif
/* {{{ internal function SWFgetProperty
@@ -232,6 +235,8 @@
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) == prebuiltclip_class_entry_ptr)
+ return (SWFCharacter)getPrebuiltClip(id TSRMLS_CC);
/*
else if(Z_OBJCE_P(id) == soundinstance_class_entry_ptr)
return (SWFCharacter)getSoundInstance(id TSRMLS_CC);
@@ -321,6 +326,78 @@
};
/* }}} */
+/* {{{ SWFPrebuiltClip */
+/* {{{ proto class swfprebuiltclip_init([file])
+ Returns a SWFPrebuiltClip object */
+
+PHP_METHOD(swfprebuiltclip, __construct)
+{
+ zval **zfile = NULL;
+ SWFPrebuiltClip clip;
+ SWFInput input;
+ int ret;
+
+ switch(ZEND_NUM_ARGS()) {
+ case 1:
+ if(zend_get_parameters_ex(1, &zfile) == FAILURE)
+ 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);
+
+ clip = newSWFPrebuiltClip_fromInput(input);
+ break;
+/* not sure whether this makes sense
+ there would have to be a function to add contents
+ case 0:
+ clip = newSWFPrebuiltClip();
+ break; */
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+
+ if(clip) {
+ ret = zend_list_insert(clip, le_swfprebuiltclipp);
+ object_init_ex(getThis(), prebuiltclip_class_entry_ptr);
+ add_property_resource(getThis(), "prebuiltclip", ret);
+ zend_list_addref(ret);
+ }
+}
+/* }}} */
+
+/* {{{ internal function destroy_SWFPrebuiltClip */
+static void destroy_SWFPrebuiltClip_resource(zend_rsrc_list_entry
*resource TSRMLS_DC)
+{
+ destroySWFPrebuiltClip((SWFPrebuiltClip)resource->ptr);
+}
+/* }}} */
+
+/* {{{ internal function getPrebuiltClip
+ Returns the SWFPrebuiltClip object contained in zval *id */
+
+static SWFPrebuiltClip getPrebuiltClip(zval *id TSRMLS_DC)
+{
+ void *clip = SWFgetProperty(id, "prebuiltclip", 12, le_swfprebuiltclipp
TSRMLS_CC);
+
+ if(!clip)
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "called object
is not an SWFPrebuiltClip, well it is, this just isnt working!");
+
+ return (SWFPrebuiltClip)clip;
+}
+static zend_function_entry swfprebuiltclip_functions[] = {
+ PHP_ME(swfprebuiltclip, __construct, NULL, 0)
+ { NULL, NULL, NULL }
+};
+/* }}} */
+/* }}} */
+
/* {{{ SWFBitmap
*/
/* {{{ proto class swfbitmap::__construct(mixed file [, mixed maskfile])
@@ -361,7 +438,7 @@
} else {
maskinput = getInput(zmask TSRMLS_CC);
}
- bitmap = newSWFJpegWithAlpha_fromInput(input, maskinput);
+ /*bitmap = newSWFJpegWithAlpha_fromInput(input,
maskinput);*/
} else {
bitmap = newSWFBitmap_fromInput(input);
}
@@ -2035,7 +2112,8 @@
#endif
#ifdef HAVE_NEW_MING
- RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL,
limit));
+ /* RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL,
limit)); */
+ RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));
#else
RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));
#endif
@@ -2084,7 +2162,8 @@
ZEND_FETCH_RESOURCE(what, php_stream *, x,
-1,"File-Handle",php_file_le_stream());
#ifdef HAVE_NEW_MING
- RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what,
limit));
+ /*RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what,
limit));*/
+ RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
#else
RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
#endif
@@ -2129,7 +2208,8 @@
if (Z_TYPE_PP(x) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE(stream, php_stream *, x,
-1,"File-Handle",php_file_le_stream());
#ifdef HAVE_NEW_MING
- RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, stream, limit));
+ /*RETURN_LONG(SWFMovie_output(getMovie(getThis()
TSRMLS_CC), &phpStreamOutputMethod, stream, limit));*/
+ RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, stream));
#else
RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, stream));
#endif
@@ -2143,7 +2223,8 @@
}
#ifdef HAVE_NEW_MING
- retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, (void *)stream, limit);
+ /*retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, (void *)stream, limit);*/
+ retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, (void *)stream);
#else
retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC),
&phpStreamOutputMethod, (void *)stream);
#endif
@@ -3475,7 +3556,7 @@
WRONG_PARAM_COUNT;
}
convert_to_object_ex(font);
- SWFTextField_setFont(field, getFont(*font TSRMLS_CC));
+ /*SWFTextField_setFont(field, getFont(*font TSRMLS_CC));*/
}
/* }}} */
@@ -3795,6 +3876,7 @@
#ifdef HAVE_NEW_MING
zend_class_entry fontchar_class_entry;
zend_class_entry soundinstance_class_entry;
+ zend_class_entry prebuiltclip_class_entry;
#endif
Ming_setErrorFunction((void *) php_ming_error);
@@ -3868,6 +3950,7 @@
#ifdef HAVE_NEW_MING
le_swffontcharp =
zend_register_list_destructors_ex(destroy_SWFFontCharacter_resource, NULL,
"SWFFontCharacter", module_number);
le_swfsoundinstancep = zend_register_list_destructors_ex(NULL,
NULL, "SWFSoundInstance", module_number);
+ le_swfprebuiltclipp =
zend_register_list_destructors_ex(destroy_SWFPrebuiltClip_resource, NULL,
"SWFPrebuiltClip", module_number);
#endif
INIT_CLASS_ENTRY(shape_class_entry, "SWFShape",
swfshape_functions);
@@ -3887,6 +3970,7 @@
#ifdef HAVE_NEW_MING
INIT_CLASS_ENTRY(fontchar_class_entry, "SWFFontChar",
swffontchar_functions);
INIT_CLASS_ENTRY(soundinstance_class_entry, "SWFSoundInstance",
swfsoundinstance_functions);
+ INIT_CLASS_ENTRY(prebuiltclip_class_entry, "SWFPrebuiltClip",
swfprebuiltclip_functions);
#endif
shape_class_entry_ptr =
zend_register_internal_class(&shape_class_entry TSRMLS_CC);
@@ -3906,6 +3990,7 @@
#ifdef HAVE_NEW_MING
fontchar_class_entry_ptr =
zend_register_internal_class(&fontchar_class_entry TSRMLS_CC);
soundinstance_class_entry_ptr =
zend_register_internal_class(&soundinstance_class_entry TSRMLS_CC);
+ prebuiltclip_class_entry_ptr =
zend_register_internal_class(&prebuiltclip_class_entry TSRMLS_CC);
#endif
return SUCCESS;
diff -aur php5-STABLE-200503310030 orig/ext/ming/php_ming.h
php5-STABLE-200503310030 edit/ext/ming/php_ming.h
--- php5-STABLE-200503310030 orig/ext/ming/php_ming.h Fri Mar 26
19:39:06 2004
+++ php5-STABLE-200503310030 edit/ext/ming/php_ming.h Sat Feb 5
01:09:46 2005
@@ -86,6 +86,11 @@
PHP_METHOD(swfmovie, addFont);
#endif
+
+#ifdef HAVE_NEW_MING
+PHP_METHOD(swfprebuiltclip, init);
+#endif
+
PHP_METHOD(swfsprite, init);
PHP_METHOD(swfsprite, add);
PHP_METHOD(swfsprite, remove);
On Thu, 14 Apr 2005, Wez Furlong wrote:
> You need to make sure that your attachments are plain text.
> Either that, or put the patches online and post a link.
>
> --Wez.
>
> On 4/14/05, Albert Lash <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm trying to get a snibbet of code contributed. My emails don't seem to
> > be getting onto the list. This is my last try, otherwise I'll email
> > someone on the list to see if they can connect for me.
> >
> > Alby
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php