Show
Ignore:
Timestamp:
05/17/08 11:34:28 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.4M7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/graphics/Transform.d

    r212 r213  
    4040 */ 
    4141public class Transform : Resource { 
    42  
     42    alias Resource.init_ init_; 
    4343    /** 
    4444     * the OS resource for the Transform 
     
    138138 */ 
    139139public this (Device device, float m11, float m12, float m21, float m22, float dx, float dy) { 
    140     if (device is null) device = Device.getDevice(); 
    141     if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    142     this.device = device; 
    143     device.checkGDIP(); 
     140    super(device); 
     141    this.device.checkGDIP(); 
    144142    handle = Gdip.Matrix_new(m11, m12, m21, m22, dx, dy); 
    145143    if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); 
    146     if (device.tracking) device.new_Object(this); 
     144    init_(); 
    147145} 
    148146 
     
    153151} 
    154152 
    155 /** 
    156  * Disposes of the operating system resources associated with 
    157  * the Transform. Applications must dispose of all Transforms that 
    158  * they allocate. 
    159  */ 
    160 override public void dispose() { 
    161     if (handle is null) return; 
    162     if (device.isDisposed()) return; 
     153void destroy() { 
    163154    Gdip.Matrix_delete(handle); 
    164155    handle = null; 
    165     if (device.tracking) device.dispose_Object(this); 
    166     device = null; 
    167156} 
    168157 
     
    185174    if (elements is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    186175    if (elements.length < 6) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    187     Gdip.Matrix_GetElements(handle, elements); 
     176    Gdip.Matrix_GetElements(handle, elements.ptr); 
    188177} 
    189178 
    190179/** 
    191180 * Modifies the receiver such that the matrix it represents becomes the 
     181 * identity matrix. 
     182 * 
     183 * @exception DWTException <ul> 
     184 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> 
     185 * </ul> 
     186 * 
     187 * @since 3.4 
     188 */ 
     189public void identity() { 
     190    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
     191    Gdip.Matrix_SetElements(handle, 1, 0, 0, 1, 0, 0); 
     192} 
     193 
     194/** 
     195 * Modifies the receiver such that the matrix it represents becomes 
    192196 * the mathematical inverse of the matrix it previously represented. 
    193197 * 
     
    304308 
    305309/** 
     310 * Modifies the receiver so that it represents a transformation that is 
     311 * equivalent to its previous transformation sheared by (shearX, shearY). 
     312 * 
     313 * @param shearX the shear factor in the X direction 
     314 * @param shearY the shear factor in the Y direction 
     315 * 
     316 * @exception DWTException <ul> 
     317 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> 
     318 * </ul> 
     319 * 
     320 * @since 3.4 
     321 */ 
     322public void shear(float shearX, float shearY) { 
     323    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
     324    Gdip.Matrix_Shear(handle, shearX, shearY, Gdip.MatrixOrderPrepend); 
     325} 
     326 
     327/** 
    306328 * Given an array containing points described by alternating x and y values, 
    307329 * modify that array such that each point has been replaced with the result of 
     
    320342    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    321343    if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    322     Gdip.Matrix_TransformPoints(handle, cast(Gdip.PointF[])pointArray, pointArray.length / 2); 
     344    Gdip.Matrix_TransformPoints(handle, cast(Gdip.PointF*)pointArray.ptr, pointArray.length / 2); 
    323345} 
    324346