javauis/lcdui_qt/src/javax/microedition/lcdui/ImageBuffer.java
changeset 26 dc7c549001d5
child 35 85266cc22c7f
equal deleted inserted replaced
23:98ccebc37403 26:dc7c549001d5
       
     1 /*
       
     2 * Copyright (c) 2009,2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 package javax.microedition.lcdui;
       
    18 
       
    19 import org.eclipse.swt.graphics.Internal_GfxPackageSupport;
       
    20 import org.eclipse.swt.internal.qt.graphics.GraphicsContext;
       
    21 
       
    22 final class ImageBuffer extends Buffer
       
    23 {
       
    24 
       
    25     private Image host;
       
    26 
       
    27     ImageBuffer(Image image)
       
    28     {
       
    29         host = image;
       
    30     }
       
    31 
       
    32     int getHostType()
       
    33     {
       
    34         return HOST_TYPE_IMAGE;
       
    35     }
       
    36 
       
    37     void setupWindowSurface()
       
    38     {
       
    39         // nothing to do here
       
    40     }
       
    41 
       
    42     Object getHost()
       
    43     {
       
    44         return host;
       
    45     }
       
    46 
       
    47     void bindToHost(GraphicsContext gc)
       
    48     {
       
    49         gc.bindTarget(Internal_GfxPackageSupport.getImage(Image.getESWTImage(host)));
       
    50     }
       
    51 
       
    52 }