javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/Image.java
changeset 80 d6dafc5d983f
parent 72 1f0034e370aa
equal deleted inserted replaced
78:71ad690e91f5 80:d6dafc5d983f
   699         // QIcon instances are deleted on Image
   699         // QIcon instances are deleted on Image
   700         if( icon != SWT.NULL ){
   700         if( icon != SWT.NULL ){
   701         	OS.QIcon_delete(icon);
   701         	OS.QIcon_delete(icon);
   702         }
   702         }
   703 
   703 
   704         icon = OS.QIcon_new(cgImage.getNativePixmapHandle());
   704         icon = OS.QIcon_swt_new(cgImage.getHandle());
   705         return icon;
   705         return icon;
   706     }
   706     }
   707 
   707 
   708     /*
   708     /*
   709      * Returns OS specific image instance.
   709      * Returns OS specific image instance.
   721     int getImageHandle() {
   721     int getImageHandle() {
   722         if(isDisposed()) {
   722         if(isDisposed()) {
   723             SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
   723             SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
   724         }
   724         }
   725         return cgImage.getHandle();
   725         return cgImage.getHandle();
   726     }
       
   727 
       
   728     /*
       
   729      * Returns OS specific pixmap handle.
       
   730      */
       
   731     int getPixmapHandle() {
       
   732         if(isDisposed())
       
   733             SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
       
   734         return cgImage.getNativePixmapHandle();
       
   735     }
   726     }
   736 
   727 
   737     /**
   728     /**
   738      * Invokes platform specific functionality to allocate a new GC handle.
   729      * Invokes platform specific functionality to allocate a new GC handle.
   739      * <p>
   730      * <p>
   756     public int internal_new_GC(GCData data) {
   747     public int internal_new_GC(GCData data) {
   757         checkValidity();
   748         checkValidity();
   758         if(data == null) {
   749         if(data == null) {
   759             SWT.error(SWT.ERROR_NULL_ARGUMENT);
   750             SWT.error(SWT.ERROR_NULL_ARGUMENT);
   760         }
   751         }
   761         int paintDevice = OS.QPixmap_swt_paintDevice(cgImage.getNativePixmapHandle());
   752         int paintDevice = cgImage.getQPainDeviceHandle();
   762         if(OS.QPaintDevice_paintingActive(paintDevice)) {
   753         if(OS.QPaintDevice_paintingActive(paintDevice)) {
   763             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
   754             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
   764         }
   755         }
   765 
   756 
   766         int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
   757         int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;