[php-directfb-cvs] PHP-DirectFB/src datatypes.c,1.2,1.3 idatabuffer.c,1.1.1.1,1.2 idirectfb.c,1.1.1.
Status: Pre-Alpha
Brought to you by:
klan
From: Claudio C. <kl...@us...> - 2004-11-15 15:06:49
|
Update of /cvsroot/php-directfb/PHP-DirectFB/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13072 Modified Files: datatypes.c idatabuffer.c idirectfb.c idisplaylayer.c ieventbuffer.c ifont.c iimageprovider.c iinputdevice.c ipalette.c iscreen.c isurface.c ivideoprovider.c iwindow.c php_directfb.c php_directfb.h Log Message: Review of the interface handling routines: now private data is handled by a Resource and each interface can register a specific destructor for its own data. Added support for preallocated surfaces. Added some debugging macros for interface handling routines: PD_DEBUG, PD_MAGIC_SET, PD_MAGIC_CHECK Index: datatypes.c =================================================================== RCS file: /cvsroot/php-directfb/PHP-DirectFB/src/datatypes.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** datatypes.c 13 Nov 2004 16:17:54 -0000 1.2 --- datatypes.c 15 Nov 2004 15:06:18 -0000 1.3 *************** *** 30,33 **** --- 30,36 ---- #include "php_directfb.h" + #include <direct/types.h> + #include <direct/memcpy.h> + enum { *************** *** 55,59 **** if (zend_hash_find( ht, (char*) entry, size, (void**) &tmp ) != SUCCESS) { ! php_error( E_ERROR, "entry '%s' not found", entry ); return; } --- 58,62 ---- if (zend_hash_find( ht, (char*) entry, size, (void**) &tmp ) != SUCCESS) { ! php_error( E_ERROR, "property '%s' not found", entry ); return; } *************** *** 124,134 **** /*********************************** DFBPoint ********************************/ ! static void DFBPoint_ctor( int ht, zval *this ) { DFBPoint point; ! if (zend_parse_parameters( ht, "ll", &point.x, &point.y ) == SUCCESS) ! DFBPoint_init( &point, this ); } --- 127,140 ---- /*********************************** DFBPoint ********************************/ ! static bool DFBPoint_ctor( int ht, zval *this ) { DFBPoint point; ! if (zend_parse_parameters( ht, "ll", &point.x, &point.y ) != SUCCESS) ! return false; ! ! DFBPoint_init( &point, this ); ! return true; } *************** *** 154,158 **** /********************************** DFBRectangle *****************************/ ! static void DFBRectangle_ctor( int ht, zval *this ) { --- 160,164 ---- /********************************** DFBRectangle *****************************/ ! static bool DFBRectangle_ctor( int ht, zval *this ) { *************** *** 160,165 **** if (zend_parse_parameters( ht, "llll", ! &rect.x, &rect.y, &rect.w, &rect.h ) == SUCCESS) ! DFBRectangle_init( &rect, this ); } --- 166,174 ---- if (zend_parse_parameters( ht, "llll", ! &rect.x, &rect.y, &rect.w, &rect.h ) != SUCCESS) ! return false; ! ! DFBRectangle_init( &rect, this ); ! return true; } *************** *** 189,199 **** /********************************** DFBSpan **********************************/ ! static void DFBSpan_ctor( int ht, zval *this ) { DFBSpan span; ! if (zend_parse_parameters( ht, "ll", &span.x, &span.w ) == SUCCESS) ! DFBSpan_init( &span, this ); } --- 198,211 ---- /********************************** DFBSpan **********************************/ ! static bool DFBSpan_ctor( int ht, zval *this ) { DFBSpan span; ! if (zend_parse_parameters( ht, "ll", &span.x, &span.w ) != SUCCESS) ! return false; ! ! DFBSpan_init( &span, this ); ! return true; } *************** *** 219,223 **** /***************************** DFBRegion *************************************/ ! static void DFBRegion_ctor( int ht, zval *this ) { --- 231,235 ---- /***************************** DFBRegion *************************************/ ! static bool DFBRegion_ctor( int ht, zval *this ) { *************** *** 225,230 **** if (zend_parse_parameters( ht, "llll", ! ®.x1, ®.y1, ®.x2, ®.y2 ) == SUCCESS) ! DFBRegion_init( ®, this ); } --- 237,245 ---- if (zend_parse_parameters( ht, "llll", ! ®.x1, ®.y1, ®.x2, ®.y2 ) != SUCCESS) ! return false; ! ! DFBRegion_init( ®, this ); ! return true; } *************** *** 254,258 **** /**************************** DFBVertex **************************************/ ! static void DFBVertex_ctor( int ht, zval *this ) { --- 269,273 ---- /**************************** DFBVertex **************************************/ ! static bool DFBVertex_ctor( int ht, zval *this ) { *************** *** 264,268 **** --- 279,286 ---- DFBVertex ve = { x, y, z, w, s, t }; DFBVertex_init( &ve, this ); + return true; } + + return false; } *************** *** 296,300 **** /****************************** DFBColor *************************************/ ! static void DFBColor_ctor( int ht, zval *this ) { --- 314,318 ---- /****************************** DFBColor *************************************/ ! static bool DFBColor_ctor( int ht, zval *this ) { *************** *** 304,308 **** --- 322,329 ---- DFBColor color = { a, r, g, b }; DFBColor_init( &color, this ); + return true; } + + return false; } *************** *** 375,379 **** /************************** DFBScreenMixerConfig *****************************/ ! static void DFBScreenMixerConfig_ctor( int ht, zval *this ) { --- 396,400 ---- /************************** DFBScreenMixerConfig *****************************/ ! static bool DFBScreenMixerConfig_ctor( int ht, zval *this ) { *************** *** 385,402 **** if (zend_parse_parameters( ht, "llllO!", &config.flags, &config.tree, &config.level, &config.layers, ! &bg, DFBScreenMixerConfig_ce ) == SUCCESS) { ! if (!bg) { ! MAKE_STD_ZVAL( bg ); ! object_init_ex( bg, DFBColor_ce ); ! DFBColor_init( &config.background, bg ); ! } else ! ZVAL_ADDREF( bg ); ! add_property_long( this, "flags", config.flags ); ! add_property_long( this, "tree", config.tree ); ! add_property_long( this, "level", config.level ); ! add_property_long( this, "layers", config.layers ); ! add_property_zval( this, "background", bg ); ! } } --- 406,425 ---- if (zend_parse_parameters( ht, "llllO!", &config.flags, &config.tree, &config.level, &config.layers, ! &bg, DFBScreenMixerConfig_ce ) != SUCCESS) ! return false; ! ! if (!bg) { ! MAKE_STD_ZVAL( bg ); ! object_init_ex( bg, DFBColor_ce ); ! DFBColor_init( &config.background, bg ); ! } else ! ZVAL_ADDREF( bg ); ! add_property_long( this, "flags", config.flags ); ! add_property_long( this, "tree", config.tree ); ! add_property_long( this, "level", config.level ); ! add_property_long( this, "layers", config.layers ); ! add_property_zval( this, "background", bg ); ! return true; } *************** *** 458,462 **** /*************************** DFBScreenEncoderConfig **************************/ ! static void DFBScreenEncoderConfig_ctor( int ht, zval *this ) { --- 481,485 ---- /*************************** DFBScreenEncoderConfig **************************/ ! static bool DFBScreenEncoderConfig_ctor( int ht, zval *this ) { *************** *** 464,469 **** if (zend_parse_parameters( ht, "llll", &config.flags, &config.tv_standard, ! &config.test_picture, &config.mixer ) == SUCCESS) ! DFBScreenEncoderConfig_init( &config, this ); } --- 487,495 ---- if (zend_parse_parameters( ht, "llll", &config.flags, &config.tv_standard, ! &config.test_picture, &config.mixer ) != SUCCESS) ! return false; ! ! DFBScreenEncoderConfig_init( &config, this ); ! return true; } *************** *** 512,516 **** /************************** DFBScreenOutputConfig ****************************/ ! static void DFBScreenOutputConfig_ctor( int ht, zval *this ) { --- 538,542 ---- /************************** DFBScreenOutputConfig ****************************/ ! static bool DFBScreenOutputConfig_ctor( int ht, zval *this ) { *************** *** 518,523 **** if (zend_parse_parameters( ht, "llll", &config.flags, &config.encoder, ! &config.out_signals, &config.out_connectors ) == SUCCESS) ! DFBScreenOutputConfig_init( &config, this ); } --- 544,552 ---- if (zend_parse_parameters( ht, "llll", &config.flags, &config.encoder, ! &config.out_signals, &config.out_connectors ) != SUCCESS) ! return false; ! ! DFBScreenOutputConfig_init( &config, this ); ! return true; } *************** *** 568,572 **** /*********************** DFBDisplayLayerConfig *******************************/ ! static void DFBDisplayLayerConfig_ctor( int ht, zval *this ) { --- 597,601 ---- /*********************** DFBDisplayLayerConfig *******************************/ ! static bool DFBDisplayLayerConfig_ctor( int ht, zval *this ) { *************** *** 575,580 **** if (zend_parse_parameters( ht, "llllll", &config.flags, &config.width, &config.height, &config.pixelformat, ! &config.buffermode, &config.options ) == SUCCESS) ! DFBDisplayLayerConfig_init( &config, this ); } --- 604,612 ---- if (zend_parse_parameters( ht, "llllll", &config.flags, &config.width, &config.height, &config.pixelformat, ! &config.buffermode, &config.options ) != SUCCESS) ! return false; ! ! DFBDisplayLayerConfig_init( &config, this ); ! return true; } *************** *** 617,621 **** /************************ DFBColorAdjustment *********************************/ ! static void DFBColorAdjustment_ctor( int ht, zval *this ) { --- 649,653 ---- /************************ DFBColorAdjustment *********************************/ ! static bool DFBColorAdjustment_ctor( int ht, zval *this ) { *************** *** 627,631 **** --- 659,666 ---- DFBColorAdjustment adj = { flags, b, c, h, s }; DFBColorAdjustment_init( &adj, this ); + return true; } + + return false; } *************** *** 665,705 **** /**************************** DFBSurfaceDescription **************************/ ! static void DFBSurfaceDescription_ctor( int ht, zval *this ) { DFBSurfaceDescription dsc; zval *palette = NULL; ! if (zend_parse_parameters( ht, "llllla!", &dsc.flags, ! &dsc.caps, &dsc.width, &dsc.height, ! &dsc.pixelformat, &palette ) == SUCCESS) { ! if (palette) { ! zval **entry; ! int i = 0; ! while (zend_hash_index_find( Z_ARRVAL_P( palette ), ! i++, (void**) &entry ) == SUCCESS) { ! if (Z_TYPE_PP( entry ) != IS_OBJECT || ! Z_OBJCE_PP( entry ) != DFBColor_ce) { ! palette = NULL; ! break; ! } } } ! if (!palette) { ! MAKE_STD_ZVAL( palette ); ! array_init( palette ); ! } else ! ZVAL_ADDREF( palette ); ! add_property_long( this, "flags", dsc.flags ); ! add_property_long( this, "caps", dsc.caps ); ! add_property_long( this, "width", dsc.width ); ! add_property_long( this, "height", dsc.height ); ! add_property_long( this, "pixelformat", dsc.pixelformat ); ! /* no preallocated */ ! add_property_zval( this, "palette", palette ); ! } } --- 700,750 ---- /**************************** DFBSurfaceDescription **************************/ ! static bool DFBSurfaceDescription_ctor( int ht, zval *this ) { DFBSurfaceDescription dsc; + char *buffer = NULL; + int size = 0; + int pitch = 0; zval *palette = NULL; ! if (zend_parse_parameters( ht, "llllls!la!", &dsc.flags, &dsc.caps, ! &dsc.width, &dsc.height, &dsc.pixelformat, ! &buffer, &size, &pitch, &palette ) != SUCCESS) ! return false; ! ! if (palette) { ! zval **entry; ! int i = 0; ! while (zend_hash_index_find( Z_ARRVAL_P( palette ), ! i++, (void**) &entry ) == SUCCESS) { ! if (Z_TYPE_PP( entry ) != IS_OBJECT || ! Z_OBJCE_PP( entry ) != DFBColor_ce) { ! palette = NULL; ! break; } } + } ! if (!palette) { ! MAKE_STD_ZVAL( palette ); ! array_init( palette ); ! } else ! ZVAL_ADDREF( palette ); ! add_property_long( this, "flags", dsc.flags ); ! add_property_long( this, "caps", dsc.caps ); ! add_property_long( this, "width", dsc.width ); ! add_property_long( this, "height", dsc.height ); ! add_property_long( this, "pixelformat", dsc.pixelformat ); ! if (buffer && size > 0 && pitch > 0) ! add_property_stringl( this, "preallocated", buffer, size, 1 ); ! else ! add_property_unset( this, "preallocated" ); ! add_property_long( this, "preallocated_pitch", pitch ); ! add_property_zval( this, "palette", palette ); ! ! return true; } *************** *** 728,734 **** add_property_long( ret, "height", dsc->height ); add_property_long( ret, "pixelformat", dsc->pixelformat ); - /* no preallocated */ - add_property_zval( ret, "palette", palette ); } --- 773,792 ---- add_property_long( ret, "height", dsc->height ); add_property_long( ret, "pixelformat", dsc->pixelformat ); + if ((dsc->flags & DSDESC_PREALLOCATED) && dsc->preallocated[0].data && + dsc->preallocated[0].pitch > 0 && dsc->height > 0 && dsc->pixelformat) { + int size = dsc->preallocated[0].pitch * dsc->height; + + if (dsc->pixelformat == DSPF_YV12 || + dsc->pixelformat == DSPF_I420) + size += (size >> 1) & ~1; + + add_property_stringl( ret, "preallocated", + dsc->preallocated[0].data, size, 1 ); + } else + add_property_unset( ret, "preallocated" ); + + add_property_long( ret, "preallocated_pitch", dsc->preallocated[0].pitch ); + add_property_zval( ret, "palette", palette ); } *************** *** 752,759 **** GET_ENTRY_LONG( pixelformat, &ret->pixelformat ); if (ret->flags & DSDESC_PALETTE) { DFBColor *palette = NULL; ! zval *pal; ! zval **entry; int i = 0; --- 810,835 ---- GET_ENTRY_LONG( pixelformat, &ret->pixelformat ); + if (ret->flags & DSDESC_PREALLOCATED) { + zval *data = NULL; + + GET_ENTRY_DATA( preallocated, &data ); + GET_ENTRY_LONG( preallocated_pitch, &ret->preallocated[0].pitch ); + + if (data && Z_STRLEN_P( data ) > 0 && ret->preallocated[0].pitch > 0) { + ret->preallocated[0].data = emalloc( Z_STRLEN_P( data ) ); + direct_memcpy( ret->preallocated[0].data, + Z_STRVAL_P( data ), Z_STRLEN_P( data ) ); + ret->preallocated[1] = ret->preallocated[0]; + } else { + php_error( E_WARNING, + "wrong or unset DFBSurfaceDescription::$preallocated" ); + ret->flags &= ~DSDESC_PREALLOCATED; + } + } + if (ret->flags & DSDESC_PALETTE) { DFBColor *palette = NULL; ! zval *pal = NULL; ! zval **entry = NULL; int i = 0; *************** *** 772,777 **** ret->palette.entries = palette; ret->palette.size = i; ! } else ! ret->flags &= ~DSDESC_PALETTE; } } --- 848,856 ---- ret->palette.entries = palette; ret->palette.size = i; ! } else { ! php_error( E_WARNING, ! "wrong or unset DFBSurfaceDescription::$palette" ); ! ret->flags &= ~DSDESC_PALETTE; ! } } } *************** *** 782,786 **** /************************* DFBPaletteDescription *****************************/ ! static void DFBPaletteDescription_ctor( int ht, zval *this ) { --- 861,865 ---- /************************* DFBPaletteDescription *****************************/ ! static bool DFBPaletteDescription_ctor( int ht, zval *this ) { *************** *** 789,818 **** if (zend_parse_parameters( ht, "llla!", &dsc.flags, &dsc.caps, ! &dsc.size, &entries ) == SUCCESS) { ! if (entries) { ! zval **entry; ! int i = 0; ! while (zend_hash_index_find( Z_ARRVAL_P( entries ), ! i++, (void**) &entry ) == SUCCESS) { ! if (Z_TYPE_PP( entry ) != IS_OBJECT || ! Z_OBJCE_PP( entry ) != DFBColor_ce) { ! entries = NULL; ! break; ! } } } ! if (!entries) { ! MAKE_STD_ZVAL( entries ); ! array_init( entries ); ! } else ! ZVAL_ADDREF( entries ); ! add_property_long( this, "flags", dsc.flags ); ! add_property_long( this, "caps", dsc.caps ); ! add_property_long( this, "size", dsc.size ); ! add_property_zval( this, "entries", entries ); ! } } --- 868,900 ---- if (zend_parse_parameters( ht, "llla!", &dsc.flags, &dsc.caps, ! &dsc.size, &entries ) != SUCCESS) ! return false; ! ! if (entries) { ! zval **entry; ! int i = 0; ! while (zend_hash_index_find( Z_ARRVAL_P( entries ), ! i++, (void**) &entry ) == SUCCESS) { ! if (Z_TYPE_PP( entry ) != IS_OBJECT || ! Z_OBJCE_PP( entry ) != DFBColor_ce) { ! entries = NULL; ! break; } } + } ! if (!entries) { ! MAKE_STD_ZVAL( entries ); ! array_init( entries ); ! } else ! ZVAL_ADDREF( entries ); ! add_property_long( this, "flags", dsc.flags ); ! add_property_long( this, "caps", dsc.caps ); ! add_property_long( this, "size", dsc.size ); ! add_property_zval( this, "entries", entries ); ! ! return true; } *************** *** 857,862 **** if (ret->flags & DPDESC_ENTRIES) { DFBColor *entries = NULL; ! zval *array; ! zval **entry; int i = 0; --- 939,944 ---- if (ret->flags & DPDESC_ENTRIES) { DFBColor *entries = NULL; ! zval *array = NULL; ! zval **entry = NULL; int i = 0; *************** *** 876,882 **** if (!ret->size || ret->size > i) ret->size = i; ! } else ! ret->flags &= ~DPDESC_ENTRIES; ! } } --- 958,966 ---- if (!ret->size || ret->size > i) ret->size = i; ! } else { ! php_error( E_WARNING, ! "wrong or unset DFBPaletteDescription::$entries" ); ! ret->flags &= ~DPDESC_ENTRIES; ! } } } *************** *** 887,891 **** /************************** DFBWindowDescription *****************************/ ! static void DFBWindowDescription_ctor( int ht, zval *this ) { --- 971,975 ---- /************************** DFBWindowDescription *****************************/ ! static bool DFBWindowDescription_ctor( int ht, zval *this ) { *************** *** 894,899 **** if (zend_parse_parameters( ht, "llllllll", &dsc.flags, &dsc.caps, &dsc.width, &dsc.height, &dsc.pixelformat, ! &dsc.posx, &dsc.posy, &dsc.surface_caps ) == SUCCESS) ! DFBWindowDescription_init( &dsc, this ); } --- 978,986 ---- if (zend_parse_parameters( ht, "llllllll", &dsc.flags, &dsc.caps, &dsc.width, &dsc.height, &dsc.pixelformat, ! &dsc.posx, &dsc.posy, &dsc.surface_caps ) != SUCCESS) ! return false; ! ! DFBWindowDescription_init( &dsc, this ); ! return true; } *************** *** 945,949 **** /********************** DFBFontDescription ***********************************/ ! static void DFBFontDescription_ctor( int ht, zval *this ) { --- 1032,1036 ---- /********************** DFBFontDescription ***********************************/ ! static bool DFBFontDescription_ctor( int ht, zval *this ) { *************** *** 952,957 **** if (zend_parse_parameters( ht, "llllll", &dsc.flags, &dsc.attributes, &dsc.height, &dsc.width, ! &dsc.index, &dsc.fixed_advance ) == SUCCESS) ! DFBFontDescription_init( &dsc, this ); } --- 1039,1047 ---- if (zend_parse_parameters( ht, "llllll", &dsc.flags, &dsc.attributes, &dsc.height, &dsc.width, ! &dsc.index, &dsc.fixed_advance ) != SUCCESS) ! return false; ! ! DFBFontDescription_init( &dsc, this ); ! return true; } *************** *** 1013,1017 **** /**************************** DFBInputEvent **********************************/ ! static void DFBInputEvent_ctor( int ht, zval *this ) { --- 1103,1107 ---- /**************************** DFBInputEvent **********************************/ ! static bool DFBInputEvent_ctor( int ht, zval *this ) { *************** *** 1022,1027 **** &evt.key_id, &evt.key_symbol, &evt.modifiers, &evt.locks, &evt.button, &evt.buttons, &evt.axis, ! &evt.axisabs, &evt.axisrel ) == SUCCESS) ! DFBInputEvent_init( &evt, this ); } --- 1112,1120 ---- &evt.key_id, &evt.key_symbol, &evt.modifiers, &evt.locks, &evt.button, &evt.buttons, &evt.axis, ! &evt.axisabs, &evt.axisrel ) != SUCCESS) ! return false; ! ! DFBInputEvent_init( &evt, this ); ! return true; } *************** *** 1089,1093 **** /******************************** DFBWindowEvent *****************************/ ! static void DFBWindowEvent_ctor( int ht, zval *this ) { --- 1182,1186 ---- /******************************** DFBWindowEvent *****************************/ ! static bool DFBWindowEvent_ctor( int ht, zval *this ) { *************** *** 1099,1104 **** &evt.h, &evt.key_code, &evt.key_id, &evt.key_symbol, &evt.modifiers, &evt.locks, ! &evt.button, &evt.buttons ) == SUCCESS) ! DFBWindowEvent_init( &evt, this ); } --- 1192,1200 ---- &evt.h, &evt.key_code, &evt.key_id, &evt.key_symbol, &evt.modifiers, &evt.locks, ! &evt.button, &evt.buttons ) != SUCCESS) ! return false; ! ! DFBWindowEvent_init( &evt, this ); ! return true; } Index: isurface.c =================================================================== RCS file: /cvsroot/php-directfb/PHP-DirectFB/src/isurface.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** isurface.c 13 Nov 2004 10:57:13 -0000 1.3 --- isurface.c 15 Nov 2004 15:06:18 -0000 1.4 *************** *** 39,43 **** DFBSurfaceCapabilities caps = 0; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetCapabilities( surface, &caps ); --- 39,43 ---- DFBSurfaceCapabilities caps = 0; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetCapabilities( surface, &caps ); *************** *** 53,57 **** int h = 0; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetSize( surface, &w, &h ); --- 53,57 ---- int h = 0; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetSize( surface, &w, &h ); *************** *** 68,72 **** DFBRectangle rect = {0, 0, 0, 0}; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetVisibleRectangle( surface, &rect ); --- 68,72 ---- DFBRectangle rect = {0, 0, 0, 0}; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetVisibleRectangle( surface, &rect ); *************** *** 83,87 **** DFBSurfacePixelFormat format = 0; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetPixelFormat( surface, &format ); --- 83,87 ---- DFBSurfacePixelFormat format = 0; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetPixelFormat( surface, &format ); *************** *** 98,102 **** zval *obj = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "|O!", --- 98,102 ---- zval *obj = NULL; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "|O!", *************** *** 105,109 **** if (obj) ! DIRECTFB_INTERFACE_GET_PRIVATE( obj, IDirectFBSurface, source ); dfb_errno = surface->GetAccelerationMask( surface, source, &mask ); --- 105,109 ---- if (obj) ! DIRECTFB_GET_INTERFACE( obj, IDirectFBSurface, source ); dfb_errno = surface->GetAccelerationMask( surface, source, &mask ); *************** *** 118,122 **** IDirectFBPalette *palette = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetPalette( surface, &palette ); --- 118,122 ---- IDirectFBPalette *palette = NULL; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetPalette( surface, &palette ); *************** *** 124,128 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBPalette, palette ); } --- 124,128 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBPalette, palette, NULL ); } *************** *** 134,138 **** zval *pal; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 134,138 ---- zval *pal; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 140,144 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( pal, IDirectFBPalette, palette ); dfb_errno = surface->SetPalette( surface, palette ); --- 140,144 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( pal, IDirectFBPalette, palette ); dfb_errno = surface->SetPalette( surface, palette ); *************** *** 155,159 **** zval *r = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); switch (ZEND_NUM_ARGS()) { --- 155,159 ---- zval *r = NULL; ! DIRECTFB_GET_THIS( surface ); switch (ZEND_NUM_ARGS()) { *************** *** 189,193 **** int field; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 189,193 ---- int field; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 204,208 **** int r, g, b, a; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 204,208 ---- int r, g, b, a; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 220,224 **** zval *r = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 220,224 ---- zval *r = NULL; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 241,245 **** int r, g, b, a; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 241,245 ---- int r, g, b, a; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 256,260 **** int index; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 256,260 ---- int index; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 271,275 **** DFBSurfaceBlendFunction func; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 271,275 ---- DFBSurfaceBlendFunction func; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 286,290 **** DFBSurfaceBlendFunction func; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 286,290 ---- DFBSurfaceBlendFunction func; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 301,305 **** DFBSurfacePorterDuffRule rule; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 301,305 ---- DFBSurfacePorterDuffRule rule; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 316,320 **** int r, g, b; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 316,320 ---- int r, g, b; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 331,335 **** int index; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 331,335 ---- int index; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 346,350 **** int r, g, b; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 346,350 ---- int r, g, b; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 361,365 **** int index; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 361,365 ---- int index; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 376,380 **** DFBSurfaceBlittingFlags flags; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 376,380 ---- DFBSurfaceBlittingFlags flags; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 396,400 **** zval *rect = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); switch (ZEND_NUM_ARGS()) { --- 396,400 ---- zval *rect = NULL; ! DIRECTFB_GET_THIS( surface ); switch (ZEND_NUM_ARGS()) { *************** *** 423,427 **** } ! DIRECTFB_INTERFACE_GET_PRIVATE( src, IDirectFBSurface, source ); if (rect) { --- 423,427 ---- } ! DIRECTFB_GET_INTERFACE( src, IDirectFBSurface, source ); if (rect) { *************** *** 443,447 **** zval *rect = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); switch (ZEND_NUM_ARGS()) { --- 443,447 ---- zval *rect = NULL; ! DIRECTFB_GET_THIS( surface ); switch (ZEND_NUM_ARGS()) { *************** *** 470,474 **** } ! DIRECTFB_INTERFACE_GET_PRIVATE( src, IDirectFBSurface, source ); if (rect) { --- 470,474 ---- } ! DIRECTFB_GET_INTERFACE( src, IDirectFBSurface, source ); if (rect) { *************** *** 490,494 **** zval *dr = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); surface->GetSize( surface, &dst_rect.w, &dst_rect.h ); --- 490,494 ---- zval *dr = NULL; ! DIRECTFB_GET_THIS( surface ); surface->GetSize( surface, &dst_rect.w, &dst_rect.h ); *************** *** 499,503 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( src, IDirectFBSurface, source ); source->GetSize( source, &src_rect.w, &src_rect.h ); if (sr) --- 499,503 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( src, IDirectFBSurface, source ); source->GetSize( source, &src_rect.w, &src_rect.h ); if (sr) *************** *** 522,526 **** zval *in = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); switch (ZEND_NUM_ARGS()) { --- 522,526 ---- zval *in = NULL; ! DIRECTFB_GET_THIS( surface ); switch (ZEND_NUM_ARGS()) { *************** *** 548,552 **** } ! DIRECTFB_INTERFACE_GET_PRIVATE( src, IDirectFBSurface, source ); if (num) { --- 548,552 ---- } ! DIRECTFB_GET_INTERFACE( src, IDirectFBSurface, source ); if (num) { *************** *** 619,623 **** DFBSurfaceDrawingFlags flags; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 619,623 ---- DFBSurfaceDrawingFlags flags; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 634,638 **** int x, y, w, h; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 634,638 ---- int x, y, w, h; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 649,653 **** int x, y, w, h; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 649,653 ---- int x, y, w, h; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 667,671 **** zval *sp; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 667,671 ---- zval *sp; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 718,722 **** int x1, y1, x2, y2; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 718,722 ---- int x1, y1, x2, y2; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 735,739 **** zval *li; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 735,739 ---- zval *li; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 788,792 **** int x3, y3; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "llllll", --- 788,792 ---- int x3, y3; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "llllll", *************** *** 804,808 **** zval *obj; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 804,808 ---- zval *obj; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 810,814 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( obj, IDirectFBFont, font ); dfb_errno = surface->SetFont( surface, font ); --- 810,814 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( obj, IDirectFBFont, font ); dfb_errno = surface->SetFont( surface, font ); *************** *** 821,825 **** IDirectFBFont *font = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); dfb_errno = surface->GetFont( surface, &font ); --- 821,825 ---- IDirectFBFont *font = NULL; ! DIRECTFB_GET_THIS( surface ); dfb_errno = surface->GetFont( surface, &font ); *************** *** 827,831 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBFont, font ); } --- 827,831 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBFont, font, NULL ); } *************** *** 841,845 **** int len; ! DIRECTFB_THIS_GET_PRIVATE( surface ); switch (ZEND_NUM_ARGS()) { --- 841,845 ---- int len; ! DIRECTFB_GET_THIS( surface ); switch (ZEND_NUM_ARGS()) { *************** *** 870,874 **** DFBSurfaceTextFlags flags; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "llll", --- 870,874 ---- DFBSurfaceTextFlags flags; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "llll", *************** *** 887,891 **** zval *r = NULL; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "|O!", --- 887,891 ---- zval *r = NULL; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "|O!", *************** *** 902,906 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBSurface, sub_surface ); } --- 902,906 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBSurface, sub_surface, NULL ); } *************** *** 913,917 **** int len; ! DIRECTFB_THIS_GET_PRIVATE( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", --- 913,917 ---- int len; ! DIRECTFB_GET_THIS( surface ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", *************** *** 927,930 **** --- 927,945 ---- } + INTERFACE_DESTRUCTOR() + { + IDirectFBSurface *surface = (IDirectFBSurface*) wrp->interface; + + if (directfb_refs) { + PD_DEBUG( "releasing interface IDirectFBSurface (%p).\n", surface ); + dfb_errno = surface->Release( surface ); + wrp->interface = NULL; + } + + /* preallocated */ + if (wrp->pdata) + efree( wrp->pdata ); + } + /****************************** Interface Data ********************************/ Index: idisplaylayer.c =================================================================== RCS file: /cvsroot/php-directfb/PHP-DirectFB/src/idisplaylayer.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** idisplaylayer.c 10 Nov 2004 12:14:30 -0000 1.1.1.1 --- idisplaylayer.c 15 Nov 2004 15:06:18 -0000 1.2 *************** *** 39,43 **** DFBDisplayLayerID id = 0; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetID( layer, &id ); --- 39,43 ---- DFBDisplayLayerID id = 0; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetID( layer, &id ); *************** *** 52,56 **** DFBDisplayLayerDescription dsc; ! DIRECTFB_THIS_GET_PRIVATE( layer ); memset( &dsc, 0, sizeof(DFBDisplayLayerDescription) ); --- 52,56 ---- DFBDisplayLayerDescription dsc; ! DIRECTFB_GET_THIS( layer ); memset( &dsc, 0, sizeof(DFBDisplayLayerDescription) ); *************** *** 81,85 **** IDirectFBSurface *surface = NULL; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetSurface( layer, &surface ); --- 81,85 ---- IDirectFBSurface *surface = NULL; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetSurface( layer, &surface ); *************** *** 87,91 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBSurface, surface ); } --- 87,91 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBSurface, surface, NULL ); } *************** *** 96,100 **** IDirectFBScreen *screen = NULL; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetScreen( layer, &screen ); --- 96,100 ---- IDirectFBScreen *screen = NULL; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetScreen( layer, &screen ); *************** *** 102,106 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBScreen, screen ); } --- 102,106 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBScreen, screen, NULL ); } *************** *** 111,115 **** DFBDisplayLayerCooperativeLevel level; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 111,115 ---- DFBDisplayLayerCooperativeLevel level; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 128,132 **** int a; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &a ) != SUCCESS) --- 128,132 ---- int a; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &a ) != SUCCESS) *************** *** 145,149 **** int w, h; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 145,149 ---- int w, h; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 163,167 **** double w, h; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 163,167 ---- double w, h; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 180,184 **** int r, g, b; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 180,184 ---- int r, g, b; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 195,199 **** int r, g, b; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 195,199 ---- int r, g, b; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 212,216 **** int level = 0; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetLevel( layer, &level ); --- 212,216 ---- int level = 0; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetLevel( layer, &level ); *************** *** 225,229 **** int level; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 225,229 ---- int level; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 242,246 **** int field = 0; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetCurrentOutputField( layer, &field ); --- 242,246 ---- int field = 0; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetCurrentOutputField( layer, &field ); *************** *** 255,259 **** int field; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 255,259 ---- int field; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 272,276 **** DFBDisplayLayerConfig config = { .flags = 0 }; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetConfiguration( layer, &config ); --- 272,276 ---- DFBDisplayLayerConfig config = { .flags = 0 }; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetConfiguration( layer, &config ); *************** *** 287,291 **** zval *cfg; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 287,291 ---- zval *cfg; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 307,311 **** zval *cfg; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 307,311 ---- zval *cfg; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 326,330 **** DFBDisplayLayerBackgroundMode mode; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 326,330 ---- DFBDisplayLayerBackgroundMode mode; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 344,348 **** zval *image; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 344,348 ---- zval *image; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 350,354 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( image, IDirectFBSurface, surface ); dfb_errno = layer->SetBackgroundImage( layer, surface ); --- 350,354 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( image, IDirectFBSurface, surface ); dfb_errno = layer->SetBackgroundImage( layer, surface ); *************** *** 363,367 **** int a, r, g, b; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 363,367 ---- int a, r, g, b; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 380,384 **** DFBColorAdjustment adj = {0, 0, 0, 0, 0}; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetColorAdjustment( layer, &adj ); --- 380,384 ---- DFBColorAdjustment adj = {0, 0, 0, 0, 0}; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetColorAdjustment( layer, &adj ); *************** *** 394,398 **** zval *adj; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 394,398 ---- zval *adj; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 413,417 **** zval *dsc; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 413,417 ---- zval *dsc; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 425,429 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBWindow, window ); } --- 425,429 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBWindow, window, NULL ); } *************** *** 435,439 **** IDirectFBWindow *window = NULL; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &id ) != SUCCESS) --- 435,439 ---- IDirectFBWindow *window = NULL; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &id ) != SUCCESS) *************** *** 444,448 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBWindow, window ); } --- 444,448 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBWindow, window, NULL ); } *************** *** 453,457 **** int enable; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 453,457 ---- int enable; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 469,473 **** int y = 0; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->GetCursorPosition( layer, &x, &y ); --- 469,473 ---- int y = 0; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->GetCursorPosition( layer, &x, &y ); *************** *** 484,488 **** int x, y; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 484,488 ---- int x, y; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 499,503 **** int n, d, t; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 499,503 ---- int n, d, t; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 517,521 **** int hot_y = 0; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &shape, --- 517,521 ---- int hot_y = 0; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &shape, *************** *** 523,527 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( shape, IDirectFBSurface, surface ); dfb_errno = layer->SetCursorShape( layer, surface, hot_x, hot_y ); --- 523,527 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( shape, IDirectFBSurface, surface ); dfb_errno = layer->SetCursorShape( layer, surface, hot_x, hot_y ); *************** *** 534,538 **** int a; ! DIRECTFB_THIS_GET_PRIVATE( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &a ) != SUCCESS) --- 534,538 ---- int a; ! DIRECTFB_GET_THIS( layer ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l", &a ) != SUCCESS) *************** *** 547,555 **** IDirectFBDisplayLayer *layer; ! DIRECTFB_THIS_GET_PRIVATE( layer ); dfb_errno = layer->WaitForSync( layer ); } /****************************** Interface Data ********************************/ --- 547,557 ---- IDirectFBDisplayLayer *layer; ! DIRECTFB_GET_THIS( layer ); dfb_errno = layer->WaitForSync( layer ); } + STANDARD_INTERFACE_DESTRUCTOR() + /****************************** Interface Data ********************************/ Index: iinputdevice.c =================================================================== RCS file: /cvsroot/php-directfb/PHP-DirectFB/src/iinputdevice.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** iinputdevice.c 10 Nov 2004 12:14:30 -0000 1.1.1.1 --- iinputdevice.c 15 Nov 2004 15:06:18 -0000 1.2 *************** *** 39,43 **** DFBInputDeviceID id = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->GetID( device, &id ); --- 39,43 ---- DFBInputDeviceID id = 0; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->GetID( device, &id ); *************** *** 52,56 **** DFBInputDeviceDescription dsc; ! DIRECTFB_THIS_GET_PRIVATE( device ); memset( &dsc, 0, sizeof(DFBInputDeviceDescription) ); --- 52,56 ---- DFBInputDeviceDescription dsc; ! DIRECTFB_GET_THIS( device ); memset( &dsc, 0, sizeof(DFBInputDeviceDescription) ); *************** *** 93,97 **** int i; ! DIRECTFB_THIS_GET_PRIVATE( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 93,97 ---- int i; ! DIRECTFB_GET_THIS( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 122,126 **** IDirectFBEventBuffer *buffer = NULL; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->CreateEventBuffer( device, &buffer ); --- 122,126 ---- IDirectFBEventBuffer *buffer = NULL; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->CreateEventBuffer( device, &buffer ); *************** *** 128,132 **** RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBEventBuffer, buffer ); } --- 128,132 ---- RETURN_NULL(); ! DIRECTFB_RETURN_INTERFACE( IDirectFBEventBuffer, buffer, NULL ); } *************** *** 138,142 **** zval *buf; ! DIRECTFB_THIS_GET_PRIVATE( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", --- 138,142 ---- zval *buf; ! DIRECTFB_GET_THIS( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "O", *************** *** 144,148 **** INVARG(); ! DIRECTFB_INTERFACE_GET_PRIVATE( buf, IDirectFBEventBuffer, buffer ); dfb_errno = device->AttachEventBuffer( device, buffer ); --- 144,148 ---- INVARG(); ! DIRECTFB_GET_INTERFACE( buf, IDirectFBEventBuffer, buffer ); dfb_errno = device->AttachEventBuffer( device, buffer ); *************** *** 158,162 **** DFBInputDeviceKeyState state = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 158,162 ---- DFBInputDeviceKeyState state = 0; ! DIRECTFB_GET_THIS( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 175,179 **** DFBInputDeviceModifierMask mask = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->GetModifiers( device, &mask ); --- 175,179 ---- DFBInputDeviceModifierMask mask = 0; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->GetModifiers( device, &mask ); *************** *** 188,192 **** DFBInputDeviceLockState lock = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->GetLockState( device, &lock ); --- 188,192 ---- DFBInputDeviceLockState lock = 0; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->GetLockState( device, &lock ); *************** *** 201,205 **** DFBInputDeviceButtonMask buttons = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->GetButtons( device, &buttons ); --- 201,205 ---- DFBInputDeviceButtonMask buttons = 0; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->GetButtons( device, &buttons ); *************** *** 215,219 **** DFBInputDeviceButtonState state = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 215,219 ---- DFBInputDeviceButtonState state = 0; ! DIRECTFB_GET_THIS( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 233,237 **** int pos = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, --- 233,237 ---- int pos = 0; ! DIRECTFB_GET_THIS( device ); if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, *************** *** 251,255 **** int y = 0; ! DIRECTFB_THIS_GET_PRIVATE( device ); dfb_errno = device->GetXY( device, &x, &y ); --- 251,255 ---- int y = 0; ! DIRECTFB_GET_THIS( device ); dfb_errno = device->GetXY( device, &x, &y ); *************** *** 260,263 **** --- 260,265 ---- } + STANDARD_INTERFACE_DESTRUCTOR() + /****************************** Interface Data ********************************/ Index: iimageprovider.c =================================================================== RCS file: /cvsroot/php-directfb/PHP-DirectFB/src/iimageprovider.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** iimageprovider.c 10 Nov 2004 12:14:25 -0000 1.1.1.1 --- iimageprovider.c 15 Nov 2004 15:06:18 -0000 1.2 *************** *** 39,43 **** DFBSurfaceDescription dsc = { .flags = 0 }; ! ... [truncated message content] |