/** * Constructs a new empty region. * <p> * You must dispose the region when it is no longer required. * </p> * * @param device the device on which to allocate the region * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> * </ul> * * @see #dispose() * * @since 3.0 */ public Region (Device device) { super(device); handle = OS.CreateRectRgn (0, 0, 0, 0); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); init(); }
/** * Constructs a new empty region. * <p> * You must dispose the region when it is no longer required. * </p> * * @param device the device on which to allocate the region * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> * </ul> * * @see #dispose() * * @since 3.0 */ public Region(Device device) { super(device); handle = OS.gdk_region_new(); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); init(); }
/** * Constructs a new empty region. * <p> * You must dispose the region when it is no longer required. * </p> * * @param device the device on which to allocate the region * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> * </ul> * * @see #dispose() * * @since 3.0 */ public Region(Device device) { super(device); handle = OS.gdk_region_new(); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); init(); }
/** * Constructs a new empty region. * <p> * You must dispose the region when it is no longer required. * </p> * * @param device the device on which to allocate the region * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> * </ul> * * @see #dispose() * * @since 3.0 */ public Region(Device device) { super(device); handle = OS.gdk_region_new(); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); init(); }
handle = OS.NewRgn(); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); init(); } finally { if (pool != null) pool.release();