javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/graphics/Internal_GfxPackageSupport.java
author hgs
Thu, 05 Aug 2010 16:07:57 +0300
changeset 57 59b3b4473dc8
parent 56 abc41079b313
child 72 1f0034e370aa
permissions -rw-r--r--
v2.2.9_1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*******************************************************************************
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved. This program and the accompanying materials 
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * are made available under the terms of the Eclipse Public License v1.0
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * which accompanies this distribution, and is available at
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * http://www.eclipse.org/legal/epl-v10.html
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * 
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 * Contributors:
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 *     Nokia Corporation - initial implementation 
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 *******************************************************************************/
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
package org.eclipse.swt.graphics;
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
56
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    14
import java.io.InputStream;
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    15
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
/**
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
 * <p>
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
 * <b>IMPORTANT:</b> This class is <em>not</em> part of the SWT public API. It
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
 * must never be accessed from application code.
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
 * </p>
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
 */
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
public final class Internal_GfxPackageSupport {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
/*
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
 * From the class Image
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
 */
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
public static int getNullIconHandle() {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
    return Image.getNullIconHandle();
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    29
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    30
public static Image new_Image(Device device, 
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    31
        org.eclipse.swt.internal.qt.graphics.Image cgImage) {
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    32
    return Image.qt_new(device, cgImage);
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    34
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
public static int getIconHandle(Image i) {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
    return i.getIconHandle();
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    38
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
public static org.eclipse.swt.internal.qt.graphics.Image getImage(Image i) {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    return i.getImage();
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    42
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
public static int getImageHandle(Image i) {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    return i.getImageHandle();
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    46
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
public static int getPixmapHandle(Image i) {
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    return i.getPixmapHandle();
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
}
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
26
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 21
diff changeset
    51
public static Image createImageWithoutSecurityCheck(Device device,
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 21
diff changeset
    52
        String filename) {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 21
diff changeset
    53
    return Image.createImageWithoutSecurityCheck(device, filename);
21
2a9601315dfc Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
}
56
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    55
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    56
public static Point getImageSize(Device device, String filename) {
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    57
    return Image.getImageSize(device, filename);
26
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 21
diff changeset
    58
}
56
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    59
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    60
public static Point getImageSize(InputStream stream) {
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    61
    return Image.getImageSize(stream);
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    62
}
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    63
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    64
/*
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    65
 * From the class Device
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    66
 */
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    67
public static boolean internal(Device d) {
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    68
	return d.internal;
56
abc41079b313 v2.2.7_1
hgs
parents: 35
diff changeset
    69
}
57
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    70
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    71
public static boolean initialized() {
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    72
	return Device.initialized;
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    73
}
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    74
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    75
public static Color newColor(Device device, int handle) {
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    76
    return Color.qt_new(device, handle);
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    77
}
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    78
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    79
public static Font newFont(Device device, int handle) {
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    80
    return Font.qt_new(device, handle);
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    81
}
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    82
59b3b4473dc8 v2.2.9_1
hgs
parents: 56
diff changeset
    83
}