javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/extension/ImageUtil.java
branchRCL_3
changeset 60 6c158198356e
child 83 26b2b12093af
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials 
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  * 
       
     8  * Contributors:
       
     9  *     Nokia Corporation - initial implementation 
       
    10  *******************************************************************************/
       
    11 
       
    12 package org.eclipse.swt.internal.extension;
       
    13 
       
    14 import java.io.InputStream;
       
    15 
       
    16 import org.eclipse.swt.graphics.Device;
       
    17 import org.eclipse.swt.graphics.Image;
       
    18 import org.eclipse.swt.graphics.Point;
       
    19 import org.eclipse.swt.internal.symbian.OS;
       
    20 
       
    21 public final class ImageUtil {
       
    22     
       
    23     public static final int THEME_IMAGE_SECURITY_TRUSTED = 0;
       
    24     public static final int THEME_IMAGE_SECURITY_UNTRUSTED = 1;
       
    25 
       
    26     public static Image createImageWithoutSecurityCheck(Device device,
       
    27             String filename) {
       
    28         return new Image(device, filename);
       
    29     }
       
    30 
       
    31     public static Image createImageFromTheme(Device device, int id) {
       
    32         return Image.internal_new(device, OS.Image_NewFromTheme(device.handle, id));
       
    33     }
       
    34     
       
    35     public static Image scaleImage(Device device, Image srcImage,
       
    36             Point destSize, boolean keepAspectRatio) {
       
    37         return Image.internal_new(device, OS.Image_Scale(device.handle,
       
    38                 srcImage.handle, destSize.x, destSize.y, keepAspectRatio));
       
    39     }
       
    40 
       
    41     public static Point getImageSize(Device device, String filename) {
       
    42         // Stub implementation for compatibility with Qt-based eSWT.
       
    43         return null;
       
    44     }
       
    45     
       
    46     public static Point getImageSize(InputStream stream) {
       
    47         // Stub implementation for compatibility with Qt-based eSWT.
       
    48         return null;
       
    49     }
       
    50 }