Mercurial > projects > dwt-win
changeset 246:fd9c62a2998e
Updater SWT 3.4M7 to 3.4
line wrap: on
line diff
--- a/dwt/DWT.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/DWT.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -60,6 +60,8 @@ * <em>HINT</em> may change from release to release, although we typically * will not withdraw support for a <em>HINT</em> once it is made available. * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ /* NOTE: @@ -434,7 +436,9 @@ * @see dwt.widgets.Display#addFilter * @see dwt.widgets.Event * + * @see dwt.custom.CCombo#addVerifyListener * @see dwt.widgets.Combo#addVerifyListener + * @see dwt.custom.StyledText#addVerifyListener * @see dwt.widgets.Text#addVerifyListener * @see dwt.events.VerifyListener#verifyText * @see dwt.events.VerifyEvent
--- a/dwt/DWTError.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/DWTError.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -42,6 +42,7 @@ * * @see DWTException * @see DWT#error(int) + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DWTError : PlatformException {
--- a/dwt/DWTException.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/DWTException.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -33,6 +33,7 @@ * </p> * * @see DWTError + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DWTException : Exception {
--- a/dwt/accessibility/ACC.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/ACC.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -17,6 +17,8 @@ * Class ACC contains all the constants used in defining an * Accessible object. * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 2.0 */ public class ACC {
--- a/dwt/accessibility/Accessible.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/Accessible.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -58,6 +58,8 @@ * @see AccessibleEvent * @see AccessibleControlListener * @see AccessibleControlEvent + * @see <a href="http://www.eclipse.org/swt/snippets/#accessibility">Accessibility snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/accessibility/AccessibleAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -31,6 +31,7 @@ * * @see AccessibleListener * @see AccessibleEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/accessibility/AccessibleControlAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleControlAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,7 @@ * * @see AccessibleControlListener * @see AccessibleControlEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/accessibility/AccessibleControlEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleControlEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -31,6 +31,7 @@ * * @see AccessibleControlListener * @see AccessibleControlAdapter + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/accessibility/AccessibleEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,6 +28,7 @@ * * @see AccessibleListener * @see AccessibleAdapter + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/accessibility/AccessibleTextAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleTextAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,7 @@ * * @see AccessibleTextListener * @see AccessibleTextEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */
--- a/dwt/accessibility/AccessibleTextEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/accessibility/AccessibleTextEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -30,6 +30,7 @@ * * @see AccessibleTextListener * @see AccessibleTextAdapter + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */
--- a/dwt/custom/AnimatedProgress.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/AnimatedProgress.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -38,6 +38,8 @@ * <dl> * <dt><b>Styles:</b><dd>VERTICAL, HORIZONTAL, BORDER * </dl> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class AnimatedProgress : Canvas {
--- a/dwt/custom/BidiSegmentEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/BidiSegmentEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -60,6 +60,8 @@ * "R4R5R6". * visual line = "R3R2R1" + "R6R5R4" * </pre> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class BidiSegmentEvent : TypedEvent {
--- a/dwt/custom/Bullet.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/Bullet.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -33,18 +33,39 @@ * </p> * * @see StyledText#setLineBullet(int, int, Bullet) + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */ public class Bullet { + /** + * The bullet type. Possible values are: + * <ul> + * <li><code>ST.BULLET_DOT</code></li> + * <li><code>ST.BULLET_NUMBER</code></li> + * <li><code>ST.BULLET_LETTER_LOWER</code></li> + * <li><code>ST.BULLET_LETTER_UPPER</code></li> + * <li><code>ST.BULLET_TEXT</code></li> + * <li><code>ST.BULLET_CUSTOM</code></li> + * </ul> + */ public int type; + + /** + * The bullet style. + */ public StyleRange style; + + /** + * The bullet text. + */ public String text; + int[] linesIndices; int count; /** - * Create a new bullet the specified style, the type is set to ST.BULLET_DOT. + * Create a new bullet with the specified style, and type <code>ST.BULLET_DOT</code>. * The style must have a glyph metrics set. * * @param style the style @@ -60,6 +81,7 @@ * Create a new bullet the specified style and type. * The style must have a glyph metrics set. * + * @param type the bullet type * @param style the style * * @exception IllegalArgumentException <ul>
--- a/dwt/custom/BusyIndicator.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/BusyIndicator.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -23,6 +23,9 @@ /** * Support for showing a Busy Cursor during a long running process. + * + * @see <a href="http://www.eclipse.org/swt/snippets/#busyindicator">BusyIndicator snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class BusyIndicator {
--- a/dwt/custom/CBanner.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CBanner.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -53,6 +53,8 @@ * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.0 */
--- a/dwt/custom/CCombo.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CCombo.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -76,6 +76,10 @@ * <dt><b>Events:</b> * <dd>DefaultSelection, Modify, Selection, Verify</dd> * </dl> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#ccombo">CCombo snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class CCombo : Composite { @@ -528,7 +532,7 @@ list.deselectAll (); } void dropDown (bool drop) { - if (drop is isDropped ()) return; + if (drop is isDropped () || !isVisible()) return; if (!drop) { popup.setVisible (false); if (!isDisposed () && isFocusControl()) { @@ -1576,7 +1580,9 @@ * If so then do not continue. */ if (isDisposed ()) return; - if (!visible) popup.setVisible(false); + // TEMPORARY CODE + if (popup is null || popup.isDisposed ()) return; + if (!visible) popup.setVisible (false); } /** * Sets the number of items that are visible in the drop
--- a/dwt/custom/CLabel.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CLabel.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -65,6 +65,9 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CLabel : Canvas {
--- a/dwt/custom/CTabFolder.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CTabFolder.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -79,6 +79,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CTabFolder : Composite { @@ -2391,7 +2395,7 @@ /** * Removes the listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> @@ -2430,7 +2434,7 @@ /** * Removes the listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> @@ -3228,7 +3232,7 @@ * @param item the tab item to be selected * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> + * <li>ERROR_NULL_ARGUMENT - if the item is null</li> * </ul> * * @exception DWTException <ul>
--- a/dwt/custom/CTabFolder2Adapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CTabFolder2Adapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see CTabFolder2Listener * @see CTabFolderEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */
--- a/dwt/custom/CTabFolderAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CTabFolderAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,6 +15,14 @@ import dwt.custom.CTabFolderListener; +/** + * This adapter class provides a default implementation for the + * method described by the <code>CTabFolderListener</code> interface. + * + * @see CTabFolderListener + * @see CTabFolderEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public class CTabFolderAdapter : CTabFolderListener { public void itemClosed(CTabFolderEvent event){} }
--- a/dwt/custom/CTabFolderEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CTabFolderEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,7 +21,9 @@ import dwt.dwthelper.utils; /** + * This event is sent when an event is generated in the CTabFolder. * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CTabFolderEvent : TypedEvent { /**
--- a/dwt/custom/CTabItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/CTabItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,9 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CTabItem : Item { CTabFolder parent;
--- a/dwt/custom/ControlEditor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ControlEditor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -67,6 +67,8 @@ * editor.minimumHeight = size.y; * editor.setEditor (button); * </pre></code> +* +* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ControlEditor {
--- a/dwt/custom/DefaultContent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/DefaultContent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -733,7 +733,8 @@ * Removes the specified <code>TextChangeListener</code>. * <p> * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul>
--- a/dwt/custom/ExtendedModifyEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ExtendedModifyEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -18,6 +18,8 @@ /** * This event is sent after a text change occurs. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ExtendedModifyEvent : TypedEvent { /** start offset of the new text */ @@ -29,6 +31,12 @@ static final long serialVersionUID = 3258696507027830832L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); start = e.start;
--- a/dwt/custom/ExtendedModifyListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ExtendedModifyListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,7 +15,16 @@ import dwt.internal.DWTEventListener; import dwt.custom.ExtendedModifyEvent; +/** + * Classes which implement this interface provide a method + * that deals with the event that is generated when text + * is modified. + * + * @see ExtendedModifyEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public interface ExtendedModifyListener : DWTEventListener { + /** * This method is called after a text change occurs. * <p>
--- a/dwt/custom/LineBackgroundEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/LineBackgroundEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -20,6 +20,8 @@ /** * This event is sent when a line is about to be drawn. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class LineBackgroundEvent : TypedEvent { @@ -40,6 +42,12 @@ static final long serialVersionUID = 3978711687853324342L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); lineOffset = e.detail;
--- a/dwt/custom/LineBackgroundListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/LineBackgroundListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,6 +15,14 @@ import dwt.internal.DWTEventListener; import dwt.custom.LineBackgroundEvent; +/** + * Classes which implement this interface provide a method + * that can provide the background color for a line that + * is to be drawn. + * + * @see LineBackgroundEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public interface LineBackgroundListener : DWTEventListener { /**
--- a/dwt/custom/LineStyleEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/LineStyleEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -20,6 +20,8 @@ /** * This event is sent when a line is about to be drawn. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class LineStyleEvent : TypedEvent { @@ -86,6 +88,12 @@ static final long serialVersionUID = 3906081274027192884L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); styles = e.styles;
--- a/dwt/custom/LineStyleListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/LineStyleListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,7 +15,16 @@ import dwt.internal.DWTEventListener; import dwt.custom.LineStyleEvent; +/** + * Classes which implement this interface provide a method + * that can provide the style information for a line that + * is to be drawn. + * + * @see LineStyleEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public interface LineStyleListener : DWTEventListener { + /** * This method is called when a line is about to be drawn in order to get the * line's style information.
--- a/dwt/custom/MovementEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/MovementEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -20,6 +20,8 @@ * This event is sent when a new offset is required based on the current * offset and a movement type. * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.3 */ public class MovementEvent : TypedEvent { @@ -57,6 +59,12 @@ static final long serialVersionUID = 3978765487853324342L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); lineOffset = e.detail;
--- a/dwt/custom/PaintObjectEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/PaintObjectEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -22,6 +22,8 @@ /** * This event is sent when an object needs to be drawn. * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.2 */ public class PaintObjectEvent : TypedEvent { @@ -68,6 +70,12 @@ static final long serialVersionUID = 3906081274027192855L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); gc = e.gc;
--- a/dwt/custom/PopupList.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/PopupList.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,8 @@ * The list will be positioned so that it does not run off the screen and the largest number of items * are visible. It may appear above the current cursor location or below it depending how close you * are to the edge of the screen. +* +* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class PopupList { Shell shell;
--- a/dwt/custom/ST.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ST.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,6 +15,8 @@ /** * This class provides access to the public constants provided by <code>StyledText</code>. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ST {
--- a/dwt/custom/SashForm.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/SashForm.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,9 +41,16 @@ * <dd>HORIZONTAL, VERTICAL, SMOOTH</dd> * </dl> * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#sashform">SashForm snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class SashForm : Composite { + /** + * The width of all sashes in the form. + */ public int SASH_WIDTH = 3; int sashStyle;
--- a/dwt/custom/ScrolledComposite.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ScrolledComposite.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -112,6 +112,9 @@ * <dl> * <dt><b>Styles:</b><dd>H_SCROLL, V_SCROLL * </dl> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#scrolledcomposite">ScrolledComposite snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ScrolledComposite : Composite { @@ -312,6 +315,8 @@ * Returns <code>true</code> if the receiver automatically scrolls to a focused child control * to make it visible. Otherwise, returns <code>false</code>. * + * @return a bool indicating whether focused child controls are automatically scrolled into the viewport + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -647,7 +652,7 @@ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * - * @since 3.4 + * @since 3.4 */ public void setShowFocusedControl(bool show) { checkWidget();
--- a/dwt/custom/StackLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StackLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -70,6 +70,10 @@ * } * } * </code></pre> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#stacklayout">StackLayout snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: LayoutExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class StackLayout : Layout {
--- a/dwt/custom/StyleRange.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyleRange.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,18 @@ static import tango.text.Text; alias tango.text.Text.Text!(char) StringBuffer; +/** + * <code>StyleRange</code> defines a set of styles for a specified + * range of text. + * <p> + * The hashCode() method in this class uses the values of the public + * fields to compute the hash value. When storing instances of the + * class in hashed collections, do not modify these fields after the + * object has been inserted. + * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public class StyleRange : TextStyle, CloneableCompatibility { /** @@ -57,9 +69,9 @@ /** * Create a new style range from an existing text style. * - *@param style the text style to copy + * @param style the text style to copy * - *@since 3.4 + * @since 3.4 */ public this(TextStyle style) { super(style);
--- a/dwt/custom/StyledText.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledText.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -143,6 +143,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#styledtext">StyledText snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: CustomControlExample, TextEditor</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class StyledText : Canvas { @@ -197,8 +201,8 @@ Point doubleClickSelection; // selection after last mouse double click bool editable = true; bool wordWrap = false; - bool doubleClickEnabled = true; // see getDoubleClickEnabled - bool overwrite = false; // insert/overwrite edit mode + bool doubleClickEnabled = true; // see getDoubleClickEnabled + bool overwrite = false; // insert/overwrite edit mode int textLimit = -1; // limits the number of characters the user can type in the widget. Unlimited by default. int[int] keyActionMap; Color background = null; // workaround for bug 4791 @@ -214,7 +218,7 @@ int lastTextChangeReplaceCharCount; int lastLineBottom; // the bottom pixel of the last line been replaced bool isMirrored_; - bool bidiColoring = false; // apply the BIDI algorithm on text segments of the same color + bool bidiColoring = false; // apply the BIDI algorithm on text segments of the same color Image leftCaretBitmap = null; Image rightCaretBitmap = null; int caretDirection = DWT.NULL; @@ -263,9 +267,9 @@ int endPage; // last page to print int startLine; // first (wrapped) line to print int endLine; // last (wrapped) line to print - bool singleLine; // widget single line mode + bool singleLine; // widget single line mode Point selection = null; // selected text - bool mirrored; // indicates the printing gc should be mirrored + bool mirrored; // indicates the printing gc should be mirrored int lineSpacing; int printMargin; @@ -3824,6 +3828,8 @@ * lineIndex is lineCount it returns the bottom pixel of the last line. * It means this function can be used to retrieve the bottom pixel of any line. * + * @return the top pixel of a given line index + * * @since 3.2 */ public int getLinePixel(int lineIndex) { @@ -3850,6 +3856,10 @@ /** * Returns the line index for a y, relative to the client area. * The line index returned is always in the range 0..lineCount - 1. + * + * @param y the y-coordinate pixel + * + * @return the line index for a given y-coordinate pixel * * @since 3.2 */ @@ -5127,13 +5137,14 @@ int length = text.length; if (length is ime.getCommitCount()) { content.replaceTextRange(start, end - start, ""); - caretOffset = start; + caretOffset = ime.getCompositionOffset(); caretWidth = 0; caretDirection = DWT.NULL; } else { content.replaceTextRange(start, end - start, text); caretOffset = ime.getCaretOffset(); if (ime.getWideCaret()) { + start = ime.getCompositionOffset(); int lineIndex = getCaretLine(); int lineOffset = content.getOffsetAtLine(lineIndex); TextLayout layout = renderer.getTextLayout(lineIndex); @@ -5517,7 +5528,6 @@ int newLastLineBottom = getLinePixel(lastLine + 1); if (lastLineBottom !is newLastLineBottom) { super.redraw(); - if (wordWrap) setCaretLocation(); } else { super.redraw(0, firstLineTop, clientAreaWidth, newLastLineBottom - firstLineTop, false); redrawLinesBullet(renderer.redrawLines); @@ -6064,6 +6074,9 @@ * </p> * * @param printer the printer to print to + * + * @return a <code>Runnable</code> for printing the receiver's text + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6093,6 +6106,9 @@ * * @param printer the printer to print to * @param options print options to use during printing + * + * @return a <code>Runnable</code> for printing the receiver's text + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6251,7 +6267,8 @@ /** * Removes the specified bidirectional segment listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6259,6 +6276,7 @@ * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> + * * @since 2.0 */ public void removeBidiSegmentListener(BidiSegmentListener listener) { @@ -6269,7 +6287,8 @@ /** * Removes the specified extended modify listener. * - * @param extendedModifyListener the listener + * @param extendedModifyListener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6286,7 +6305,8 @@ /** * Removes the specified line background listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6303,7 +6323,8 @@ /** * Removes the specified line style listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6320,7 +6341,8 @@ /** * Removes the specified modify listener. * - * @param modifyListener the listener + * @param modifyListener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6337,7 +6359,8 @@ /** * Removes the specified listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6377,7 +6400,8 @@ /** * Removes the specified verify listener. * - * @param verifyListener the listener + * @param verifyListener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6394,7 +6418,8 @@ /** * Removes the specified key verify listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -6410,7 +6435,8 @@ /** * Removes the specified word movement listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -7108,9 +7134,6 @@ setCaretLocation(); super.redraw(); } -/** - * @see dwt.widgets.Control#setForeground - */ public override void setForeground(Color color) { checkWidget(); foreground = color; @@ -8399,6 +8422,7 @@ void updateSelection(int startOffset, int replacedLength, int newLength) { if (selection.y <= startOffset) { // selection ends before text change + if (wordWrap) setCaretLocation(); return; } if (selection.x < startOffset) {
--- a/dwt/custom/StyledTextContent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledTextContent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -142,7 +142,8 @@ * Remove the specified text changed listener. * <p> * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul>
--- a/dwt/custom/StyledTextDropTargetEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledTextDropTargetEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -58,6 +58,7 @@ * * @see DropTargetAdapter * @see DropTargetEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/custom/StyledTextListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledTextListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,8 @@ } /** * Process StyledText events by invoking the event's handler. + * + * @param e the event to handle */ public override void handleEvent(Event e) {
--- a/dwt/custom/StyledTextPrintOptions.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledTextPrintOptions.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -31,6 +31,9 @@ * Runnable runnable = styledText.print(new Printer(), options); * runnable.run(); * </pre> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 2.1 */ public class StyledTextPrintOptions {
--- a/dwt/custom/StyledTextRenderer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/StyledTextRenderer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/custom/TableCursor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TableCursor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -150,6 +150,8 @@ * * @since 2.0 * + * @see <a href="http://www.eclipse.org/swt/snippets/#tablecursor">TableCursor snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TableCursor : Canvas {
--- a/dwt/custom/TableEditor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TableEditor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -80,6 +80,9 @@ * } * }); * </pre></code> +* +* @see <a href="http://www.eclipse.org/swt/snippets/#tableeditor">TableEditor snippets</a> +* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TableEditor : ControlEditor { Table table; @@ -229,6 +232,11 @@ tableColumn.addControlListener(columnListener); resize(); } +/** +* Specifies the <code>TableItem</code> that is to be edited. +* +* @param item the item to be edited +*/ public void setItem (TableItem item) { this.item = item; resize();
--- a/dwt/custom/TableTreeItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TableTreeItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/custom/TextChangedEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TextChangedEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -17,6 +17,8 @@ /** * This event is sent by the StyledTextContent implementor when a change to * the text occurs. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TextChangedEvent : TypedEvent {
--- a/dwt/custom/TextChangingEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TextChangingEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,8 @@ /** * This event is sent by the StyledTextContent implementor when a change * to the text is about to occur. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TextChangingEvent : TypedEvent { /**
--- a/dwt/custom/TreeEditor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/TreeEditor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -81,6 +81,9 @@ * } * }); * </pre></code> +* +* @see <a href="http://www.eclipse.org/swt/snippets/#treeeditor">TreeEditor snippets</a> +* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TreeEditor : ControlEditor { @@ -277,6 +280,11 @@ resize(); } +/** +* Specifies the <code>TreeItem</code> that is to be edited. +* +* @param item the item to be edited +*/ public void setItem (TreeItem item) { this.item = item; resize();
--- a/dwt/custom/VerifyKeyListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/VerifyKeyListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -16,6 +16,14 @@ import dwt.events.VerifyEvent; import dwt.internal.DWTEventListener; +/** + * Classes which implement this interface provide a method + * that deals with the event that is generated when a + * key is pressed. + * + * @see VerifyEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + */ public interface VerifyKeyListener : DWTEventListener { /** * The following event fields are used:<ul>
--- a/dwt/custom/ViewForm.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ViewForm.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -47,6 +47,8 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ViewForm : Composite {
--- a/dwt/custom/ViewFormLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/custom/ViewFormLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -197,7 +197,7 @@ int oldSeperator = form.separator; form.separator = -1; if (content !is null && !content.isDisposed()) { - if (left !is null || right!is null || center !is null){ + if (left !is null || right !is null || center !is null){ form.separator = y; y++; }
--- a/dwt/dnd/ByteArrayTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/ByteArrayTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,8 +25,7 @@ /** * The class <code>ByteArrayTransfer</code> provides a platform specific * mechanism for converting a java <code>byte[]</code> to a platform - * specific representation of the byte array and vice versa. See - * <code>Transfer</code> for additional information. + * specific representation of the byte array and vice versa. * * <p><code>ByteArrayTransfer</code> is never used directly but is sub-classed * by transfer agents that convert between data in a java format such as a @@ -125,6 +124,8 @@ * } * } * </code></pre> + * + * @see Transfer */ public abstract class ByteArrayTransfer : Transfer { @@ -158,14 +159,13 @@ /** * This implementation of <code>javaToNative</code> converts a java - * <code>byte[]</code> to a platform specific representation. For additional - * information see <code>Transfer#javaToNative</code>. - * - * @see Transfer#javaToNative - * + * <code>byte[]</code> to a platform specific representation. + * * @param object a java <code>byte[]</code> containing the data to be converted - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ protected void javaToNative (Object object, TransferData transferData) { if (!checkByteArray(object) || !isSupportedType(transferData)) { @@ -187,14 +187,12 @@ /** * This implementation of <code>nativeToJava</code> converts a platform specific * representation of a byte array to a java <code>byte[]</code>. - * For additional information see <code>Transfer#nativeToJava</code>. - * - * @see Transfer#nativeToJava * - * @param transferData the platform specific representation of the data to be - * been converted - * @return a java <code>byte[]</code> containing the converted data if the - * conversion was successful; otherwise null + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>byte[]</code> containing the converted data if the conversion was + * successful; otherwise null + * + * @see Transfer#javaToNative */ protected Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/Clipboard.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/Clipboard.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -35,6 +35,10 @@ * application to another or within an application. * * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#clipboard">Clipboard snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ClipboardExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Clipboard {
--- a/dwt/dnd/DND.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DND.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * Class DND contains all the constants used in defining a * DragSource or a DropTarget. * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DND {
--- a/dwt/dnd/DragSource.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DragSource.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -122,6 +122,10 @@ * <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd> * <dt><b>Events</b></dt> <dd>DND.DragStart, DND.DragSetData, DND.DragEnd</dd> * </dl> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: DNDExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DragSource : Widget { @@ -317,10 +321,10 @@ * area and use it during the drag to prevent the image from being inverted. * On XP if the shell is RTL, the image is not displayed. */ - int offset = 0; + int offset = event.x - dragEvent.x; hwndDrag = topControl.handle; if ((topControl.getStyle() & DWT.RIGHT_TO_LEFT) !is 0) { - offset = image.getBounds().width; + offset = image.getBounds().width - offset; RECT rect; OS.GetClientRect (topControl.handle, &rect); hwndDrag = OS.CreateWindowEx ( @@ -336,7 +340,7 @@ null); OS.ShowWindow (hwndDrag, OS.SW_SHOW); } - OS.ImageList_BeginDrag(imagelist.getHandle(), 0, offset, 0); + OS.ImageList_BeginDrag(imagelist.getHandle(), 0, offset, event.y - dragEvent.y); /* * Feature in Windows. When ImageList_DragEnter() is called, * it takes a snapshot of the screen If a drag is started @@ -479,6 +483,9 @@ * operation is in progress, by sending it one of the messages defined in * the <code>DragSourceListener</code> interface. * + * @return the listeners who will be notified when a drag and drop + * operation is in progress + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -658,7 +665,7 @@ * Removes the listener from the collection of listeners who will * be notified when a drag and drop operation is in progress. * - * @param listener the listener which should be notified + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
--- a/dwt/dnd/DragSourceAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DragSourceAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,21 +25,32 @@ * * @see DragSourceListener * @see DragSourceEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DragSourceAdapter : DragSourceListener { - /** - * This implementation of <code>dragStart</code> permits the drag operation to start. - * For additional information see <code>DragSourceListener.dragStart</code>. - */ - public void dragStart(DragSourceEvent event){} - /** - * This implementation of <code>dragFinished</code> does nothing. - * For additional information see <code>DragSourceListener.dragFinished</code>. - */ - public void dragFinished(DragSourceEvent event){} - /** - * This implementation of <code>dragSetData</code> does nothing. - * For additional information see <code>DragSourceListener.dragSetData</code>. - */ - public void dragSetData(DragSourceEvent event){} + +/** + * This implementation of <code>dragStart</code> permits the drag operation to start. + * For additional information see <code>DragSourceListener.dragStart</code>. + * + * @param event the information associated with the drag start event + */ +public void dragStart(DragSourceEvent event){} + +/** + * This implementation of <code>dragFinished</code> does nothing. + * For additional information see <code>DragSourceListener.dragFinished</code>. + * + * @param event the information associated with the drag finished event + */ +public void dragFinished(DragSourceEvent event){} + +/** + * This implementation of <code>dragSetData</code> does nothing. + * For additional information see <code>DragSourceListener.dragSetData</code>. + * + * @param event the information associated with the drag set data event + */ +public void dragSetData(DragSourceEvent event){} + }
--- a/dwt/dnd/DragSourceEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DragSourceEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -36,6 +36,7 @@ * * @see DragSourceAdapter * @see DragSourceEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/dnd/DragSourceEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DragSourceEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -23,6 +23,7 @@ * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener. * * @see DragSourceListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DragSourceEvent : TypedEvent { /**
--- a/dwt/dnd/DropTarget.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DropTarget.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -91,6 +91,10 @@ * <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged, * DND.DropAccept, DND.Drop </dd> * </dl> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: DNDExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DropTarget : Widget { @@ -473,6 +477,9 @@ * operation is in progress, by sending it one of the messages defined in * the <code>DropTargetListener</code> interface. * + * @return the listeners who will be notified when a drag and drop + * operation is in progress + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -630,7 +637,7 @@ * Removes the listener from the collection of listeners who will * be notified when a drag and drop operation is in progress. * - * @param listener the listener which should be notified + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
--- a/dwt/dnd/DropTargetAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DropTargetAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -26,6 +26,7 @@ * * @see DropTargetListener * @see DropTargetEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DropTargetAdapter : DropTargetListener { @@ -34,37 +35,54 @@ * operation defined in <code>event.detail</code>to be performed on the current data type * defined in <code>event.currentDataType</code>. * For additional information see <code>DropTargetListener.dragEnter</code>. + * + * @param event the information associated with the drag enter event */ public void dragEnter(DropTargetEvent event){} + /** * This implementation of <code>dragLeave</code> does nothing. * For additional information see <code>DropTargetListener.dragOperationChanged</code>. + * + * @param event the information associated with the drag leave event */ public void dragLeave(DropTargetEvent event){} + /** * This implementation of <code>dragOperationChanged</code> permits the default * operation defined in <code>event.detail</code>to be performed on the current data type * defined in <code>event.currentDataType</code>. * For additional information see <code>DropTargetListener.dragOperationChanged</code>. + * + * @param event the information associated with the drag operation changed event */ public void dragOperationChanged(DropTargetEvent event){} + /** * This implementation of <code>dragOver</code> permits the default * operation defined in <code>event.detail</code>to be performed on the current data type * defined in <code>event.currentDataType</code>. * For additional information see <code>DropTargetListener.dragOver</code>. + * + * @param event the information associated with the drag over event */ public void dragOver(DropTargetEvent event){} + /** * This implementation of <code>drop</code> does nothing. * For additional information see <code>DropTargetListener.drop</code>. + * + * @param event the information associated with the drop event */ public void drop(DropTargetEvent event){} + /** * This implementation of <code>dropAccept</code> permits the default * operation defined in <code>event.detail</code>to be performed on the current data type * defined in <code>event.currentDataType</code>. * For additional information see <code>DropTargetListener.dropAccept</code>. + * + * @param event the information associated with the drop accept event */ public void dropAccept(DropTargetEvent event){}
--- a/dwt/dnd/DropTargetEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DropTargetEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -54,6 +54,7 @@ * * @see DropTargetAdapter * @see DropTargetEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/dnd/DropTargetEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/DropTargetEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,8 @@ /** * The DropTargetEvent contains the event information passed in the methods of the DropTargetListener. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DropTargetEvent : TypedEvent { /**
--- a/dwt/dnd/FileTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/FileTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -30,7 +30,6 @@ * platform specific representation of the data and vice versa. * Each <code>String</code> in the array contains the absolute path for a single * file or directory. - * See <code>Transfer</code> for additional information. * * <p>An example of a java <code>String[]</code> containing a list of files is shown * below:</p> @@ -42,6 +41,8 @@ * fileData[0] = file1.getAbsolutePath(); * fileData[1] = file2.getAbsolutePath(); * </code></pre> + * + * @see Transfer */ public class FileTransfer : ByteArrayTransfer { @@ -72,13 +73,13 @@ * This implementation of <code>javaToNative</code> converts a list of file names * represented by a java <code>String[]</code> to a platform specific representation. * Each <code>String</code> in the array contains the absolute path for a single - * file or directory. For additional information see - * <code>Transfer#javaToNative</code>. - * - * @param object a java <code>String[]</code> containing the file names to be - * converted - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * file or directory. + * + * @param object a java <code>String[]</code> containing the file names to be converted + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ public void javaToNative(Object object, TransferData transferData) { if (!checkFile(object) || !isSupportedType(transferData)) { @@ -116,12 +117,12 @@ * This implementation of <code>nativeToJava</code> converts a platform specific * representation of a list of file names to a java <code>String[]</code>. * Each String in the array contains the absolute path for a single file or directory. - * For additional information see <code>Transfer#nativeToJava</code>. * - * @param transferData the platform specific representation of the data to be - * been converted - * @return a java <code>String[]</code> containing a list of file names if the - * conversion was successful; otherwise null + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>String[]</code> containing a list of file names if the conversion + * was successful; otherwise null + * + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/HTMLTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/HTMLTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -27,8 +27,7 @@ /** * The class <code>HTMLTransfer</code> provides a platform specific mechanism * for converting text in HTML format represented as a java <code>String</code> - * to a platform specific representation of the data and vice versa. See - * <code>Transfer</code> for additional information. + * to a platform specific representation of the data and vice versa. * * <p>An example of a java <code>String</code> containing HTML text is shown * below:</p> @@ -36,6 +35,8 @@ * <code><pre> * String htmlData = "<p>This is a paragraph of text.</p>"; * </code></pre> + * + * @see Transfer */ public class HTMLTransfer : ByteArrayTransfer { @@ -74,11 +75,12 @@ /** * This implementation of <code>javaToNative</code> converts HTML-formatted text * represented by a java <code>String</code> to a platform specific representation. - * For additional information see <code>Transfer#javaToNative</code>. * * @param object a java <code>String</code> containing HTML text - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ public void javaToNative (Object object, TransferData transferData){ if (!checkHTML(object) || !isSupportedType(transferData)) { @@ -145,12 +147,12 @@ /** * This implementation of <code>nativeToJava</code> converts a platform specific * representation of HTML text to a java <code>String</code>. - * For additional information see <code>Transfer#nativeToJava</code>. * - * @param transferData the platform specific representation of the data to be - * been converted - * @return a java <code>String</code> containing HTML text if the - * conversion was successful; otherwise null + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>String</code> containing HTML text if the conversion was successful; + * otherwise null + * + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/ImageTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/ImageTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -26,18 +26,18 @@ /** * The class <code>ImageTransfer</code> provides a platform specific mechanism - * for converting a Image represented as a java <code>ImageData</code> to a + * for converting an Image represented as a java <code>ImageData</code> to a * platform specific representation of the data and vice versa. - * See <code>Transfer</code> for additional information. * - * <p>An example of a java <code>ImageData</code> is shown - * below:</p> + * <p>An example of a java <code>ImageData</code> is shown below:</p> * * <code><pre> - * Image image = new Image("C:\temp\img1.gif"); + * Image image = new Image(display, "C:\temp\img1.gif"); * ImageData imgData = image.getImageData(); * </code></pre> * + * @see Transfer + * * @since 3.4 */ public class ImageTransfer : ByteArrayTransfer { @@ -65,12 +65,12 @@ /** * This implementation of <code>javaToNative</code> converts an ImageData object represented * by java <code>ImageData</code> to a platform specific representation. - * For additional information see <code>Transfer#javaToNative</code>. * - * @param object a java <code>ImageData</code> containing the ImageData to be - * converted - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * @param object a java <code>ImageData</code> containing the ImageData to be converted + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ public void javaToNative(Object object, TransferData transferData) { if (!checkImage(object) || !isSupportedType(transferData)) { @@ -138,12 +138,12 @@ /** * This implementation of <code>nativeToJava</code> converts a platform specific * representation of an image to java <code>ImageData</code>. - * For additional information see <code>Transfer#nativeToJava</code>. * - * @param transferData the platform specific representation of the data to be - * been converted - * @return a java <code>ImageData</code> of the image if - * conversion was successful; otherwise null + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>ImageData</code> of the image if the conversion was successful; + * otherwise null + * + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/OleEnumFORMATETC.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/OleEnumFORMATETC.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * 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
--- a/dwt/dnd/RTFTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/RTFTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,8 +28,7 @@ /** * The class <code>RTFTransfer</code> provides a platform specific mechanism * for converting text in RTF format represented as a java <code>String</code> - * to a platform specific representation of the data and vice versa. See - * <code>Transfer</code> for additional information. + * to a platform specific representation of the data and vice versa. * * <p>An example of a java <code>String</code> containing RTF text is shown * below:</p> @@ -37,6 +36,8 @@ * <code><pre> * String rtfData = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i Hello World}"; * </code></pre> + * + * @see Transfer */ public class RTFTransfer : ByteArrayTransfer { @@ -69,11 +70,12 @@ /** * This implementation of <code>javaToNative</code> converts RTF-formatted text * represented by a java <code>String</code> to a platform specific representation. - * For additional information see <code>Transfer#javaToNative</code>. * * @param object a java <code>String</code> containing RTF text - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ public void javaToNative (Object object, TransferData transferData){ if (!checkRTF(object) || !isSupportedType(transferData)) { @@ -102,12 +104,12 @@ /** * This implementation of <code>nativeToJava</code> converts a platform specific * representation of RTF text to a java <code>String</code>. - * For additional information see <code>Transfer#nativeToJava</code>. * - * @param transferData the platform specific representation of the data to be - * been converted - * @return a java <code>String</code> containing RTF text if the - * conversion was successful; otherwise null + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>String</code> containing RTF text if the conversion was successful; + * otherwise null + * + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/TableDragSourceEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TableDragSourceEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -41,6 +41,7 @@ * * @see DragSourceEffect * @see DragSourceEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */ @@ -93,7 +94,11 @@ SHDRAGIMAGE shdi; int DI_GETDRAGIMAGE = OS.RegisterWindowMessage ( "ShellGetDragImage"w.ptr ); //$NON-NLS-1$ if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, &shdi) !is 0) { - event.x += shdi.ptOffset.x; + if ((control.getStyle() & DWT.MIRRORED) !is 0) { + event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x; + } else { + event.x += shdi.ptOffset.x; + } event.y += shdi.ptOffset.y; auto hImage = shdi.hbmpDragImage; if (hImage !is null) { @@ -129,20 +134,23 @@ //OS.MoveMemory (srcData, dibBM.bmBits, sizeInBytes); byte[] srcData = (cast(byte*) dibBM.bmBits)[ 0 .. BITMAPINFOHEADER.sizeof ]; - byte[] alphaData = new byte[srcWidth * srcHeight]; - int spinc = dibBM.bmWidthBytes - srcWidth * 4; - int ap = 0, sp = 3; - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - alphaData [ap++] = srcData [sp]; - sp += 4; - } - sp += spinc; - } PaletteData palette = new PaletteData(0xFF00, 0xFF0000, 0xFF000000); ImageData data = new ImageData(srcWidth, srcHeight, bm.bmBitsPixel, palette, bm.bmWidthBytes, srcData); - data.alphaData = alphaData; - data.transparentPixel = shdi.crColorKey; + if (shdi.crColorKey is -1) { + byte[] alphaData = new byte[srcWidth * srcHeight]; + int spinc = dibBM.bmWidthBytes - srcWidth * 4; + int ap = 0, sp = 3; + for (int y = 0; y < srcHeight; ++y) { + for (int x = 0; x < srcWidth; ++x) { + alphaData [ap++] = srcData [sp]; + sp += 4; + } + sp += spinc; + } + data.alphaData = alphaData; + } else { + data.transparentPixel = shdi.crColorKey << 8; + } dragSourceImage = new Image(control.getDisplay(), data); OS.SelectObject (memHdc, oldMemBitmap); OS.DeleteDC (memHdc); @@ -150,6 +158,7 @@ OS.SelectObject (srcHdc, oldSrcBitmap); OS.DeleteDC (srcHdc); OS.ReleaseDC (null, hdc); + OS.DeleteObject (hImage); return dragSourceImage; } }
--- a/dwt/dnd/TableDropTargetEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TableDropTargetEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -49,6 +49,7 @@ * * @see DropTargetAdapter * @see DropTargetEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/dnd/TextTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TextTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -69,10 +69,10 @@ * represented by a java <code>String</code> to a platform specific representation. * * @param object a java <code>String</code> containing text - * @param transferData an empty <code>TransferData</code> object; this object - * will be filled in on return with the platform specific format of the data + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data * - * @see Transfer#javaToNative + * @see Transfer#nativeToJava */ public void javaToNative (Object object, TransferData transferData){ if (!checkText(object) || !isSupportedType(transferData)) { @@ -125,7 +125,7 @@ * @param transferData the platform specific representation of the data to be converted * @return a java <code>String</code> containing text if the conversion was successful; otherwise null * - * @see Transfer#nativeToJava + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dnd/Transfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/Transfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -29,6 +29,9 @@ * ByteArrayTransfer class.</p> * * @see ByteArrayTransfer + * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: DNDExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Transfer {
--- a/dwt/dnd/TransferData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TransferData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,6 +28,8 @@ * <p>You should only need to become familiar with the fields in this class if you * are implementing a Transfer subclass and you are unable to subclass the * ByteArrayTransfer class.</p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TransferData { /**
--- a/dwt/dnd/TreeDragSourceEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TreeDragSourceEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -40,6 +40,7 @@ * * @see DragSourceEffect * @see DragSourceEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */ @@ -92,7 +93,11 @@ SHDRAGIMAGE shdi; int DI_GETDRAGIMAGE = OS.RegisterWindowMessage ("ShellGetDragImage"w.ptr); //$NON-NLS-1$ if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, &shdi) !is 0) { - event.x += shdi.ptOffset.x; + if ((control.getStyle() & DWT.MIRRORED) !is 0) { + event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x; + } else { + event.x += shdi.ptOffset.x; + } event.y += shdi.ptOffset.y; auto hImage = shdi.hbmpDragImage; if (hImage !is null) { @@ -128,7 +133,21 @@ PaletteData palette = new PaletteData(0xFF00, 0xFF0000, 0xFF000000); ImageData data = new ImageData(srcWidth, srcHeight, bm.bmBitsPixel, palette, bm.bmWidthBytes, srcData); - data.transparentPixel = shdi.crColorKey << 8; + if (shdi.crColorKey is -1) { + byte[] alphaData = new byte[srcWidth * srcHeight]; + int spinc = dibBM.bmWidthBytes - srcWidth * 4; + int ap = 0, sp = 3; + for (int y = 0; y < srcHeight; ++y) { + for (int x = 0; x < srcWidth; ++x) { + alphaData [ap++] = srcData [sp]; + sp += 4; + } + sp += spinc; + } + data.alphaData = alphaData; + } else { + data.transparentPixel = shdi.crColorKey << 8; + } dragSourceImage = new Image (control.getDisplay (), data); OS.SelectObject (memHdc, oldMemBitmap); OS.DeleteDC (memHdc); @@ -136,6 +155,7 @@ OS.SelectObject (srcHdc, oldSrcBitmap); OS.DeleteDC (srcHdc); OS.ReleaseDC (null, hdc); + OS.DeleteObject (hImage); return dragSourceImage; } }
--- a/dwt/dnd/TreeDropTargetEffect.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/TreeDropTargetEffect.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -54,6 +54,7 @@ * * @see DropTargetAdapter * @see DropTargetEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/dnd/URLTransfer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dnd/URLTransfer.d Tue Jul 01 10:15:59 2008 +0200 @@ -27,16 +27,16 @@ /** * The class <code>URLTransfer</code> provides a platform specific mechanism * for converting text in URL format represented as a java <code>String</code> - * to a platform specific representation of the data and vice versa. See - * <code>Transfer</code> for additional information. The string + * to a platform specific representation of the data and vice versa. The string * must contain a fully specified url. * - * <p>An example of a java <code>String</code> containing a URL is shown - * below:</p> + * <p>An example of a java <code>String</code> containing a URL is shown below:</p> * * <code><pre> * String url = "http://www.eclipse.org"; * </code></pre> + * + * @see Transfer */ public class URLTransfer : ByteArrayTransfer { @@ -69,11 +69,12 @@ /** * This implementation of <code>javaToNative</code> converts a URL * represented by a java <code>String</code> to a platform specific representation. - * For additional information see <code>Transfer#javaToNative</code>. * * @param object a java <code>String</code> containing a URL - * @param transferData an empty <code>TransferData</code> object; this - * object will be filled in on return with the platform specific format of the data + * @param transferData an empty <code>TransferData</code> object that will + * be filled in on return with the platform specific format of the data + * + * @see Transfer#nativeToJava */ public void javaToNative (Object object, TransferData transferData){ if (!checkURL(object) || !isSupportedType(transferData)) { @@ -101,14 +102,14 @@ } /** - * This implementation of <code>nativeToJava</code> converts a platform specific - * representation of a URL to a java <code>String</code>. - * For additional information see <code>Transfer#nativeToJava</code>. - * - * @param transferData the platform specific representation of the data to be - * converted - * @return a java <code>String</code> containing a URL if the - * conversion was successful; otherwise null + * This implementation of <code>nativeToJava</code> converts a platform + * specific representation of a URL to a java <code>String</code>. + * + * @param transferData the platform specific representation of the data to be converted + * @return a java <code>String</code> containing a URL if the conversion was successful; + * otherwise null + * + * @see Transfer#javaToNative */ public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
--- a/dwt/dwthelper/utils.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/dwthelper/utils.d Tue Jul 01 10:15:59 2008 +0200 @@ -149,15 +149,15 @@ } public static String toHexString( int i ){ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); + return tango.text.convert.Integer.toString(i, "x" ); } public static String toOctalString( int i ){ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); + return tango.text.convert.Integer.toString(i, "o" ); } public static String toBinaryString( int i ){ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); + return tango.text.convert.Integer.toString(i, "b" ); } public static String toString( int i ){ @@ -632,11 +632,10 @@ static String toHex(uint value, bool prefix = true, int radix = 8){ return tango.text.convert.Integer.toString( value, - radix is 10 ? tango.text.convert.Integer.Style.Signed : - radix is 8 ? tango.text.convert.Integer.Style.Octal : - radix is 16 ? tango.text.convert.Integer.Style.Hex : - tango.text.convert.Integer.Style.Signed, - prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None + radix is 10 ? "d" : + radix is 8 ? "o" : + radix is 16 ? "x" : + "d" ); }
--- a/dwt/events/ArmEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ArmEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -20,6 +20,7 @@ * a widget such as a menu item being armed. * * @see ArmListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ArmEvent : TypedEvent {
--- a/dwt/events/ControlAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ControlAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -24,6 +24,7 @@ * * @see ControlListener * @see ControlEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class ControlAdapter : ControlListener {
--- a/dwt/events/ControlEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ControlEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * controls being moved or resized. * * @see ControlListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ControlEvent : TypedEvent {
--- a/dwt/events/DisposeEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/DisposeEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * widgets being disposed. * * @see DisposeListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class DisposeEvent : TypedEvent {
--- a/dwt/events/DragDetectEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/DragDetectEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -20,6 +20,7 @@ * a drag gesture. * * @see DragDetectListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/events/ExpandAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ExpandAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see ExpandListener * @see ExpandEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */
--- a/dwt/events/ExpandEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ExpandEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * <code>ExpandItem</code>s being expanded or collapsed. * * @see ExpandListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */
--- a/dwt/events/FocusAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/FocusAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see FocusListener * @see FocusEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class FocusAdapter : FocusListener {
--- a/dwt/events/FocusEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/FocusEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * widgets gaining and losing focus. * * @see FocusListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class FocusEvent : TypedEvent {
--- a/dwt/events/HelpEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/HelpEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * help being requested for a widget. * * @see HelpListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class HelpEvent : TypedEvent {
--- a/dwt/events/KeyAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/KeyAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see KeyListener * @see KeyEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class KeyAdapter : KeyListener {
--- a/dwt/events/KeyEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/KeyEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -34,8 +34,10 @@ * not necessary to add traversal listeners for these controls, * unless you want to override the default traversal. * </p> + * * @see KeyListener * @see TraverseListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class KeyEvent : TypedEvent {
--- a/dwt/events/MenuAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MenuAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see MenuListener * @see MenuEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class MenuAdapter : MenuListener {
--- a/dwt/events/MenuDetectEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MenuDetectEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -24,6 +24,7 @@ * specific trigger for showing a context menu is detected. * * @see MenuDetectListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/events/MenuEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MenuEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * menus being shown and hidden. * * @see MenuListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class MenuEvent : TypedEvent {
--- a/dwt/events/ModifyEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ModifyEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * text being modified. * * @see ModifyListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ModifyEvent : TypedEvent {
--- a/dwt/events/MouseAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MouseAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -26,6 +26,7 @@ * * @see MouseListener * @see MouseEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class MouseAdapter : MouseListener {
--- a/dwt/events/MouseEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MouseEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -33,6 +33,7 @@ * @see MouseListener * @see MouseMoveListener * @see MouseTrackListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class MouseEvent : TypedEvent {
--- a/dwt/events/MouseTrackAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/MouseTrackAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -26,6 +26,7 @@ * * @see MouseTrackListener * @see MouseEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class MouseTrackAdapter : MouseTrackListener {
--- a/dwt/events/PaintEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/PaintEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -26,6 +26,7 @@ * visible areas of controls requiring re-painting. * * @see PaintListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class PaintEvent : TypedEvent {
--- a/dwt/events/SelectionAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/SelectionAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see SelectionListener * @see SelectionEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class SelectionAdapter : SelectionListener {
--- a/dwt/events/SelectionEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/SelectionEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,6 +28,7 @@ * </p> * * @see SelectionListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class SelectionEvent : TypedEvent {
--- a/dwt/events/ShellAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ShellAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see ShellListener * @see ShellEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class ShellAdapter : ShellListener {
--- a/dwt/events/ShellEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/ShellEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -24,6 +24,7 @@ * operations being performed on shells. * * @see ShellListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ShellEvent : TypedEvent {
--- a/dwt/events/TraverseEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/TraverseEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -81,6 +81,7 @@ * </p> * * @see TraverseListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class TraverseEvent : KeyEvent {
--- a/dwt/events/TreeAdapter.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/TreeAdapter.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see TreeListener * @see TreeEvent + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class TreeAdapter : TreeListener {
--- a/dwt/events/TreeEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/TreeEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -21,6 +21,7 @@ * trees being expanded and collapsed. * * @see TreeListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class TreeEvent : SelectionEvent {
--- a/dwt/events/TypedEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/TypedEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,6 +28,7 @@ * applicable to the event occurrence. * * @see dwt.widgets.Event + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TypedEvent : DWTEventObject {
--- a/dwt/events/VerifyEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/events/VerifyEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -24,6 +24,7 @@ * widgets handling keyboard events * * @see VerifyListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class VerifyEvent : KeyEvent {
--- a/dwt/graphics/Color.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Color.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -36,6 +36,9 @@ * * @see RGB * @see Device#getSystemColor + * @see <a href="http://www.eclipse.org/swt/snippets/#color">Color and RGB snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: PaintExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Color : Resource {
--- a/dwt/graphics/Cursor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Cursor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -50,6 +50,9 @@ * <p> * Note: Only one of the above styles may be specified. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#cursor">Cursor snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Cursor : Resource {
--- a/dwt/graphics/Device.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Device.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,8 @@ * such as the Display device and the Printer device. Devices * can have a graphics context (GC) created for them, and they * can be drawn on by sending messages to the associated GC. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Device : Drawable { @@ -86,7 +88,6 @@ /* Scripts */ SCRIPT_PROPERTIES*[] scripts; - LOGFONT* [] logFontsCache; /* Advanced Graphics */ ULONG_PTR gdipToken; @@ -928,7 +929,6 @@ } gdipToken = 0; // TODO: assignment of 0 might not be valid for token scripts = null; - logFontsCache = null; if (hPalette !is null) OS.DeleteObject (hPalette); hPalette = null; colorRefCount = null;
--- a/dwt/graphics/Font.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Font.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -38,6 +38,9 @@ * </p> * * @see FontData + * @see <a href="http://www.eclipse.org/swt/snippets/#font">Font snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: GraphicsExample, PaintExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Font : Resource {
--- a/dwt/graphics/FontData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/FontData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,7 @@ * required, and thus no <code>dispose()</code> method is provided. * * @see Font + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class FontData {
--- a/dwt/graphics/FontMetrics.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/FontMetrics.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -23,6 +23,7 @@ * using the <code>getFontMetrics()</code> method. * * @see GC#getFontMetrics + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class FontMetrics {
--- a/dwt/graphics/GC.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/GC.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -69,6 +69,9 @@ * </p> * * @see dwt.events.PaintEvent + * @see <a href="http://www.eclipse.org/swt/snippets/#gc">GC snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: GraphicsExample, PaintExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class GC : Resource { @@ -1481,97 +1484,101 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, BITMAP bm, int imgWidth, int imgHeight) { /* Find the RGB values for the transparent pixel. */ - int transBlue = 0, transGreen = 0, transRed = 0; - bool isDib = bm.bmBits !is null; + bool isDib = bm.bmBits !is 0; auto hBitmap = srcImage.handle; auto srcHdc = OS.CreateCompatibleDC(handle); auto oldSrcBitmap = OS.SelectObject(srcHdc, hBitmap); byte[] originalColors = null; - if (bm.bmBitsPixel <= 8) { - if (isDib) { - /* Palette-based DIBSECTION */ - static if (OS.IsWinCE) { - byte* pBits = cast(byte*)bm.bmBits; - //OS.MoveMemory(pBits, bm.bmBits, 1); - byte oldValue = pBits[0]; - int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF; - pBits[0] = cast(byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); - //OS.MoveMemory(bm.bmBits, pBits, 1); - int color = OS.GetPixel(srcHdc, 0, 0); - pBits[0] = oldValue; - //OS.MoveMemory(bm.bmBits, pBits, 1); - transBlue = (color & 0xFF0000) >> 16; - transGreen = (color & 0xFF00) >> 8; - transRed = color & 0xFF; - } else { - int maxColors = 1 << bm.bmBitsPixel; - byte[] oldColors = new byte[maxColors * 4]; - OS.GetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)oldColors.ptr); - int offset = srcImage.transparentPixel * 4; - bool fixPalette = false; - for (int i = 0; i < oldColors.length; i += 4) { - if (i !is offset) { - if (oldColors[offset] is oldColors[i] && oldColors[offset+1] is oldColors[i+1] && oldColors[offset+2] is oldColors[i+2]) { - fixPalette = true; - break; + int transparentColor = srcImage.transparentColor; + if (transparentColor is -1) { + int transBlue = 0, transGreen = 0, transRed = 0; + bool fixPalette = false; + if (bm.bmBitsPixel <= 8) { + if (isDib) { + /* Palette-based DIBSECTION */ + static if (OS.IsWinCE) { + byte* pBits = cast(byte*)bm.bmBits; + //OS.MoveMemory(pBits, bm.bmBits, 1); + byte oldValue = pBits[0]; + int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF; + pBits[0] = cast(byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); + //OS.MoveMemory(bm.bmBits, pBits, 1); + int color = OS.GetPixel(srcHdc, 0, 0); + pBits[0] = oldValue; + //OS.MoveMemory(bm.bmBits, pBits, 1); + transBlue = (color & 0xFF0000) >> 16; + transGreen = (color & 0xFF00) >> 8; + transRed = color & 0xFF; + } else { + int maxColors = 1 << bm.bmBitsPixel; + byte[] oldColors = new byte[maxColors * 4]; + OS.GetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)oldColors.ptr); + int offset = srcImage.transparentPixel * 4; + for (int i = 0; i < oldColors.length; i += 4) { + if (i !is offset) { + if (oldColors[offset] is oldColors[i] && oldColors[offset+1] is oldColors[i+1] && oldColors[offset+2] is oldColors[i+2]) { + fixPalette = true; + break; + } } } + if (fixPalette) { + byte[] newColors = new byte[oldColors.length]; + transRed = transGreen = transBlue = 0xff; + newColors[offset] = cast(byte)transBlue; + newColors[offset+1] = cast(byte)transGreen; + newColors[offset+2] = cast(byte)transRed; + OS.SetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)newColors.ptr); + originalColors = oldColors; + } else { + transBlue = oldColors[offset] & 0xFF; + transGreen = oldColors[offset+1] & 0xFF; + transRed = oldColors[offset+2] & 0xFF; + } } - if (fixPalette) { - byte[] newColors = new byte[oldColors.length]; - transRed = transGreen = transBlue = 0xff; - newColors[offset] = cast(byte)transBlue; - newColors[offset+1] = cast(byte)transGreen; - newColors[offset+2] = cast(byte)transRed; - OS.SetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)newColors.ptr); - originalColors = oldColors; - } else { - transBlue = oldColors[offset] & 0xFF; - transGreen = oldColors[offset+1] & 0xFF; - transRed = oldColors[offset+2] & 0xFF; - } + } else { + /* Palette-based bitmap */ + int numColors = 1 << bm.bmBitsPixel; + /* Set the few fields necessary to get the RGB data out */ + BITMAPINFOHEADER bmiHeader; + bmiHeader.biSize = BITMAPINFOHEADER.sizeof; + bmiHeader.biPlanes = bm.bmPlanes; + bmiHeader.biBitCount = bm.bmBitsPixel; + byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4]; + bmi[] = (cast(byte*)&bmiHeader)[ 0 .. BITMAPINFOHEADER.sizeof ]; + static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); + OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); + int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel; + transRed = bmi[offset + 2] & 0xFF; + transGreen = bmi[offset + 1] & 0xFF; + transBlue = bmi[offset] & 0xFF; } } else { - /* Palette-based bitmap */ - int numColors = 1 << bm.bmBitsPixel; - /* Set the few fields necessary to get the RGB data out */ - BITMAPINFOHEADER bmiHeader; - bmiHeader.biSize = BITMAPINFOHEADER.sizeof; - bmiHeader.biPlanes = bm.bmPlanes; - bmiHeader.biBitCount = bm.bmBitsPixel; - byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4]; - bmi[] = (cast(byte*)&bmiHeader)[ 0 .. BITMAPINFOHEADER.sizeof ]; - static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); - OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); - int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel; - transRed = bmi[offset + 2] & 0xFF; - transGreen = bmi[offset + 1] & 0xFF; - transBlue = bmi[offset] & 0xFF; + /* Direct color image */ + int pixel = srcImage.transparentPixel; + switch (bm.bmBitsPixel) { + case 16: + transBlue = (pixel & 0x1F) << 3; + transGreen = (pixel & 0x3E0) >> 2; + transRed = (pixel & 0x7C00) >> 7; + break; + case 24: + transBlue = (pixel & 0xFF0000) >> 16; + transGreen = (pixel & 0xFF00) >> 8; + transRed = pixel & 0xFF; + break; + case 32: + transBlue = (pixel & 0xFF000000) >>> 24; + transGreen = (pixel & 0xFF0000) >> 16; + transRed = (pixel & 0xFF00) >> 8; + break; + default: + } } - } else { - /* Direct color image */ - int pixel = srcImage.transparentPixel; - switch (bm.bmBitsPixel) { - case 16: - transBlue = (pixel & 0x1F) << 3; - transGreen = (pixel & 0x3E0) >> 2; - transRed = (pixel & 0x7C00) >> 7; - break; - case 24: - transBlue = (pixel & 0xFF0000) >> 16; - transGreen = (pixel & 0xFF00) >> 8; - transRed = pixel & 0xFF; - break; - case 32: - transBlue = (pixel & 0xFF000000) >>> 24; - transGreen = (pixel & 0xFF0000) >> 16; - transRed = (pixel & 0xFF00) >> 8; - break; - default: - } + transparentColor = transBlue << 16 | transGreen << 8 | transRed; + if (!fixPalette) srcImage.transparentColor = transparentColor; } - int transparentColor = transBlue << 16 | transGreen << 8 | transRed; static if (OS.IsWinCE) { /* * Note in WinCE. TransparentImage uses the first entry of a palette @@ -3001,7 +3008,8 @@ } /** - * Returns the receiver's alpha value. + * Returns the receiver's alpha value. The alpha value + * is between 0 (transparent) and 255 (opaque). * * @return the alpha value * @@ -3939,7 +3947,8 @@ } /** - * Sets the receiver's alpha value. + * Sets the receiver's alpha value which must be + * between 0 (transparent) and 255 (opaque). * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some
--- a/dwt/graphics/GCData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/GCData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -30,6 +30,7 @@ * within the packages provided by DWT. It is not available on all * platforms, and should never be called from application code. * </p> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class GCData {
--- a/dwt/graphics/GlyphMetrics.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/GlyphMetrics.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -32,6 +32,7 @@ * * @see TextStyle * @see TextLayout + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */ @@ -56,13 +57,17 @@ * Constructs an instance of this class with the given * ascent, descent and width values. * + * @param ascent the GlyphMetrics ascent + * @param descent the GlyphMetrics descent + * @param width the GlyphMetrics width + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the ascent, descent or width argument is negative</li> * </ul> */ public this(int ascent, int descent, int width) { if (ascent < 0 || descent < 0 || width < 0) { - DWT.error(DWT.ERROR_INVALID_ARGUMENT); + DWT.error(DWT.ERROR_INVALID_ARGUMENT); } this.ascent = ascent; this.descent = descent;
--- a/dwt/graphics/Image.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Image.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -84,6 +84,9 @@ * @see Color * @see ImageData * @see ImageLoader + * @see <a href="http://www.eclipse.org/swt/snippets/#image">Image snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: GraphicsExample, ImageAnalyzer</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Image : Resource, Drawable { @@ -117,7 +120,7 @@ /** * specifies the transparent pixel */ - int transparentPixel = -1; + int transparentPixel = -1, transparentColor = -1; /** * the GC which is drawing on the image @@ -203,11 +206,11 @@ * provided image, with an appearance that varies depending * on the value of the flag. The possible flag values are: * <dl> - * <dt><b>IMAGE_COPY</b></dt> + * <dt><b>{@link DWT#IMAGE_COPY}</b></dt> * <dd>the result is an identical copy of srcImage</dd> - * <dt><b>IMAGE_DISABLE</b></dt> + * <dt><b>{@link DWT#IMAGE_DISABLE}</b></dt> * <dd>the result is a copy of srcImage which has a <em>disabled</em> look</dd> - * <dt><b>IMAGE_GRAY</b></dt> + * <dt><b>{@link DWT#IMAGE_GRAY}</b></dt> * <dd>the result is a copy of srcImage which has a <em>gray scale</em> look</dd> * </dl> * @@ -2095,6 +2098,7 @@ if (color is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (color.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); if (transparentPixel is -1) return; + transparentColor = -1; /* Get the HDC for the device */ auto hDC = device.internal_new_GC(null);
--- a/dwt/graphics/ImageData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/ImageData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,6 +41,9 @@ * * @see Image * @see ImageLoader + * @see <a href="http://www.eclipse.org/swt/snippets/#image">ImageData snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ImageAnalyzer</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class ImageData : CloneableCompatibility { @@ -601,6 +604,8 @@ /** * Returns the alpha value at offset <code>x</code> in * scanline <code>y</code> in the receiver's alpha data. + * The alpha value is between 0 (transparent) and + * 255 (opaque). * * @param x the x coordinate of the pixel to get the alpha value of * @param y the y coordinate of the pixel to get the alpha value of @@ -620,7 +625,9 @@ /** * Returns <code>getWidth</code> alpha values starting at offset * <code>x</code> in scanline <code>y</code> in the receiver's alpha - * data starting at <code>startIndex</code>. + * data starting at <code>startIndex</code>. The alpha values + * are unsigned, between <code>(byte)0</code> (transparent) and + * <code>(byte)255</code> (opaque). * * @param x the x position of the pixel to begin getting alpha values * @param y the y position of the pixel to begin getting alpha values @@ -1174,6 +1181,8 @@ /** * Sets the alpha value at offset <code>x</code> in * scanline <code>y</code> in the receiver's alpha data. + * The alpha value must be between 0 (transparent) + * and 255 (opaque). * * @param x the x coordinate of the alpha value to set * @param y the y coordinate of the alpha value to set @@ -1195,7 +1204,8 @@ * Sets the alpha values starting at offset <code>x</code> in * scanline <code>y</code> in the receiver's alpha data to the * values from the array <code>alphas</code> starting at - * <code>startIndex</code>. + * <code>startIndex</code>. The alpha values must be between + * <code>(byte)0</code> (transparent) and <code>(byte)255</code> (opaque) * * @param x the x coordinate of the pixel to being setting the alpha values * @param y the y coordinate of the pixel to being setting the alpha values
--- a/dwt/graphics/ImageLoader.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/ImageLoader.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -47,6 +47,9 @@ * <li>load interlaced GIF/PNG images</li> * <li>load progressive JPEG images</li> * </ul> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ImageAnalyzer</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ImageLoader {
--- a/dwt/graphics/ImageLoaderEvent.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/ImageLoaderEvent.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -36,6 +36,7 @@ * * @see ImageLoader * @see ImageLoaderListener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ImageLoaderEvent : DWTEventObject {
--- a/dwt/graphics/LineAttributes.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/LineAttributes.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ * * @see GC#getLineAttributes() * @see GC#setLineAttributes(LineAttributes) + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */
--- a/dwt/graphics/PaletteData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/PaletteData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -53,6 +53,7 @@ * * @see Image * @see RGB + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class PaletteData {
--- a/dwt/graphics/Path.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Path.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,10 @@ * which may not be available on some platforms. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: GraphicsExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class Path : Resource { @@ -139,7 +143,7 @@ } /** - * Constructs a new with the specifed PathData. + * Constructs a new Path with the specifed PathData. * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some
--- a/dwt/graphics/PathData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/PathData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -17,6 +17,7 @@ * Instances of this class describe device-independent paths. * * @see Path + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.1 */
--- a/dwt/graphics/Pattern.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Pattern.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -40,6 +40,10 @@ * which may not be available on some platforms. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: GraphicsExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class Pattern : Resource {
--- a/dwt/graphics/Point.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Point.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -40,6 +40,7 @@ * </p> * * @see Rectangle + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Point : SerializableCompatibility {
--- a/dwt/graphics/RGB.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/RGB.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -40,6 +40,8 @@ * </p> * * @see Color + * @see <a href="http://www.eclipse.org/swt/snippets/#color">Color and RGB snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class RGB : SerializableCompatibility {
--- a/dwt/graphics/Rectangle.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Rectangle.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,7 @@ * </p> * * @see Point + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Rectangle : SerializableCompatibility {
--- a/dwt/graphics/Region.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Region.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -35,6 +35,9 @@ * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: GraphicsExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Region : Resource {
--- a/dwt/graphics/Resource.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Resource.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -34,6 +34,7 @@ * * @see #dispose * @see #isDisposed + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.1 */ @@ -44,7 +45,7 @@ */ Device device; -this() { +public this() { } this(Device device) {
--- a/dwt/graphics/TextLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/TextLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -17,6 +17,8 @@ import dwt.internal.Compatibility; import dwt.internal.gdip.Gdip; +import dwt.internal.win32.EMR; +import dwt.internal.win32.EMREXTCREATEFONTINDIRECTW; import dwt.internal.win32.OS; import dwt.graphics.Color; @@ -50,7 +52,11 @@ * when those instances are no longer required. * </p> * - * @since 3.0 + * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample, StyledText tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * + * @since 3.0 */ public final class TextLayout : Resource { @@ -184,10 +190,7 @@ psla = null; } if (fallbackFont !is null) { - if (mLangFontLink2 !is null) { - /* ReleaseFont() */ - OS.VtblCall(8, mLangFontLink2, cast(int)fallbackFont); - } + OS.DeleteObject(fallbackFont); fallbackFont = null; } width = 0; @@ -243,24 +246,6 @@ OS.ScriptBreak(chars.ptr, chars.length, &run.analysis, run.psla); } -void checkItem (HDC hDC, StyleItem item) { - if (item.fallbackFont !is null) { - /* - * Feature in Windows. The fallback font returned by the MLang service - * can be disposed by some other client running in the same thread. - * For example, disposing a Browser widget internally releases all fonts - * in the MLang cache. The fix is to use GetObject() to detect if the - * font was disposed and reshape the run. - */ - LOGFONT logFont; - if (OS.GetObject( item.fallbackFont, LOGFONT.sizeof, &logFont) is 0) { - item.free(); - OS.SelectObject(hDC, getItemFont(item)); - shape(hDC, item); - } - } -} - void checkLayout () { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); } @@ -317,7 +302,10 @@ if (next.length !is 0 && segmentsText.charAt(next.start) is '\n') { run.length += 1; next.free(); - i++; + StyleItem[] newAllRuns = new StyleItem[allRuns.length - 1]; + System.arraycopy(allRuns, 0, newAllRuns, 0, i + 1); + System.arraycopy(allRuns, i + 2, newAllRuns, i + 1, allRuns.length - i - 2); + allRuns = newAllRuns; } break; } @@ -396,12 +384,14 @@ newRun.start = run.start + start; newRun.length = run.length - start; newRun.style = run.style; - newRun.analysis = run.analysis; + newRun.analysis = cloneScriptAnalysis(run.analysis); run.free(); run.length = start; OS.SelectObject(srcHdc, getItemFont(run)); + run.analysis.fNoGlyphIndex = false; shape (srcHdc, run); OS.SelectObject(srcHdc, getItemFont(newRun)); + newRun.analysis.fNoGlyphIndex = false; shape (srcHdc, newRun); StyleItem[] newAllRuns = new StyleItem[allRuns.length + 1]; System.arraycopy(allRuns, 0, newAllRuns, 0, i + 1); @@ -521,6 +511,30 @@ OS.OleUninitialize(); } +SCRIPT_ANALYSIS cloneScriptAnalysis (SCRIPT_ANALYSIS src) { + SCRIPT_ANALYSIS dst = new SCRIPT_ANALYSIS(); + dst.eScript = src.eScript; + dst.fRTL = src.fRTL; + dst.fLayoutRTL = src.fLayoutRTL; + dst.fLinkBefore = src.fLinkBefore; + dst.fLinkAfter = src.fLinkAfter; + dst.fLogicalOrder = src.fLogicalOrder; + dst.fNoGlyphIndex = src.fNoGlyphIndex; + dst.s = new SCRIPT_STATE(); + dst.s.uBidiLevel = src.s.uBidiLevel; + dst.s.fOverrideDirection = src.s.fOverrideDirection; + dst.s.fInhibitSymSwap = src.s.fInhibitSymSwap; + dst.s.fCharShape = src.s.fCharShape; + dst.s.fDigitSubstitute = src.s.fDigitSubstitute; + dst.s.fInhibitLigate = src.s.fInhibitLigate; + dst.s.fDisplayZWG = src.s.fDisplayZWG; + dst.s.fArabicNumContext = src.s.fArabicNumContext; + dst.s.fGcpClusters = src.s.fGcpClusters; + dst.s.fReserved = src.s.fReserved; + dst.s.fEngineReserved = src.s.fEngineReserved; + return dst; +} + /** * Draws the receiver's text using the specified GC at the specified * point. @@ -811,7 +825,6 @@ int end = run.start + run.length - 1; bool fullSelection = hasSelection && selectionStart <= run.start && selectionEnd >= end; bool partialSelection = hasSelection && !fullSelection && !(selectionStart > end || run.start > selectionEnd); - checkItem(hdc, run); OS.SelectObject(hdc, getItemFont(run)); int drawRunY = drawY + (baseline - run.ascent); if (partialSelection) { @@ -2770,11 +2783,26 @@ this.wrapWidth = width; } -bool shape (HDC hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs) { +bool shape (HDC hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES sp) { wchar[] wchars = StrToWCHARs( chars ); + bool useCMAPcheck = !sp.fComplex && !run.analysis.fNoGlyphIndex; + if (useCMAPcheck) { + short[] glyphs = new short[chars.length]; + if (OS.ScriptGetCMap(hdc, run.psc, chars, chars.length, 0, glyphs) !is OS.S_OK) { + if (run.psc !is 0) { + OS.ScriptFreeCache(run.psc); + glyphCount[0] = 0; + OS.MoveMemory(run.psc, new int /*long*/ [1], OS.PTR_SIZEOF); + } + return false; + } + } auto hr = OS.ScriptShape(hdc, run.psc, wchars.ptr, wchars.length, maxGlyphs, &run.analysis, run.glyphs, run.clusters, run.visAttrs, glyphCount.ptr); run.glyphCount = glyphCount[0]; + if (useCMAPcheck) return true; + if (hr !is OS.USP_E_SCRIPT_NOT_IN_FONT) { + if (run.analysis.fNoGlyphIndex) return true; SCRIPT_FONTPROPERTIES fp; fp.cBytes = SCRIPT_FONTPROPERTIES.sizeof; OS.ScriptGetFontProperties(hdc, run.psc, &fp); @@ -2821,111 +2849,87 @@ if (run.visAttrs is null) DWT.error(DWT.ERROR_NO_HANDLES); run.psc = cast(SCRIPT_CACHE*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, (void*).sizeof); if (run.psc is null) DWT.error(DWT.ERROR_NO_HANDLES); - bool shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); final short script = run.analysis.eScript; - - if (!shapeSucceed) { - /* - * Shape failed. - * Try to shape with fNoGlyphIndex when the run is in the - * Private Use Area. This allows for end-user-defined character (EUDC). - */ - auto properties = device.scripts[script]; - if (properties.fPrivateUseArea) { - run.analysis.fNoGlyphIndex = true; - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - } - } - + final SCRIPT_PROPERTIES sp = new SCRIPT_PROPERTIES(); + OS.MoveMemory(sp, device.scripts[script], SCRIPT_PROPERTIES.sizeof); + bool shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp); if (!shapeSucceed) { - /* - * Shape Failed. - * Try to use MLANG to find a suitable font to shape the run. - */ - if (mLangFontLink2 !is null) { - int dwCodePages; - int cchCodePages; - /* GetStrCodePages() */ - OS.VtblCall(4, mLangFontLink2, cast(int)wchars.ptr, wchars.length, 0, cast(int)&dwCodePages, cast(int)&cchCodePages); - HFONT hNewFont; - /* MapFont() */ - if (OS.VtblCall(10, mLangFontLink2, cast(int)hdc, dwCodePages, cast(int)wchars[0], cast(int)hNewFont) is OS.S_OK) { - auto hFont = OS.SelectObject(hdc, hNewFont); - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - if (shapeSucceed) { - run.fallbackFont = hNewFont; + int /*long*/ hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); + int /*long*/ ssa = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, OS.SCRIPT_STRING_ANALYSIS_sizeof()); + int /*long*/ metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null); + int /*long*/ oldMetaFont = OS.SelectObject(metaFileDc, hFont); + int flags = OS.SSA_METAFILE | OS.SSA_FALLBACK | OS.SSA_GLYPHS | OS.SSA_LINK; + if (OS.ScriptStringAnalyse(metaFileDc, chars, chars.length, 0, -1, flags, 0, null, null, 0, 0, 0, ssa) is OS.S_OK) { + OS.ScriptStringOut(ssa, 0, 0, 0, null, 0, 0, false); + OS.ScriptStringFree(ssa); + } + OS.HeapFree(hHeap, 0, ssa); + OS.SelectObject(metaFileDc, oldMetaFont); + int /*long*/ metaFile = OS.CloseEnhMetaFile(metaFileDc); + final EMREXTCREATEFONTINDIRECTW emr = new EMREXTCREATEFONTINDIRECTW(); + class MetaFileEnumProc { + int /*long*/ metaFileEnumProc (int /*long*/ hDC, int /*long*/ table, int /*long*/ record, int /*long*/ nObj, int /*long*/ lpData) { + OS.MoveMemory(emr.emr, record, EMR.sizeof); + switch (emr.emr.iType) { + case OS.EMR_EXTCREATEFONTINDIRECTW: + OS.MoveMemory(emr, record, EMREXTCREATEFONTINDIRECTW.sizeof); + break; + case OS.EMR_EXTTEXTOUTW: + return 0; + } + return 1; + } + }; + MetaFileEnumProc object = new MetaFileEnumProc(); + /* Avoid compiler warnings */ + if (false) object.metaFileEnumProc(0, 0, 0, 0, 0); + Callback callback = new Callback(object, "metaFileEnumProc", 5); + int /*long*/ address = callback.getAddress(); + if (address is 0) DWT.error(DWT.ERROR_NO_MORE_CALLBACKS); + OS.EnumEnhMetaFile(0, metaFile, address, 0, null); + OS.DeleteEnhMetaFile(metaFile); + callback.dispose(); + + int /*long*/ newFont = OS.CreateFontIndirectW(emr.elfw.elfLogFont); + OS.SelectObject(hdc, newFont); + if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) { + run.fallbackFont = newFont; + } + if (!shapeSucceed) { + if (!sp.fComplex) { + run.analysis.fNoGlyphIndex = true; + if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) { + run.fallbackFont = newFont; } else { - /* ReleaseFont() */ - OS.VtblCall(8, mLangFontLink2, cast(int)hNewFont); - OS.SelectObject(hdc, hFont); + run.analysis.fNoGlyphIndex = false; } } } - } - - if (!shapeSucceed) { - /* - * Shape Failed. - * Try to shape the run using the LOGFONT in the cache. - */ - auto hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); - LOGFONT logFont; - OS.GetObject(hFont, LOGFONT.sizeof, &logFont); - - LOGFONT* cachedLogFont = device.logFontsCache !is null ? device.logFontsCache[script] : null; - if (cachedLogFont !is null) { - cachedLogFont.lfHeight = logFont.lfHeight; - cachedLogFont.lfWeight = logFont.lfWeight; - cachedLogFont.lfItalic = logFont.lfItalic; - cachedLogFont.lfWidth = logFont.lfWidth; - auto newFont = OS.CreateFontIndirect(cachedLogFont); - OS.SelectObject(hdc, newFont); - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - if (shapeSucceed) { - run.fallbackFont = newFont; - } else { - OS.SelectObject(hdc, hFont); - OS.DeleteObject(newFont); + if (!shapeSucceed) { + if (mLangFontLink2 !is null) { + HANDLE hNewFont; + int dwCodePages, cchCodePages; + /* GetStrCodePages() */ + OS.VtblCall(4, mLangFontLink2, cast(int)wchars.ptr, wchars.length, 0, cast(int)&dwCodePages, cast(int)&cchCodePages); + /* MapFont() */ + if (OS.VtblCall(10, mLangFontLink2, cast(int)hdc, dwCodePages, cast(int)wchars[0], cast(int)&hNewFont) is OS.S_OK) { + LOGFONT logFont; + OS.GetObject( hNewFont, LOGFONT.sizeof, &logFont ); + /* ReleaseFont() */ + OS.VtblCall(8, mLangFontLink2, cast(int)hNewFont); + auto mLangFont = OS.CreateFontIndirect(logFont); + auto oldFont = OS.SelectObject(hdc, mLangFont); + if (shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs, sp)) { + run.fallbackFont = mLangFont; + } else { + OS.SelectObject(hdc, oldFont); + OS.DeleteObject(mLangFont); + } + } } } - if (!shapeSucceed) { - /* - * Shape Failed. - * Use EnumFontFamExProc to iterate over every font in the system that supports - * the charset of the run and try to shape it. - */ - if (device.logFontsCache is null) device.logFontsCache = new LOGFONT*[device.scripts.length]; - LOGFONT newLogFont; - - int EnumFontFamExProc( ENUMLOGFONTEX* lpelfe, NEWTEXTMETRICEX* lpntme, int FontType, int lParam) { - OS.MoveMemory(&newLogFont, cast(void*)lpelfe, LOGFONT.sizeof); - if (FontType is OS.RASTER_FONTTYPE) return 1; - newLogFont.lfHeight = logFont.lfHeight; - newLogFont.lfWeight = logFont.lfWeight; - newLogFont.lfItalic = logFont.lfItalic; - newLogFont.lfWidth = logFont.lfWidth; - auto newFont = OS.CreateFontIndirect(&newLogFont); - OS.SelectObject(hdc, newFont); - if (shape(hdc, run, chars, buffer, maxGlyphs)) { - run.fallbackFont = newFont; - LOGFONT* cacheLogFont = new LOGFONT(); - OS.MoveMemory(cacheLogFont, lpelfe, LOGFONT.sizeof); - device.logFontsCache[script] = cacheLogFont; - return 0; - } - OS.SelectObject(hdc, hFont); - OS.DeleteObject(newFont); - return 1; - } - CallbackDataEnumFontFamExProc cb; - cb.EnumFontFamExProc = &EnumFontFamExProc; - cb.lParam = 0; - auto properties = device.scripts[script]; - int charSet = properties.fAmbiguousCharSet ? OS.DEFAULT_CHARSET : properties.bCharSet; - newLogFont.lfCharSet = cast(byte)charSet; - OS.EnumFontFamiliesEx(hdc, &newLogFont, &EnumFontFamExProcFunc, cast(int) &cb, 0); - shapeSucceed = run.fallbackFont !is null; - } + if (!shapeSucceed) OS.SelectObject(hdc, hFont); + if (newFont !is run.fallbackFont) OS.DeleteObject(newFont); } if (!shapeSucceed) {
--- a/dwt/graphics/TextStyle.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/TextStyle.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -38,6 +38,8 @@ * @see TextLayout * @see Font * @see Color + * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */ @@ -173,7 +175,7 @@ /** * Create a new text style from an existing text style. * - *@param style the style to copy + * @param style the style to copy * * @since 3.4 */
--- a/dwt/graphics/Transform.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/graphics/Transform.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -36,6 +36,9 @@ * which may not be available on some platforms. * </p> * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: GraphicsExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class Transform : Resource {
--- a/dwt/internal/Compatibility.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/Compatibility.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * 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
--- a/dwt/internal/Library.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/Library.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -34,7 +34,7 @@ /** * DWT Minor version number (must be in the range 0..999) */ - static const int MINOR_VERSION = 442; + static const int MINOR_VERSION = 448; /** * DWT revision number (must be >= 0)
--- a/dwt/internal/image/FileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/FileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -82,7 +82,7 @@ public static ImageData[] load(InputStream istr, ImageLoader loader) { FileFormat fileFormat = null; LEDataInputStream stream = new LEDataInputStream(istr); - bool isSupported = false; + bool isSupported = false; foreach( TFormat; TFormats ){ try{ fileFormat = new TFormat();
--- a/dwt/internal/image/GIFFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/GIFFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/JPEGDecoder.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/JPEGDecoder.d Tue Jul 01 10:15:59 2008 +0200 @@ -243,7 +243,7 @@ * You could suppress output of a table by setting this to true. * (See jpeg_suppress_tables for an example.) */ - bool sent_table; /* true when table has been output */ + bool sent_table; /* true when table has been output */ } static final class JHUFF_TBL { @@ -256,7 +256,7 @@ * You could suppress output of a table by setting this to true. * (See jpeg_suppress_tables for an example.) */ - bool sent_table; /* true when table has been output */ + bool sent_table; /* true when table has been output */ } static final class bitread_perm_state { /* Bitreading state saved across MCUs */ @@ -374,7 +374,7 @@ /* This is here to share code between baseline and progressive decoders; */ /* other modules probably should not use it */ - bool insufficient_data; /* set true after emitting warning */ + bool insufficient_data; /* set true after emitting warning */ bitread_working_state br_state_local; savable_state state_local; @@ -1280,7 +1280,7 @@ return true; } - bool decode_mcu_DC_first (jpeg_decompress_struct cinfo, short[][] MCU_data) { + bool decode_mcu_DC_first (jpeg_decompress_struct cinfo, short[][] MCU_data) { phuff_entropy_decoder entropy = this; int Al = cinfo.Al; int s = 0, r; @@ -1596,7 +1596,7 @@ * components will be ignored (eg grayscale output from YCbCr image), * we can skip most computations for the unused components. */ - bool component_needed; /* do we need the value of this component? */ + bool component_needed; /* do we need the value of this component? */ /* These values are computed before starting a scan of the component. */ /* The decompressor output side may not use these variables. */ @@ -1634,7 +1634,7 @@ * premultiplied as described above. Since colormap indexes must fit into * JSAMPLEs, the entries of this array will too. */ - bool is_padded; /* is the colorindex padded for odither? */ + bool is_padded; /* is the colorindex padded for odither? */ int[MAX_Q_COMPS] Ncolors;// = new int [MAX_Q_COMPS]; /* # of values alloced to each component */ @@ -1644,7 +1644,7 @@ /* Variables for Floyd-Steinberg dithering */ // FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ - bool on_odd_row; + bool on_odd_row; void start_pass (jpeg_decompress_struct cinfo, bool is_pre_scan) { error(); @@ -1661,7 +1661,7 @@ // JDIMENSION *out_row_ctr, // JDIMENSION out_rows_avail)); - bool need_context_rows; /* TRUE if need rows above & below */ + bool need_context_rows; /* TRUE if need rows above & below */ /* Color conversion buffer. When using separate upsampling and color * conversion steps, this buffer holds one upsampled row group until it @@ -1706,8 +1706,8 @@ /* State of marker reader --- nominally internal, but applications * supplying COM or APPn handlers might like to know the state. */ - bool saw_SOI; /* found SOI? */ - bool saw_SOF; /* found SOF? */ + bool saw_SOI; /* found SOI? */ + bool saw_SOF; /* found SOF? */ int next_restart_num; /* next restart number expected (0-7) */ int discarded_bytes; /* # of bytes skipped looking for a marker */ @@ -1734,7 +1734,7 @@ byte[][][MAX_COMPONENTS] buffer;// = new byte[MAX_COMPONENTS][][]; int[MAX_COMPONENTS] buffer_offset;// = new int[MAX_COMPONENTS]; - bool buffer_full; /* Have we gotten an iMCU row from decoder? */ + bool buffer_full; /* Have we gotten an iMCU row from decoder? */ int[1] rowgroup_ctr;// = new int[1]; /* counts row groups output to postprocessor */ /* Remaining fields are only used in the context case. */ @@ -1958,10 +1958,10 @@ static final class jpeg_input_controller { int consume_input; - bool has_multiple_scans; /* True if file has multiple scans */ + bool has_multiple_scans; /* True if file has multiple scans */ bool eoi_reached; - bool inheaders; /* true until first SOS is reached */ + bool inheaders; /* true until first SOS is reached */ } static final class jpeg_color_deconverter { @@ -2050,7 +2050,7 @@ // struct jpeg_memory_mgr * mem; /* Memory manager module */\ // struct jpeg_progress_mgr * progress; /* Progress monitor, or null if none */\ // void * client_data; /* Available for use by application */\ - bool is_decompressor; /* So common code can tell which is which */ + bool is_decompressor; /* So common code can tell which is which */ int global_state; /* For checking call sequence validity */ // /* Source of compressed data */ @@ -2080,22 +2080,22 @@ double output_gamma; /* image gamma wanted in output */ - bool buffered_image; /* true=multiple output passes */ - bool raw_data_out; /* true=downsampled data wanted */ + bool buffered_image; /* true=multiple output passes */ + bool raw_data_out; /* true=downsampled data wanted */ int dct_method; /* IDCT algorithm selector */ - bool do_fancy_upsampling; /* true=apply fancy upsampling */ - bool do_block_smoothing; /* true=apply interblock smoothing */ - - bool quantize_colors; /* true=colormapped output wanted */ + bool do_fancy_upsampling; /* true=apply fancy upsampling */ + bool do_block_smoothing; /* true=apply interblock smoothing */ + + bool quantize_colors; /* true=colormapped output wanted */ /* the following are ignored if not quantize_colors: */ int dither_mode; /* type of color dithering to use */ - bool two_pass_quantize; /* true=use two-pass color quantization */ + bool two_pass_quantize; /* true=use two-pass color quantization */ int desired_number_of_colors; /* max # colors to use in created colormap */ /* these are significant only in buffered-image mode: */ - bool enable_1pass_quant; /* enable future use of 1-pass quantizer */ + bool enable_1pass_quant; /* enable future use of 1-pass quantizer */ bool enable_external_quant;/* enable future use of external colormap */ - bool enable_2pass_quant; /* enable future use of 2-pass quantizer */ + bool enable_2pass_quant; /* enable future use of 2-pass quantizer */ /* Description of actual output image that will be returned to application. * These fields are computed by jpeg_start_decompress(). @@ -2182,8 +2182,8 @@ jpeg_component_info[] comp_info; /* comp_info[i] describes component that appears i'th in SOF */ - bool progressive_mode; /* true if SOFn specifies progressive mode */ - bool arith_code; /* true=arithmetic coding, false=Huffman */ + bool progressive_mode; /* true if SOFn specifies progressive mode */ + bool arith_code; /* true=arithmetic coding, false=Huffman */ byte[NUM_ARITH_TBLS] arith_dc_L;// = new byte[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ byte[NUM_ARITH_TBLS] arith_dc_U;// = new byte[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ @@ -2194,17 +2194,17 @@ /* These fields record data obtained from optional markers recognized by * the JPEG library. */ - bool saw_JFIF_marker; /* true iff a JFIF APP0 marker was found */ + bool saw_JFIF_marker; /* true iff a JFIF APP0 marker was found */ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is true: */ byte JFIF_major_version; /* JFIF version number */ byte JFIF_minor_version; byte density_unit; /* JFIF code for pixel size units */ short X_density; /* Horizontal pixel density */ short Y_density; /* Vertical pixel density */ - bool saw_Adobe_marker; /* true iff an Adobe APP14 marker was found */ + bool saw_Adobe_marker; /* true iff an Adobe APP14 marker was found */ byte Adobe_transform; /* Color transform code from Adobe marker */ - bool CCIR601_sampling; /* true=first samples are cosited */ + bool CCIR601_sampling; /* true=first samples are cosited */ /* Aside from the specific data retained from APPn markers known to the * library, the uninterpreted contents of any or all APPn and COM markers
--- a/dwt/internal/image/JPEGFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/JPEGFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This source file is made available under the terms contained in the README file * accompanying this program. The README file should be located in the about_files directory of the * plug-in that contains this source file.
--- a/dwt/internal/image/LEDataInputStream.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/LEDataInputStream.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * 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
--- a/dwt/internal/image/OS2BMPFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/OS2BMPFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/PNGFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/PNGFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/PngDeflater.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/PngDeflater.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/PngEncoder.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/PngEncoder.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * 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
--- a/dwt/internal/image/PngHuffmanTable.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/PngHuffmanTable.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/TIFFFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/TIFFFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/WinBMPFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/WinBMPFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/internal/image/WinICOFileFormat.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/internal/image/WinICOFileFormat.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/layout/FillLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/FillLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -49,6 +49,9 @@ * shell.setLayout(fillLayout); * </pre> * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: LayoutExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class FillLayout : Layout { /**
--- a/dwt/layout/FormAttachment.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/FormAttachment.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -79,6 +79,7 @@ * * @see FormLayout * @see FormData + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */ @@ -126,12 +127,12 @@ * </p> * * <br>Possible values are: <ul> - * <li>TOP: Attach the side to the top side of the specified control.</li> - * <li>BOTTOM : Attach the side to the bottom side of the specified control.</li> - * <li>LEFT: Attach the side to the left side of the specified control.</li> - * <li>RIGHT: Attach the side to the right side of the specified control.</li> - * <li>CENTER: Attach the side at a position which will center the control on the specified control.</li> - * <li>DEFAULT: Attach the side to the adjacent side of the specified control.</li> + * <li>{@link DWT#TOP}: Attach the side to the top side of the specified control.</li> + * <li>{@link DWT#BOTTOM}: Attach the side to the bottom side of the specified control.</li> + * <li>{@link DWT#LEFT}: Attach the side to the left side of the specified control.</li> + * <li>{@link DWT#RIGHT}: Attach the side to the right side of the specified control.</li> + * <li>{@link DWT#CENTER}: Attach the side at a position which will center the control on the specified control.</li> + * <li>{@link DWT#DEFAULT}: Attach the side to the adjacent side of the specified control.</li> * </ul> */ public int alignment; @@ -220,11 +221,26 @@ /** * Constructs a new instance of this class given a control, - * an offset and an alignment. + * an offset and an alignment. The possible alignment values are: + * <dl> + * <dt><b>{@link DWT#TOP}</b></dt> + * <dd>the side will be attached to the top side of the specified control</dd> + * <dt><b>{@link DWT#BOTTOM}</b></dt> + * <dd>the side will be attached to the bottom side of the specified control</dd> + * <dt><b>{@link DWT#LEFT}</b></dt> + * <dd>the side will be attached to the left side of the specified control</dd> + * <dt><b>{@link DWT#RIGHT}</b></dt> + * <dd>the side will be attached to the right side of the specified control</dd> + * <dt><b>{@link DWT#CENTER}</b></dt> + * <dd>the side will be centered on the same side of the specified control</dd> + * <dt><b>{@link DWT#DEFAULT}</b></dt> + * <dd>the side will be attached to the adjacent side of the specified control</dd> + * </dl> * * @param control the control the side is attached to * @param offset the offset of the side from the control - * @param alignment the alignment of the side to the control it is attached to + * @param alignment the alignment of the side to the control it is attached to, + * one of TOP, BOTTOM, LEFT, RIGHT, CENTER, or DEFAULT */ public this (Control control, int offset, int alignment) { this.control = control;
--- a/dwt/layout/FormData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/FormData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -45,6 +45,7 @@ * * @see FormLayout * @see FormAttachment + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 */
--- a/dwt/layout/FormLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/FormLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -92,9 +92,11 @@ * * @see FormData * @see FormAttachment + * @see <a href="http://www.eclipse.org/swt/snippets/#formlayout">FormLayout snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: LayoutExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 2.0 - * */ public final class FormLayout : Layout {
--- a/dwt/layout/GridData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/GridData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -48,6 +48,7 @@ * * @see GridLayout * @see Control#setLayoutData + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class GridData { /** @@ -425,8 +426,10 @@ /** * Constructs a new instance of GridData according to the parameters. * - * @param horizontalAlignment how control will be positioned horizontally within a cell - * @param verticalAlignment how control will be positioned vertically within a cell + * @param horizontalAlignment how control will be positioned horizontally within a cell, + * one of: DWT.BEGINNING (or DWT.LEFT), DWT.CENTER, DWT.END (or DWT.RIGHT), or DWT.FILL + * @param verticalAlignment how control will be positioned vertically within a cell, + * one of: DWT.BEGINNING (or DWT.TOP), DWT.CENTER, DWT.END (or DWT.BOTTOM), or DWT.FILL * @param grabExcessHorizontalSpace whether cell will be made wide enough to fit the remaining horizontal space * @param grabExcessVerticalSpace whether cell will be made high enough to fit the remaining vertical space * @@ -439,8 +442,10 @@ /** * Constructs a new instance of GridData according to the parameters. * - * @param horizontalAlignment how control will be positioned horizontally within a cell - * @param verticalAlignment how control will be positioned vertically within a cell + * @param horizontalAlignment how control will be positioned horizontally within a cell, + * one of: DWT.BEGINNING (or DWT.LEFT), DWT.CENTER, DWT.END (or DWT.RIGHT), or DWT.FILL + * @param verticalAlignment how control will be positioned vertically within a cell, + * one of: DWT.BEGINNING (or DWT.TOP), DWT.CENTER, DWT.END (or DWT.BOTTOM), or DWT.FILL * @param grabExcessHorizontalSpace whether cell will be made wide enough to fit the remaining horizontal space * @param grabExcessVerticalSpace whether cell will be made high enough to fit the remaining vertical space * @param horizontalSpan the number of column cells that the control will take up
--- a/dwt/layout/GridLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/GridLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -54,6 +54,9 @@ * </p> * * @see GridData + * @see <a href="http://www.eclipse.org/swt/snippets/#gridlayout">GridLayout snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: LayoutExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class GridLayout : Layout {
--- a/dwt/layout/RowData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/RowData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,7 @@ * </p> * * @see RowLayout + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class RowData { /**
--- a/dwt/layout/RowLayout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/layout/RowLayout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -61,6 +61,9 @@ * </p> * * @see RowData + * @see <a href="http://www.eclipse.org/swt/snippets/#rowlayout">RowLayout snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: LayoutExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class RowLayout : Layout {
--- a/dwt/ole/win32/OleAutomation.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleAutomation.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -99,6 +99,9 @@ * automation.dispose(); * * </pre></code> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#ole">OLE and ActiveX snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: OLEExample, OleWebBrowser</a> */ public final class OleAutomation { private IDispatch objIDispatch; @@ -156,6 +159,13 @@ IDispatch getAddress() { return objIDispatch; } +/** + * Returns the fully qualified name of the Help file for the given member ID. + * + * @param dispId the member ID whose Help file is being retrieved. + * @return a string representing the fully qualified name of a Help + * file or null. + */ public String getHelpFile(int dispId) { if (objITypeInfo is null) return null; BSTR file; @@ -167,6 +177,12 @@ } return null; } +/** + * Returns the documentation string for the given member ID. + * + * @param dispId the member ID in which the documentation is being retrieved. + * @return the documentation string if it exists; otherwise return null. + */ public String getDocumentation(int dispId) { if (objITypeInfo is null) return null; BSTR doc; @@ -178,6 +194,12 @@ } return null; } +/** + * Returns the property description of a variable at the given index. + * + * @param index the index of a variable whose property is being retrieved. + * @return an OlePropertyDescription for a variable at the given index. + */ public OlePropertyDescription getPropertyDescription(int index) { if (objITypeInfo is null) return null; VARDESC* vardesc; @@ -204,6 +226,12 @@ objITypeInfo.ReleaseVarDesc(vardesc); return data; } +/** + * Returns the description of a function at the given index. + * + * @param index the index of a function whose property is being retrieved. + * @return an OleFunctionDescription for a function at the given index. + */ public OleFunctionDescription getFunctionDescription(int index) { if (objITypeInfo is null) return null; FUNCDESC* funcdesc; @@ -256,6 +284,13 @@ objITypeInfo.ReleaseFuncDesc(funcdesc); return data; } +/** + * Returns the type info of the current object referenced by the automation. + * The type info contains information about the object such as the function descriptions, + * the member descriptions and attributes of the type. + * + * @return the type info of the receiver + */ public TYPEATTR* getTypeInfoAttributes() { if (objITypeInfo is null) return null; TYPEATTR* ppTypeAttr; @@ -266,7 +301,12 @@ objITypeInfo.ReleaseTypeAttr(ppTypeAttr); return typeattr; } - +/** + * Returns the name of the given member ID. + * + * @param dispId the member ID in which the name is being retrieved. + * @return the name if it exists; otherwise return null. + */ public String getName(int dispId) { if (objITypeInfo is null) return null; BSTR name; @@ -278,7 +318,13 @@ } return null; } - +/** + * Returns the name of a function and parameter names for the specified function ID. + * + * @param dispId the function ID in which the name and parameters are being retrieved. + * @param maxSize the maximum number of names to retrieve. + * @return an array of name containing the function name and the parameter names + */ public String[] getNames(int dispId, int maxSize) { if (objITypeInfo is null) return new String[0]; BSTR[] names = new BSTR[maxSize];
--- a/dwt/ole/win32/OleClientSite.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleClientSite.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -86,6 +86,8 @@ * <dt><b>Events</b> <dd>Dispose, Move, Resize * </dl> * + * @see <a href="http://www.eclipse.org/swt/snippets/#ole">OLE and ActiveX snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: OLEExample, OleWebBrowser</a> */ public class OleClientSite : Composite { @@ -633,6 +635,14 @@ } return xFormHimetricToPixels(sizel); } +/** + * Returns the indent value that would be used to compute the clipping area + * of the active X object. + * + * NOTE: The indent value is no longer being used by the client site. + * + * @return the rectangle representing the indent + */ public Rectangle getIndent() { return new Rectangle(indent.left, indent.right, indent.top, indent.bottom); } @@ -740,6 +750,14 @@ return COM.S_OK; } +/** + * Returns whether ole document is dirty by checking whether the content + * of the file representing the document is dirty. + * + * @return <code>true</code> if the document has been modified, + * <code>false</code> otherwise. + * @since 3.1 + */ public bool isDirty() { /* * Note: this method must return true unless it is absolutely clear that the @@ -987,7 +1005,7 @@ } protected void releaseObjectInterfaces() { - if (objIOleInPlaceObject!is null) + if (objIOleInPlaceObject !is null) objIOleInPlaceObject.Release(); objIOleInPlaceObject = null; @@ -1019,6 +1037,17 @@ COM.CoFreeUnusedLibraries(); } +/** + * Saves the document to the specified file and includes OLE specific information if specified. + * This method must <b>only</b> be used for files that have an OLE Storage format. For example, + * a word file edited with Word.Document should be saved using this method because there is + * formating information that should be stored in the OLE specific Storage format. + * + * @param file the file to which the changes are to be saved + * @param includeOleInfo the flag to indicate whether OLE specific information should be saved. + * + * @return true if the save was successful + */ public bool save(File file, bool includeOleInfo) { if (includeOleInfo) return saveToStorageFile(file); @@ -1210,6 +1239,11 @@ objIOleObject.Close(COM.OLECLOSE_SAVEIFDIRTY); } } +/** + * The indent value is no longer being used by the client site. + * + * @param newIndent the rectangle representing the indent amount + */ public void setIndent(Rectangle newIndent) { indent.left = newIndent.x; indent.right = newIndent.width;
--- a/dwt/ole/win32/OleControlSite.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleControlSite.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -61,6 +61,8 @@ * <dt><b>Events</b> <dd>Dispose, Move, Resize * </dl> * + * @see <a href="http://www.eclipse.org/swt/snippets/#ole">OLE and ActiveX snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: OLEExample, OleWebBrowser</a> */ public class OleControlSite : OleClientSite { @@ -95,7 +97,7 @@ * in the registry for this Control (for example, the VersionIndependentProgID for * Internet Explorer is Shell.Explorer) * - *@exception IllegalArgumentException <ul> + * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when the parent is null *</ul> * @exception DWTException <ul> @@ -468,10 +470,14 @@ } /** * - * Get the control site property specified by the dispIdMember. + * Get the control site property specified by the dispIdMember, or + * <code>null</code> if the dispId is not recognised. * + * @param dispId the dispId + * + * @return the property value or <code>null</code> + * * @since 2.1 - * */ public Variant getSiteProperty(int dispId){ for (int i = 0; i < sitePropertyIds.length; i++) { @@ -651,7 +657,7 @@ * * @param eventID the event identifier * - * @param listener the listener + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> @@ -692,17 +698,15 @@ /** * Removes the listener. * - * @since 2.0 - * * @param automation the automation object that provides the event notification - * * @param eventID the event identifier - * - * @param listener the listener + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> + * + * @since 2.0 */ public void removeEventListener(OleAutomation automation, int eventID, OleListener listener) { checkWidget(); @@ -753,7 +757,8 @@ /** * Removes the listener. * - * @param listener the listener + * @param propertyID the identifier of the property + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li>
--- a/dwt/ole/win32/OleEventSink.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleEventSink.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * 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
--- a/dwt/ole/win32/OleFrame.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleFrame.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -53,6 +53,8 @@ * <dt><b>Events</b> <dd>Dispose, Move, Resize * </dl> * + * @see <a href="http://www.eclipse.org/swt/snippets/#ole">OLE and ActiveX snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: OLEExample, OleWebBrowser</a> */ final public class OleFrame : Composite {
--- a/dwt/ole/win32/OleListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OleListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -15,11 +15,26 @@ import dwt.ole.win32.OleEvent; /** + * Implementers of <code>OleListener</code> provide a simple + * <code>handleEvent()</code> method that is used internally + * by DWT to dispatch events. + * <p> + * After creating an instance of a class that implements this + * interface it can be added to an <code>OleControlSite</code> + * using the <code>addEventListener()</code> method and removed + * using the <code>removeEventListener()</code> method. When the + * specified event occurs, <code>handleEvent()</code> will be + * sent to the instance. + * </p> + * + * @see OleControlSite */ -public interface OleListener -{ +public interface OleListener { + /** + * Sent when an event that the receiver has registered for occurs. * + * @param event the event which occurred */ public void handleEvent(OleEvent event); }
--- a/dwt/ole/win32/OlePropertyChangeSink.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/OlePropertyChangeSink.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * 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
--- a/dwt/ole/win32/Variant.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/ole/win32/Variant.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -35,8 +35,10 @@ * a method on an OLE Control or OLE Document. * */ -public final class Variant -{ +public final class Variant { + /** + * The size in bytes of a native VARIANT struct. + */ /** * A variant always takes up 16 bytes, no matter what you * store in it. Objects, strings, and arrays are not physically @@ -45,8 +47,9 @@ * pointer to the string or array. The actual data are stored elsewhere. */ //public static final int sizeof = 16; + + private short type; // OLE.VT_* type - private bool booleanData; private byte byteData; private short shortData; @@ -205,7 +208,7 @@ * * @param val the Java long value that this Variant represents * - *@since 3.2 + * @since 3.2 */ public this(long val) { type = COM.VT_I8;
--- a/dwt/opengl/GLCanvas.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/opengl/GLCanvas.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,10 @@ /** * GLCanvas is a widget capable of displaying OpenGL content. * + * @see GLData + * @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.2 */
--- a/dwt/opengl/GLData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/opengl/GLData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2008 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 @@ -21,6 +21,8 @@ * of the pixel format attributes of a GL drawable. * * @see GLCanvas + * @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */
--- a/dwt/printing/PrintDialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/printing/PrintDialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -35,6 +35,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class PrintDialog : Dialog {
--- a/dwt/printing/Printer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/printing/Printer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -47,6 +47,8 @@ * * @see PrinterData * @see PrintDialog + * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Printer : Device { /** @@ -417,7 +419,9 @@ /** * Returns a rectangle describing the receiver's size and location. - * For a printer, this is the size of a physical page, in pixels. + * <p> + * For a printer, this is the size of the physical page, in pixels. + * </p> * * @return the bounding rectangle * @@ -438,8 +442,10 @@ /** * Returns a rectangle which describes the area of the * receiver which is capable of displaying data. + * <p> * For a printer, this is the size of the printable area - * of a page, in pixels. + * of the page, in pixels. + * </p> * * @return the client area * @@ -458,28 +464,32 @@ } /** - * Given a desired <em>client area</em> for the receiver - * (as described by the arguments), returns the bounding - * rectangle which would be required to produce that client - * area. + * Given a <em>client area</em> (as described by the arguments), + * returns a rectangle, relative to the client area's coordinates, + * that is the client area expanded by the printer's trim (or minimum margins). * <p> - * In other words, it returns a rectangle such that, if the - * receiver's bounds were set to that rectangle, the area - * of the receiver which is capable of displaying data - * (that is, not covered by the "trimmings") would be the - * rectangle described by the arguments (relative to the - * receiver's parent). - * </p><p> - * Note that there is no setBounds for a printer. This method - * is usually used by passing in the client area (the 'printable - * area') of the printer. It can also be useful to pass in 0, 0, 0, 0. + * Most printers have a minimum margin on each edge of the paper where the + * printer device is unable to print. This margin is known as the "trim." + * This method can be used to calculate the printer's minimum margins + * by passing in a client area of 0, 0, 0, 0 and then using the resulting + * x and y coordinates (which will be <= 0) to determine the minimum margins + * for the top and left edges of the paper, and the resulting width and height + * (offset by the resulting x and y) to determine the minimum margins for the + * bottom and right edges of the paper, as follows: + * <ul> + * <li>The left trim width is -x pixels</li> + * <li>The top trim height is -y pixels</li> + * <li>The right trim width is (x + width) pixels</li> + * <li>The bottom trim height is (y + height) pixels</li> + * </ul> * </p> * - * @param x the desired x coordinate of the client area - * @param y the desired y coordinate of the client area - * @param width the desired width of the client area - * @param height the desired height of the client area - * @return the required bounds to produce the given client area + * @param x the x coordinate of the client area + * @param y the y coordinate of the client area + * @param width the width of the client area + * @param height the height of the client area + * @return a rectangle, relative to the client area's coordinates, that is + * the client area expanded by the printer's trim (or minimum margins) * * @exception DWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
--- a/dwt/printing/PrinterData.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/printing/PrinterData.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -33,6 +33,8 @@ * @see Printer * @see Printer#getPrinterList * @see PrintDialog#open + * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class PrinterData : DeviceData {
--- a/dwt/program/Program.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/program/Program.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -24,6 +24,9 @@ * Instances of this class represent programs and * their associated file extensions in the operating * system. + * + * @see <a href="http://www.eclipse.org/swt/snippets/#program">Program snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Program { String name;
--- a/dwt/widgets/Button.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Button.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -52,6 +52,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#button">Button snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Button : Control { @@ -680,6 +684,8 @@ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> + * + * @since 3.4 */ public bool getGrayed () { checkWidget(); @@ -790,7 +796,7 @@ return CharacterToUpper (key) is CharacterToUpper (mnemonic); } -void printWidget (HWND hwnd, HDC hDC) { +void printWidget (HWND hwnd, GC gc) { /* * Bug in Windows. For some reason, PrintWindow() fails * when it is called on a push button. The fix is to @@ -798,6 +804,7 @@ * that WM_PRINT cannot be used all the time because it * fails for browser controls when the browser has focus. */ + int /*long*/ hDC = gc.handle; if (!OS.PrintWindow (hwnd, hDC, 0)) { int flags = OS.PRF_CLIENT | OS.PRF_NONCLIENT | OS.PRF_ERASEBKGND | OS.PRF_CHILDREN; OS.SendMessage (hwnd, OS.WM_PRINT, hDC, flags); @@ -992,6 +999,8 @@ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> + * + * @since 3.4 */ public void setGrayed (bool grayed) { checkWidget ();
--- a/dwt/widgets/Canvas.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Canvas.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,9 @@ * </p> * * @see Composite + * @see <a href="http://www.eclipse.org/swt/snippets/#canvas">Canvas snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Canvas : Composite { @@ -147,7 +150,7 @@ * drawing in the window any other time. * </p> * - * @return the caret + * @return the caret for the receiver, may be null * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
--- a/dwt/widgets/Caret.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Caret.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,6 +41,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#caret">Caret snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Canvas tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Caret : Widget {
--- a/dwt/widgets/ColorDialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ColorDialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,9 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ColorDialog : Dialog {
--- a/dwt/widgets/Combo.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Combo.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -66,6 +66,9 @@ * </p> * * @see List + * @see <a href="http://www.eclipse.org/swt/snippets/#combo">Combo snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Combo : Composite {
--- a/dwt/widgets/Composite.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Composite.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -63,6 +63,8 @@ * </p> * * @see Canvas + * @see <a href="http://www.eclipse.org/swt/snippets/#composite">Composite snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Composite : Scrollable { @@ -283,8 +285,6 @@ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> - * - * @since 3.4 */ /*public*/ void copyArea (GC gc, int x, int y, int width, int height) { checkWidget ();
--- a/dwt/widgets/Control.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Control.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -78,6 +78,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Control : Widget, Drawable { @@ -1192,7 +1196,9 @@ * When the mouse pointer passes over a control its appearance * is changed to match the control's cursor. * </p> - * </ul> + * + * @return the receiver's cursor or <code>null</code> + * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -1413,7 +1419,6 @@ * </ul> * * @since 3.4 - * */ public Region getRegion () { checkWidget (); @@ -1971,6 +1976,7 @@ * Prints the receiver and all children. * * @param gc the gc where the drawing occurs + * @return <code>true</code> if the operation was successful and <code>false</code> otherwise * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> @@ -1993,7 +1999,7 @@ if ((bits & OS.WS_VISIBLE) is 0) { OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 1, 0); } - printWidget (topHandle, gc.handle); + printWidget (topHandle, gc); if ((bits & OS.WS_VISIBLE) is 0) { OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 0, 0); } @@ -2002,8 +2008,8 @@ return false; } -void printWidget (HWND hwnd, HDC hDC) { - OS.PrintWindow (hwnd, hDC, 0); +void printWidget (HWND hwnd, GC gc) { + OS.PrintWindow (hwnd, gc.handle, 0); } /** @@ -3107,7 +3113,6 @@ * </ul> * * @since 3.4 - * */ public void setRegion (Region region) { checkWidget ();
--- a/dwt/widgets/CoolBar.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/CoolBar.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -50,6 +50,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#coolbar">CoolBar snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CoolBar : Composite {
--- a/dwt/widgets/CoolItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/CoolItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,6 +41,8 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class CoolItem : Item {
--- a/dwt/widgets/DateTime.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/DateTime.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -50,6 +50,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#datetime">DateTime snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.3 */ @@ -80,11 +84,69 @@ icex.dwSize = INITCOMMONCONTROLSEX.sizeof; icex.dwICC = OS.ICC_DATE_CLASSES; OS.InitCommonControlsEx (&icex); + } + static { //TODO review WNDCLASS lpWndClass; OS.GetClassInfo (null, DateTimeClass, &lpWndClass); DateTimeProc = lpWndClass.lpfnWndProc; + /* + * Feature in Windows. The date time window class + * does not include CS_DBLCLKS. This means that these + * controls will not get double click messages such as + * WM_LBUTTONDBLCLK. The fix is to register a new + * window class with CS_DBLCLKS. + * + * NOTE: Screen readers look for the exact class name + * of the control in order to provide the correct kind + * of assistance. Therefore, it is critical that the + * new window class have the same name. It is possible + * to register a local window class with the same name + * as a global class. Since bits that affect the class + * are being changed, it is possible that other native + * code, other than DWT, could create a control with + * this class name, and fail unexpectedly. + */ + int /*long*/ hInstance = OS.GetModuleHandle (null); + int /*long*/ hHeap = OS.GetProcessHeap (); + lpWndClass.hInstance = hInstance; + lpWndClass.style &= ~OS.CS_GLOBALCLASS; + lpWndClass.style |= OS.CS_DBLCLKS; + int byteCount = DateTimeClass.length () * TCHAR.sizeof; + int /*long*/ lpszClassName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); + OS.MoveMemory (lpszClassName, DateTimeClass, byteCount); + lpWndClass.lpszClassName = lpszClassName; + OS.RegisterClass (lpWndClass); + OS.HeapFree (hHeap, 0, lpszClassName); OS.GetClassInfo (null, CalendarClass, &lpWndClass); CalendarProc = lpWndClass.lpfnWndProc; + /* + * Feature in Windows. The date time window class + * does not include CS_DBLCLKS. This means that these + * controls will not get double click messages such as + * WM_LBUTTONDBLCLK. The fix is to register a new + * window class with CS_DBLCLKS. + * + * NOTE: Screen readers look for the exact class name + * of the control in order to provide the correct kind + * of assistance. Therefore, it is critical that the + * new window class have the same name. It is possible + * to register a local window class with the same name + * as a global class. Since bits that affect the class + * are being changed, it is possible that other native + * code, other than DWT, could create a control with + * this class name, and fail unexpectedly. + */ + int /*long*/ hInstance = OS.GetModuleHandle (null); + int /*long*/ hHeap = OS.GetProcessHeap (); + lpWndClass.hInstance = hInstance; + lpWndClass.style &= ~OS.CS_GLOBALCLASS; + lpWndClass.style |= OS.CS_DBLCLKS; + int byteCount = CalendarClass.length () * TCHAR.sizeof; + int /*long*/ lpszClassName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); + OS.MoveMemory (lpszClassName, CalendarClass, byteCount); + lpWndClass.lpszClassName = lpszClassName; + OS.RegisterClass (lpWndClass); + OS.HeapFree (hHeap, 0, lpszClassName); static_this_completed = true; } }
--- a/dwt/widgets/Decorations.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Decorations.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -109,6 +109,7 @@ * @see #getMaximized * @see Shell * @see DWT + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Decorations : Canvas {
--- a/dwt/widgets/Dialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Dialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -78,6 +78,8 @@ * </p> * * @see Shell + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Dialog {
--- a/dwt/widgets/DirectoryDialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/DirectoryDialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#directorydialog">DirectoryDialog snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class DirectoryDialog : Dialog {
--- a/dwt/widgets/Display.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Display.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -131,6 +131,8 @@ * @see #readAndDispatch * @see #sleep * @see Device#dispose + * @see <a href="http://www.eclipse.org/swt/snippets/#display">Display snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Display : Device { @@ -744,7 +746,27 @@ override protected void checkDevice () { if (thread is null) error (DWT.ERROR_WIDGET_DISPOSED); - if (thread !is Thread.getThis ()) error (DWT.ERROR_THREAD_INVALID_ACCESS); + if (thread !is Thread.getThis ()) { + /* + * Bug in IBM JVM 1.6. For some reason, under + * conditions that are yet to be full understood, + * Thread.currentThread() is either returning null + * or a different instance from the one that was + * saved when the Display was created. This is + * possibly a JIT problem because modifying this + * method to print logging information when the + * error happens seems to fix the problem. The + * fix is to use operating system calls to verify + * that the current thread is not the Display thread. + * + * NOTE: Despite the fact that Thread.currentThread() + * is used in other places, the failure has not been + * observed in all places where it is called. + */ + if (threadId !is OS.GetCurrentThreadId ()) { + error (DWT.ERROR_THREAD_INVALID_ACCESS); + } + } if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED); } @@ -2054,11 +2076,21 @@ MSG* keyMsg = cast(MSG*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, MSG.sizeof); *keyMsg = *msg; OS.PostMessage (hwndMessage, SWT_KEYMSG, wParam, cast(int)keyMsg); - msg.message = OS.WM_NULL; - //OS.MoveMemory (lParam, msg, MSG.sizeof); + switch ((int)/*64*/msg.wParam) { + case OS.VK_SHIFT: + case OS.VK_MENU: + case OS.VK_CONTROL: + case OS.VK_CAPITAL: + case OS.VK_NUMLOCK: + case OS.VK_SCROLL: + break; + default: + msg.message = OS.WM_NULL; + //OS.MoveMemory (lParam, msg, MSG.sizeof); + } } + default: } - default: } } return OS.CallNextHookEx (msgHook, code, wParam, lParam); @@ -3020,6 +3052,15 @@ default: } } + switch ((int)/*64*/keyMsg.wParam) { + case OS.VK_SHIFT: + case OS.VK_MENU: + case OS.VK_CONTROL: + case OS.VK_CAPITAL: + case OS.VK_NUMLOCK: + case OS.VK_SCROLL: + consumed = true; + } if (consumed) { auto hHeap = OS.GetProcessHeap (); OS.HeapFree (hHeap, 0, cast(void*)lParam); @@ -3792,7 +3833,7 @@ * is one of the event constants defined in class <code>DWT</code>. * * @param eventType the type of event to listen for - * @param listener the listener which should no longer be notified when the event occurs + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
--- a/dwt/widgets/Event.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Event.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -34,6 +34,8 @@ * * @see Listener * @see dwt.events.TypedEvent + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Listeners</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Event { @@ -172,7 +174,8 @@ /** * depending on the event, the range of text being modified. - * Setting these fields has no effect. + * Setting these fields only has effect during ImeComposition + * events. */ public int start, end;
--- a/dwt/widgets/EventTable.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/EventTable.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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
--- a/dwt/widgets/ExpandBar.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ExpandBar.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -61,6 +61,9 @@ * @see ExpandEvent * @see ExpandListener * @see ExpandAdapter + * @see <a href="http://www.eclipse.org/swt/snippets/#expandbar">ExpandBar snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */ @@ -557,6 +560,8 @@ /** * Sets the receiver's spacing. Spacing specifies the number of pixels allocated around * each item. + * + * @param spacing the spacing around each item * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
--- a/dwt/widgets/ExpandItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ExpandItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,7 @@ * </p> * * @see ExpandBar + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.2 */
--- a/dwt/widgets/FileDialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/FileDialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#filedialog">FileDialog snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class FileDialog : Dialog { String [] filterNames; @@ -531,8 +535,10 @@ * which may be null. * <p> * The strings are platform specific. For example, on - * Windows, an extension filter string is typically of - * the form "*.extension", where "*.*" matches all files. + * some platforms, an extension filter string is typically + * of the form "*.extension", where "*.*" matches all files. + * For filters with multiple extensions, use semicolon as + * a separator, e.g. "*.jpg;*.png". * </p> * * @param extensions the file extension filter
--- a/dwt/widgets/FontDialog.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/FontDialog.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,9 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class FontDialog : Dialog { FontData fontData;
--- a/dwt/widgets/Group.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Group.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -16,6 +16,7 @@ import dwt.DWT; import dwt.DWTException; import dwt.graphics.Font; +import dwt.graphics.GC; import dwt.graphics.Point; import dwt.graphics.Rectangle; import dwt.internal.win32.OS; @@ -42,6 +43,9 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Group : Composite { @@ -316,6 +320,38 @@ return CharacterToUpper (key) is CharacterToUpper (mnemonic); } +void printWidget (int /*long*/ hwnd, GC gc) { + /* + * Bug in Windows. For some reason, PrintWindow() fails + * when it is called on a push button. The fix is to + * detect the failure and use WM_PRINT instead. Note + * that WM_PRINT cannot be used all the time because it + * fails for browser controls when the browser has focus. + */ + int /*long*/ hDC = gc.handle; + if (!OS.PrintWindow (hwnd, hDC, 0)) { + /* + * Bug in Windows. For some reason, WM_PRINT when called + * with PRF_CHILDREN will not draw the tool bar divider + * for tool bar children that do not have CCS_NODIVIDER. + * The fix is to draw the group box and iterate through + * the children, drawing each one. + */ + int flags = OS.PRF_CLIENT | OS.PRF_NONCLIENT | OS.PRF_ERASEBKGND; + OS.SendMessage (hwnd, OS.WM_PRINT, hDC, flags); + int nSavedDC = OS.SaveDC (hDC); + Control [] children = _getChildren (); + Rectangle rect = getBounds (); + OS.IntersectClipRect (hDC, 0, 0, rect.width, rect.height); + for (int i=children.length - 1; i>=0; --i) { + Point location = children [i].getLocation (); + OS.SetWindowOrgEx (hDC, -location.x, -location.y, null); + children [i].print (gc); + } + OS.RestoreDC (hDC, nSavedDC); + } +} + override void releaseWidget () { super.releaseWidget (); text = null;
--- a/dwt/widgets/IME.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/IME.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -12,6 +12,7 @@ import dwt.DWT; +import dwt.DWTException; import dwt.graphics.Color; import dwt.graphics.TextStyle; import dwt.internal.win32.OS; @@ -25,21 +26,25 @@ import dwt.dwthelper.utils; /** - * TODO - JAVA DOC + * Instances of this class represent input method editors. + * These are typically in-line pre-edit text areas that allow + * the user to compose characters from Far Eastern languages + * such as Japanese, Chinese or Korean. * * <dl> * <dt><b>Styles:</b></dt> * <dd>(none)</dd> * <dt><b>Events:</b></dt> - * <dd>(none)</dd> + * <dd>ImeComposition</dd> * </dl> * <p> - * . + * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.4 */ - public class IME : Widget { Canvas parent; int caretOffset; @@ -76,8 +81,31 @@ } /** + * Constructs a new instance of this class given its parent + * and a style value describing its behavior and appearance. + * <p> + * The style value is either one of the style constants defined in + * class <code>DWT</code> which is applicable to instances of this + * class, or must be built by <em>bitwise OR</em>'ing together + * (that is, using the <code>int</code> "|" operator) two or more + * of those <code>DWT</code> style constants. The class description + * lists the style constants that are applicable to the class. + * Style bits are also inherited from superclasses. + * </p> * - * @see DWT + * @param parent a canvas control which will be the parent of the new instance (cannot be null) + * @param style the style of control to construct + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> + * </ul> + * @exception DWTException <ul> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> + * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> + * </ul> + * + * @see Widget#checkSubclass + * @see Widget#getStyle */ public this (Canvas parent, int style) { super (parent, style); @@ -86,23 +114,62 @@ } void createWidget () { - text = ""; + text = ""; //$NON-NLS-1$ startOffset = -1; if (parent.getIME () is null) { parent.setIME (this); } } +/** + * Returns the offset of the caret from the start of the document. + * The caret is within the current composition. + * + * @return the caret offset + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public int getCaretOffset () { checkWidget (); return startOffset + caretOffset; } +/** + * Returns the commit count of the composition. This is the + * number of characters that have been composed. When the + * commit count is equal to the length of the composition + * text, then the in-line edit operation is complete. + * + * @return the commit count + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see IME#getText + */ public int getCommitCount () { checkWidget (); return commitCount; } +/** + * Returns the offset of the composition from the start of the document. + * This is the start offset of the composition within the document and + * in not changed by the input method editor itself during the in-line edit + * session. + * + * @return the offset of the composition + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public int getCompositionOffset () { checkWidget (); return startOffset; @@ -165,6 +232,24 @@ return pda; } +/** + * Returns the ranges for the style that should be applied during the + * in-line edit session. + * <p> + * The ranges array contains start and end pairs. Each pair refers to + * the corresponding style in the styles array. For example, the pair + * that starts at ranges[n] and ends at ranges[n+1] uses the style + * at styles[n/2] returned by <code>getStyles()</code>. + * </p> + * @return the ranges for the styles + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see IME#getStyles + */ public int [] getRanges () { checkWidget (); if (ranges is null) return new int [0]; @@ -175,6 +260,24 @@ return result; } +/** + * Returns the styles for the ranges. + * <p> + * The ranges array contains start and end pairs. Each pair refers to + * the corresponding style in the styles array. For example, the pair + * that starts at ranges[n] and ends at ranges[n+1] uses the style + * at styles[n/2]. + * </p> + * + * @return the ranges for the styles + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see IME#getRanges + */ public TextStyle [] getStyles () { checkWidget (); if (styles is null) return new TextStyle [0]; @@ -183,11 +286,40 @@ return result; } +/** + * Returns the composition text. + * <p> + * The text for an IME is the characters in the widget that + * are in the current composition. When the commit count is + * equal to the length of the composition text, then the + * in-line edit operation is complete. + * </p> + * + * @return the widget text + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public String getText () { checkWidget (); return text; } +/** + * Returns <code>true</code> if the caret should be wide, and + * <code>false</code> otherwise. In some languages, for example + * Korean, the caret is typically widened to the width of the + * current character in the in-line edit session. + * + * @return the wide caret state + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public bool getWideCaret() { checkWidget (); auto layout = OS.GetKeyboardLayout (0); @@ -213,6 +345,22 @@ ranges = null; } +/** + * Sets the offset of the composition from the start of the document. + * This is the start offset of the composition within the document and + * in not changed by the input method editor itself during the in-line edit + * session but may need to be changed by clients of the IME. For example, + * if during an in-line edit operation, a text editor inserts characters + * above the IME, then the IME must be informed that the composition + * offset has changed. + * + * @return the offset of the composition + * + * @exception DWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public void setCompositionOffset (int offset) { checkWidget (); if (offset < 0) return; @@ -250,7 +398,7 @@ commitCount = text.length ; sendEvent (DWT.ImeComposition, event); String chars = text; - text = ""; + text = ""; //$NON-NLS-1$ startOffset = -1; commitCount = 0; if (event.doit) {
--- a/dwt/widgets/Item.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Item.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -28,6 +28,8 @@ * <dt><b>Events:</b></dt> * <dd>(none)</dd> * </dl> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Item : Widget {
--- a/dwt/widgets/Label.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Label.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,7 +41,6 @@ * do not specify a shadow style. * </p> * <dl> - * <dl> * <dt><b>Styles:</b></dt> * <dd>SEPARATOR, HORIZONTAL, VERTICAL</dd> * <dd>SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd> @@ -57,6 +56,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#label">Label snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Label : Control { @@ -434,7 +437,7 @@ * contains an image, the image is misaligned. The * fix is to draw the background in WM_ERASEBKGND. */ - if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { + if (OS.COMCTL32_MAJOR < 6) { if (findImageControl () !is null) OS.InvalidateRect (handle, null, true); } } @@ -480,7 +483,7 @@ * contains an image, the image is misaligned. The * fix is to draw the background in WM_ERASEBKGND. */ - if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { + if (OS.COMCTL32_MAJOR < 6) { if (findImageControl () !is null) { drawBackground (cast(HANDLE)wParam); return LRESULT.ONE; @@ -552,7 +555,7 @@ * fix is to draw the background in WM_ERASEBKGND. */ LRESULT result = super.wmColorChild (wParam, lParam); - if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { + if (OS.COMCTL32_MAJOR < 6) { int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); if ((bits & OS.SS_OWNERDRAW) !is OS.SS_OWNERDRAW) { if (findImageControl () !is null) {
--- a/dwt/widgets/Layout.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Layout.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -23,7 +23,8 @@ * This class is the abstract base class for * layouts. * - * @see Composite#setLayout(Layout) + * @see Composite#setLayout(Layout) + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Layout {
--- a/dwt/widgets/Link.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Link.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -58,6 +58,10 @@ * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#link">Link snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class Link : Control {
--- a/dwt/widgets/List.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/List.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -43,6 +43,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#list">List snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class List : Scrollable {
--- a/dwt/widgets/Menu.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Menu.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -48,6 +48,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#menu">Menu snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Menu : Widget {
--- a/dwt/widgets/MenuItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/MenuItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -49,6 +49,8 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class MenuItem : Item {
--- a/dwt/widgets/MessageBox.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/MessageBox.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -40,6 +40,9 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class MessageBox : Dialog {
--- a/dwt/widgets/Monitor.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Monitor.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -19,6 +19,8 @@ * Instances of this class are descriptions of monitors. * * @see Display + * @see <a href="http://www.eclipse.org/swt/snippets/#monitor">Monitor snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */
--- a/dwt/widgets/ProgressBar.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ProgressBar.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#progressbar">ProgressBar snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ProgressBar : Control { @@ -211,8 +215,12 @@ } /** - * Returns the state of the receiver. The value will be one of - * <code>NORMAL</code>, <code>ERROR</code> or <code>PAUSED</code>. + * Returns the state of the receiver. The value will be one of: + * <ul> + * <li>{@link DWT#NORMAL}</li> + * <li>{@link DWT#ERROR}</li> + * <li>{@link DWT#PAUSED}</li> + * </ul> * * @return the state * @@ -349,8 +357,12 @@ } /** - * Sets the state of the receiver. The state is be one of - * <code>NORMAL</code>, <code>ERROR</code> or <code>PAUSED</code>. + * Sets the state of the receiver. The state must be one of these values: + * <ul> + * <li>{@link DWT#NORMAL}</li> + * <li>{@link DWT#ERROR}</li> + * <li>{@link DWT#PAUSED}</li> + * </ul> * * @param state the new state *
--- a/dwt/widgets/Sash.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Sash.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#sash">Sash snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Sash : Control {
--- a/dwt/widgets/Scale.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Scale.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -42,6 +42,10 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#scale">Scale snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Scale : Control {
--- a/dwt/widgets/ScrollBar.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ScrollBar.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -93,6 +93,8 @@ * @see Scrollable * @see Scrollable#getHorizontalBar * @see Scrollable#getVerticalBar + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ScrollBar : Widget {
--- a/dwt/widgets/Scrollable.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Scrollable.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -45,6 +45,8 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Scrollable : Control {
--- a/dwt/widgets/Shell.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Shell.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -133,6 +133,9 @@ * * @see Decorations * @see DWT + * @see <a href="http://www.eclipse.org/swt/snippets/#shell">Shell snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Shell : Decorations { @@ -885,7 +888,8 @@ } /** - * Returns the receiver's alpha value. + * Returns the receiver's alpha value. The alpha value + * is between 0 (transparent) and 255 (opaque). * * @return the alpha value * @@ -1406,7 +1410,8 @@ } /** - * Sets the receiver's alpha value. + * Sets the receiver's alpha value which must be + * between 0 (transparent) and 255 (opaque). * <p> * This operation requires the operating system's advanced * widgets subsystem which may not be available on some
--- a/dwt/widgets/Slider.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Slider.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -73,6 +73,9 @@ * </p> * * @see ScrollBar + * @see <a href="http://www.eclipse.org/swt/snippets/#slider">Slider snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Slider : Control {
--- a/dwt/widgets/Spinner.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Spinner.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -52,6 +52,10 @@ * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#spinner">Spinner snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class Spinner : Composite {
--- a/dwt/widgets/Synchronizer.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Synchronizer.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,7 @@ * </p> * * @see Display#setSynchronizer + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Synchronizer { Display display;
--- a/dwt/widgets/TabFolder.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TabFolder.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -56,6 +56,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#tabfolder">TabFolder, TabItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TabFolder : Composite {
--- a/dwt/widgets/TabItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TabItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -37,6 +37,9 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#tabfolder">TabFolder, TabItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TabItem : Item {
--- a/dwt/widgets/Table.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Table.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -23,6 +23,7 @@ import dwt.graphics.Point; import dwt.graphics.Rectangle; import dwt.internal.ImageList; +import dwt.internal.win32.BITMAPINFOHEADER; import dwt.internal.win32.OS; import dwt.widgets.Composite; @@ -82,6 +83,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Table : Composite { @@ -112,8 +117,9 @@ static const int HEADER_EXTRA = 3; static const int VISTA_EXTRA = 2; static const int EXPLORER_EXTRA = 2; - static final int H_SCROLL_LIMIT = 32; - static final int V_SCROLL_LIMIT = 16; + static const int H_SCROLL_LIMIT = 32; + static const int V_SCROLL_LIMIT = 16; + static const int DRAG_IMAGE_SIZE = 301; static const bool EXPLORER_THEME = true; private static /+const+/ WNDPROC TableProc; static const TCHAR[] TableClass = OS.WC_LISTVIEW; @@ -5427,16 +5433,89 @@ } if (msg is Display.DI_GETDRAGIMAGE) { /* - * Bug in Windows. For some reason, DI_GETDRAGIMAGE + * Bug in Windows. On Vista, for some reason, DI_GETDRAGIMAGE * returns an image that does not contain strings. - * The fix is to disable the table window proc. * - * NOTE: This only happens on Vista. + * Bug in Windows. For custom draw control the window origin the + * in HDC is wrong. + * + * The fix for both cases is to create the image using PrintWindow(). */ - if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) return 0; - //TEMPORARY CODE - if (hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) return 0; -// if (getSelectionCount () !is 1) return 0; + if ((!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) || hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) { + int topIndex = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETTOPINDEX, 0, 0); + int selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, topIndex - 1, OS.LVNI_SELECTED); + if (selection is -1) return 0; + POINT mousePos = new POINT (); + OS.POINTSTOPOINT (mousePos, OS.GetMessagePos ()); + OS.MapWindowPoints(0, handle, mousePos, 1); + RECT clientRect = new RECT (); + OS.GetClientRect (handle, clientRect); + TableItem item = _getItem (selection); + RECT rect = item.getBounds (selection, 0, true, true, true); + if ((style & DWT.FULL_SELECTION) !is 0) { + int width = DRAG_IMAGE_SIZE; + rect.left = Math.max (clientRect.left, mousePos.x - width / 2); + if (clientRect.right > rect.left + width) { + rect.right = rect.left + width; + } else { + rect.right = clientRect.right; + rect.left = Math.max (clientRect.left, rect.right - width); + } + } + int /*long*/ hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); + while ((selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, selection, OS.LVNI_SELECTED)) !is -1) { + if (rect.bottom - rect.top > DRAG_IMAGE_SIZE) break; + if (rect.bottom > clientRect.bottom) break; + RECT itemRect = item.getBounds (selection, 0, true, true, true); + int /*long*/ rectRgn = OS.CreateRectRgn (rect.left, itemRect.top, rect.right, itemRect.bottom); + OS.CombineRgn (hRgn, hRgn, rectRgn, OS.RGN_OR); + OS.DeleteObject (rectRgn); + rect.bottom = itemRect.bottom; + } + OS.GetRgnBox (hRgn, rect); + + /* Create resources */ + int /*long*/ hdc = OS.GetDC (handle); + int /*long*/ memHdc = OS.CreateCompatibleDC (hdc); + BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER (); + bmiHeader.biSize = BITMAPINFOHEADER.sizeof; + bmiHeader.biWidth = rect.right - rect.left; + bmiHeader.biHeight = -(rect.bottom - rect.top); + bmiHeader.biPlanes = 1; + bmiHeader.biBitCount = 32; + bmiHeader.biCompression = OS.BI_RGB; + byte [] bmi = new byte [BITMAPINFOHEADER.sizeof]; + OS.MoveMemory (bmi, bmiHeader, BITMAPINFOHEADER.sizeof); + int /*long*/ [] pBits = new int /*long*/ [1]; + int /*long*/ memDib = OS.CreateDIBSection (0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0); + if (memDib is 0) DWT.error (DWT.ERROR_NO_HANDLES); + int /*long*/ oldMemBitmap = OS.SelectObject (memHdc, memDib); + int colorKey = 0x0000FD; + POINT pt = new POINT(); + OS.SetWindowOrgEx (memHdc, rect.left, rect.top, pt); + OS.FillRect (memHdc, rect, findBrush (colorKey, OS.BS_SOLID)); + OS.OffsetRgn (hRgn, -rect.left, -rect.top); + OS.SelectClipRgn (memHdc, hRgn); + OS.PrintWindow (handle, memHdc, 0); + OS.SetWindowOrgEx (memHdc, pt.x, pt.y, null); + OS.SelectObject (memHdc, oldMemBitmap); + OS.DeleteDC (memHdc); + OS.ReleaseDC (0, hdc); + OS.DeleteObject (hRgn); + + SHDRAGIMAGE shdi = new SHDRAGIMAGE (); + shdi.hbmpDragImage = memDib; + shdi.crColorKey = colorKey; + shdi.sizeDragImage.cx = bmiHeader.biWidth; + shdi.sizeDragImage.cy = -bmiHeader.biHeight; + shdi.ptOffset.x = mousePos.x - rect.left; + shdi.ptOffset.y = mousePos.y - rect.top; + if ((style & DWT.MIRRORED) !is 0) { + shdi.ptOffset.x = shdi.sizeDragImage.cx - shdi.ptOffset.x; + } + OS.MoveMemory (lParam, shdi, SHDRAGIMAGE.sizeof); + return 1; + } } return super.windowProc (hwnd, msg, wParam, lParam); }
--- a/dwt/widgets/TableColumn.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TableColumn.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,9 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TableColumn : Item { Table parent;
--- a/dwt/widgets/TableItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TableItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -39,6 +39,9 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TableItem : Item {
--- a/dwt/widgets/Text.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Text.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -56,6 +56,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#text">Text snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Text : Scrollable {
--- a/dwt/widgets/ToolBar.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ToolBar.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -51,6 +51,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#toolbar">ToolBar, ToolItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ToolBar : Composite {
--- a/dwt/widgets/ToolItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ToolItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -45,6 +45,9 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#toolbar">ToolBar, ToolItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ToolItem : Item { ToolBar parent;
--- a/dwt/widgets/ToolTip.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/ToolTip.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -46,6 +46,10 @@ * within the DWT implementation. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#tooltips">Tool Tips snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.2 */
--- a/dwt/widgets/Tracker.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Tracker.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -49,6 +49,9 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#tracker">Tracker snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Tracker : Widget { Control parent;
--- a/dwt/widgets/Tray.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Tray.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -36,6 +36,8 @@ * </p> * * @see Display#getSystemTray + * @see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * * @since 3.0 */
--- a/dwt/widgets/TrayItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TrayItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -43,6 +43,9 @@ * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.0 */ public class TrayItem : Item {
--- a/dwt/widgets/Tree.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Tree.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -25,6 +25,7 @@ import dwt.graphics.Point; import dwt.graphics.Rectangle; import dwt.internal.ImageList; +import dwt.internal.win32.BITMAPINFOHEADER; import dwt.internal.win32.OS; import dwt.widgets.Composite; @@ -93,6 +94,10 @@ * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class Tree : Composite { @@ -129,6 +134,7 @@ static const int HEADER_EXTRA = 3; static const int INCREMENT = 5; static const int EXPLORER_EXTRA = 2; + static const int DRAG_IMAGE_SIZE = 301; static const bool EXPLORER_THEME = true; private static /+const+/ WNDPROC TreeProc; static const TCHAR[] TreeClass = OS.WC_TREEVIEW; @@ -234,11 +240,14 @@ OS.SendMessage (handle, OS.TVM_SETSCROLLTIME, 0, 0); int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); if (eventType is DWT.MeasureItem) { - if (explorerTheme) { - int bits1 = OS.SendMessage (handle, OS.TVM_GETEXTENDEDSTYLE, 0, 0); - bits1 &= ~OS.TVS_EX_AUTOHSCROLL; - OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits1); - } + /* + * This code is intentionally commented. + */ +// if (explorerTheme) { +// int bits1 = (int)/*64*/OS.SendMessage (handle, OS.TVM_GETEXTENDEDSTYLE, 0, 0); +// bits1 &= ~OS.TVS_EX_AUTOHSCROLL; +// OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits1); +// } bits |= OS.TVS_NOHSCROLL; } /* @@ -1873,7 +1882,10 @@ explorerTheme = true; OS.SetWindowTheme (handle, cast(TCHAR*) Display.EXPLORER, null); int bits = OS.TVS_EX_DOUBLEBUFFER | OS.TVS_EX_FADEINOUTEXPANDOS | OS.TVS_EX_RICHTOOLTIP; - if ((style & DWT.FULL_SELECTION) is 0) bits |= OS.TVS_EX_AUTOHSCROLL; + /* + * This code is intentionally commented. + */ +// if ((style & DWT.FULL_SELECTION) is 0) bits |= OS.TVS_EX_AUTOHSCROLL; OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits); /* * Bug in Windows. When the tree is using the explorer @@ -3839,7 +3851,7 @@ } RECT rect; int index = 0, count = OS.SendMessage (handle, OS.TVM_GETVISIBLECOUNT, 0, 0); - while (index < count && hItem !is null) { + while (index <= count && hItem !is null) { int state = 0; static if (OS.IsWinCE) { tvItem.hItem = hItem; @@ -5745,8 +5757,6 @@ return callWindowProc (hwnd, msg, wParam, lParam); } if (msg is Display.DI_GETDRAGIMAGE) { - //TEMPORARY CODE - if (hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) return 0; /* * When there is more than one item selected, DI_GETDRAGIMAGE * returns the item under the cursor. This happens because @@ -5754,8 +5764,87 @@ * is to disable DI_GETDRAGIMAGE when more than one item is * selected. */ - if ((style & DWT.MULTI) !is 0) { - if (getSelectionCount () !is 1) return 0; + if ((style & DWT.MULTI) !is 0 || hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) { + int /*long*/ hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_FIRSTVISIBLE, 0); + TreeItem [] items = new TreeItem [10]; + TVITEM tvItem = new TVITEM (); + tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM | OS.TVIF_STATE; + int count = getSelection (hItem, tvItem, items, 0, 10, false, true); + if (count is 0) return 0; + POINT mousePos = new POINT (); + OS.POINTSTOPOINT (mousePos, OS.GetMessagePos ()); + OS.MapWindowPoints (0, handle, mousePos, 1); + RECT clientRect = new RECT (); + OS.GetClientRect(handle, clientRect); + RECT rect = items [0].getBounds (0, true, true, false); + if ((style & DWT.FULL_SELECTION) !is 0) { + int width = DRAG_IMAGE_SIZE; + rect.left = Math.max (clientRect.left, mousePos.x - width / 2); + if (clientRect.right > rect.left + width) { + rect.right = rect.left + width; + } else { + rect.right = clientRect.right; + rect.left = Math.max (clientRect.left, rect.right - width); + } + } + int /*long*/ hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); + for (int i = 1; i < count; i++) { + if (rect.bottom - rect.top > DRAG_IMAGE_SIZE) break; + if (rect.bottom > clientRect.bottom) break; + RECT itemRect = items[i].getBounds (0, true, true, false); + if ((style & DWT.FULL_SELECTION) !is 0) { + itemRect.left = rect.left; + itemRect.right = rect.right; + } + int /*long*/ rectRgn = OS.CreateRectRgn (itemRect.left, itemRect.top, itemRect.right, itemRect.bottom); + OS.CombineRgn (hRgn, hRgn, rectRgn, OS.RGN_OR); + OS.DeleteObject (rectRgn); + rect.bottom = itemRect.bottom; + + } + OS.GetRgnBox (hRgn, rect); + + /* Create resources */ + int /*long*/ hdc = OS.GetDC (handle); + int /*long*/ memHdc = OS.CreateCompatibleDC (hdc); + BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER (); + bmiHeader.biSize = BITMAPINFOHEADER.sizeof; + bmiHeader.biWidth = rect.right - rect.left; + bmiHeader.biHeight = -(rect.bottom - rect.top); + bmiHeader.biPlanes = 1; + bmiHeader.biBitCount = 32; + bmiHeader.biCompression = OS.BI_RGB; + byte [] bmi = new byte [BITMAPINFOHEADER.sizeof]; + OS.MoveMemory (bmi, bmiHeader, BITMAPINFOHEADER.sizeof); + int /*long*/ [] pBits = new int /*long*/ [1]; + int /*long*/ memDib = OS.CreateDIBSection (0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0); + if (memDib is 0) DWT.error (DWT.ERROR_NO_HANDLES); + int /*long*/ oldMemBitmap = OS.SelectObject (memHdc, memDib); + int colorKey = 0x0000FD; + POINT pt = new POINT (); + OS.SetWindowOrgEx (memHdc, rect.left, rect.top, pt); + OS.FillRect (memHdc, rect, findBrush (colorKey, OS.BS_SOLID)); + OS.OffsetRgn (hRgn, -rect.left, -rect.top); + OS.SelectClipRgn (memHdc, hRgn); + OS.PrintWindow (handle, memHdc, 0); + OS.SetWindowOrgEx (memHdc, pt.x, pt.y, null); + OS.SelectObject (memHdc, oldMemBitmap); + OS.DeleteDC (memHdc); + OS.ReleaseDC (0, hdc); + OS.DeleteObject (hRgn); + + SHDRAGIMAGE shdi = new SHDRAGIMAGE (); + shdi.hbmpDragImage = memDib; + shdi.crColorKey = colorKey; + shdi.sizeDragImage.cx = bmiHeader.biWidth; + shdi.sizeDragImage.cy = -bmiHeader.biHeight; + shdi.ptOffset.x = mousePos.x - rect.left; + shdi.ptOffset.y = mousePos.y - rect.top; + if ((style & DWT.MIRRORED) !is 0) { + shdi.ptOffset.x = shdi.sizeDragImage.cx - shdi.ptOffset.x; + } + OS.MoveMemory (lParam, shdi, SHDRAGIMAGE.sizeof); + return 1; } } return super.windowProc (hwnd, msg, wParam, lParam); @@ -6220,6 +6309,9 @@ dragStarted = gestureCompleted = false; if (fixSelection) ignoreDeselect = ignoreSelect = lockSelection = true; int /*long*/ code = callWindowProc (handle, OS.WM_LBUTTONDOWN, wParam, lParam); + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + if (OS.GetFocus () !is handle) OS.SetFocus (handle); + } if (fixSelection) ignoreDeselect = ignoreSelect = lockSelection = false; HANDLE hNewSelection = cast(HANDLE) OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0); if (hOldSelection !is hNewSelection) hAnchor = hNewSelection; @@ -6338,6 +6430,9 @@ return LRESULT.ZERO; } int /*long*/ code = callWindowProc (handle, OS.WM_LBUTTONDOWN, wParam, lParam); + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + if (OS.GetFocus () !is handle) OS.SetFocus (handle); + } if (!display.captureChanged && !isDisposed ()) { if (OS.GetCapture () !is handle) OS.SetCapture (handle); } @@ -6411,6 +6506,9 @@ dragStarted = gestureCompleted = false; ignoreDeselect = ignoreSelect = true; int /*long*/ code = callWindowProc (handle, OS.WM_LBUTTONDOWN, wParam, lParam); + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.buildVERSION (6, 0)) { + if (OS.GetFocus () !is handle) OS.SetFocus (handle); + } auto hNewItem = cast(HANDLE) OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0); if (fakeSelection) { if (hOldItem is null || (hNewItem is hOldItem && lpht.hItem !is hOldItem)) { @@ -6634,7 +6732,7 @@ * This code is intentionally commented. */ // if (OS.GetCapture () !is handle) OS.SetCapture (handle); - setFocus (); + if (OS.GetFocus () !is handle) OS.SetFocus (handle); /* * Feature in Windows. When the user selects a tree item
--- a/dwt/widgets/TreeColumn.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TreeColumn.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -44,6 +44,9 @@ * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * + * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * * @since 3.1 */ public class TreeColumn : Item {
--- a/dwt/widgets/TreeItem.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TreeItem.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -41,6 +41,9 @@ * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> + * + * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TreeItem : Item {
--- a/dwt/widgets/TypedListener.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/TypedListener.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -71,6 +71,7 @@ * </p> * * @see Listener + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class TypedListener : Listener {
--- a/dwt/widgets/Widget.d Tue Jul 01 08:58:50 2008 +0200 +++ b/dwt/widgets/Widget.d Tue Jul 01 10:15:59 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -60,6 +60,7 @@ * </p> * * @see #checkSubclass + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Widget { @@ -381,8 +382,8 @@ * that the current thread is not the Display thread. * * NOTE: Despite the fact that Thread.currentThread() - * is used in other places, the failure has only been - * observed here. + * is used in other places, the failure has not been + * observed in all places where it is called. */ if (display.threadId !is OS.GetCurrentThreadId ()) { error (DWT.ERROR_THREAD_INVALID_ACCESS); @@ -928,7 +929,7 @@ * type is one of the event constants defined in class <code>DWT</code>. * * @param eventType the type of event to listen for - * @param listener the listener which should no longer be notified when the event occurs + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> @@ -962,7 +963,7 @@ * </p> * * @param eventType the type of event to listen for - * @param listener the listener which should no longer be notified when the event occurs + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> @@ -986,7 +987,7 @@ * Removes the listener from the collection of listeners who will * be notified when the widget is disposed. * - * @param listener the listener which should no longer be notified when the receiver is disposed + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>