/** * Prevents uninitialized instances from being created outside the package. */ Image (Device device) { super(device); currentDeviceZoom = DPIUtil.getDeviceZoom (); }
/** * This might be called directly from native code in environments * which can generate spurious events. Check before removing it. * * @deprecated * * @param ignore true if callbacks should not be invoked */ static final void ignoreCallbacks (boolean ignore) { setEnabled (!ignore); }
static char wcsToMbcs (char ch) { int key = ch & 0xFFFF; if (key <= 0x7F) return ch; byte [] buffer = Converter.wcsToMbcs (null, new char [] {ch}, false); if (buffer.length == 1) return (char) buffer [0]; if (buffer.length == 2) { return (char) (((buffer [0] & 0xFF) << 8) | (buffer [1] & 0xFF)); } return 0; }
/** * Removes the specified language listener. * <p> * * @param hwnd the handle of the Control that is listening for keyboard language changes */ public static void removeLanguageListener (int /*long*/ hwnd) { languageMap.remove(new LONG(hwnd)); unsubclass(hwnd); } public static void removeLanguageListener (Control control) {
boolean isBidiCaret() { return BidiUtil.isBidiPlatform(); } boolean isFixedLineHeight() {
/** * Releases the native level resources associated with the callback, * and removes all references between the callback and * other objects. This helps to prevent (bad) application code * from accidentally holding onto extraneous garbage. */ public void dispose () { if (object == null) return; unbind (this); object = method = signature = null; address = 0; }
/** * Returns the NLS'ed message for the given argument. * * @param key the key to look up * @return the message for the given key * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the key is null</li> * </ul> */ public static String getMessage(String key) { return Compatibility.getMessage(key); }
int getFlags (int /*long*/ flags) { C.memmove (flags, new int[] {nsIClassInfo.DOM_OBJECT}, 4); /* PRUint32 */ return XPCOM.NS_OK; }
/** * Returns a boolean indicating whether this SWT implementation can * be loaded. Examples of criteria that may be used to determine this * include the OS and architecture of the JRE that is being used. * * @return <code>true</code> if this SWT implementation can be loaded * and <code>false</code> otherwise * * @since 3.8 */ public static boolean isLoadable () { return Platform.isLoadable (); }
public static float autoScaleUp(float size) { if (deviceZoom == 100 || size == SWT.DEFAULT) return size; float scaleFactor = getScalingFactor (); return (size * scaleFactor); }
@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
/** * Returns the average character width, measured in pixels, * of the font described by the receiver. * * @return the average character width of the font */ public int getAverageCharWidth() { return DPIUtil.autoScaleDown(handle.tmAveCharWidth); }
/** * Returns a boolean indicating whether this SWT implementation can * be loaded. Examples of criteria that may be used to determine this * include the OS and architecture of the JRE that is being used. * * @return <code>true</code> if this SWT implementation can be loaded * and <code>false</code> otherwise * * @since 3.8 */ public static boolean isLoadable () { return Platform.isLoadable (); }
Image(Device device) { super(device); currentDeviceZoom = DPIUtil.getDeviceZoom(); }
static char wcsToMbcs (char ch) { int key = ch & 0xFFFF; if (key <= 0x7F) return ch; byte [] buffer = Converter.wcsToMbcs (null, new char [] {ch}, false); if (buffer.length == 1) return (char) buffer [0]; if (buffer.length == 2) { return (char) (((buffer [0] & 0xFF) << 8) | (buffer [1] & 0xFF)); } return 0; }
/** * Auto-scale up float array dimensions. */ public static float[] autoScaleDown (float size[]) { if (deviceZoom == 100 || size == null) return size; float scaleFactor = getScalingFactor (); float scaledSize[] = new float[size.length]; for (int i = 0; i < scaledSize.length; i++) { scaledSize[i] = size[i] / scaleFactor; } return scaledSize; }
@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
void setLocationInPixels (int x, int y) { this.x = DPIUtil.autoScaleDown(x); this.y = DPIUtil.autoScaleDown(y); }
Image(Device device) { super(device); currentDeviceZoom = DPIUtil.getDeviceZoom(); }
/** * Auto-scale down float dimensions. */ public static float autoScaleDown (float size) { if (deviceZoom == 100 || size == SWT.DEFAULT) return size; float scaleFactor = getScalingFactor (); return (size / scaleFactor); }