Mercurial > projects > dwt-win
changeset 11:211c11b9bd6c
Drawable, GCData as proto
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 25 Jan 2008 14:15:24 +0100 |
parents | a04f5735069f |
children | 06825fa0ae76 |
files | dwt/graphics/Drawable.d dwt/graphics/GCData.d |
diffstat | 2 files changed, 134 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/graphics/Drawable.d Fri Jan 25 14:15:24 2008 +0100 @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module dwt.graphics.Drawable; + + +import dwt.graphics.GCData; + +/** + * Implementers of <code>Drawable</code> can have a graphics context (GC) + * created for them, and then they can be drawn on by sending messages to + * their associated GC. DWT images, and device objects such as the Display + * device and the Printer device, are drawables. + * <p> + * <b>IMPORTANT:</b> This class is <em>not</em> part of the DWT + * public API. It is marked public only so that it can be shared + * within the packages provided by DWT. It should never be + * referenced from application code. + * </p> + * + * @see Device + * @see Image + * @see GC + */ +public interface Drawable { + +/** + * Invokes platform specific functionality to allocate a new GC handle. + * <p> + * <b>IMPORTANT:</b> This method is <em>not</em> part of the public + * API for <code>Drawable</code>. It is marked public only so that it + * can be shared within the packages provided by DWT. It is not + * available on all platforms, and should never be called from + * application code. + * </p> + * + * @param data the platform specific GC data + * @return the platform specific GC handle + */ + +public int /*long*/ internal_new_GC (GCData data); + +/** + * Invokes platform specific functionality to dispose a GC handle. + * <p> + * <b>IMPORTANT:</b> This method is <em>not</em> part of the public + * API for <code>Drawable</code>. It is marked public only so that it + * can be shared within the packages provided by DWT. It is not + * available on all platforms, and should never be called from + * application code. + * </p> + * + * @param handle the platform specific GC handle + * @param data the platform specific GC data + */ +public void internal_dispose_GC ( int /*long*/ handle, GCData data); + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/graphics/GCData.d Fri Jan 25 14:15:24 2008 +0100 @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module dwt.graphics.GCData; + + +import dwt.DWT; +import dwt.internal.win32.WINTYPES; + +//PORTING_TYPE +class GCData { +} +/+++ +/** + * Instances of this class are descriptions of GCs in terms + * of unallocated platform-specific data fields. + * <p> + * <b>IMPORTANT:</b> This class is <em>not</em> part of the public + * API for DWT. It is marked public only so that it can be shared + * within the packages provided by DWT. It is not available on all + * platforms, and should never be called from application code. + * </p> + */ + +public final class GCData { + public Device device; + public int style, state = -1; + public int foreground = -1; + public int background = -1; + public int hFont; + public Pattern foregroundPattern; + public Pattern backgroundPattern; + public int lineStyle = DWT.LINE_SOLID; + public float lineWidth; + public int lineCap = DWT.CAP_FLAT; + public int lineJoin = DWT.JOIN_MITER; + public float lineDashesOffset; + public float[] lineDashes; + public float lineMiterLimit = 10; + public int alpha = 0xFF; + public int uiState = 0; + + public Image image; + public int hPen, hOldPen; + public int hBrush, hOldBrush; + public int hNullBitmap; + public int hwnd; + public PAINTSTRUCT ps; + public int layout = -1; + public int gdipGraphics; + public int gdipPen; + public int gdipBrush; + public int gdipFgBrush; + public int gdipBgBrush; + public int gdipFont; + public float gdipXOffset, gdipYOffset; +} ++++/